diff --git a/.bazelignore b/.bazelignore deleted file mode 100644 index 52ebdac6af4a..000000000000 --- a/.bazelignore +++ /dev/null @@ -1,20 +0,0 @@ -.git -dist -node_modules -packages/angular/cli/node_modules -packages/angular/create/node_modules -packages/angular/pwa/node_modules -packages/angular/build/node_modules -packages/angular/ssr/node_modules -packages/angular_devkit/architect/node_modules -packages/angular_devkit/architect_cli/node_modules -packages/angular_devkit/build_angular/node_modules -packages/angular_devkit/build_webpack/node_modules -packages/angular_devkit/core/node_modules -packages/angular_devkit/schematics/node_modules -packages/angular_devkit/schematics_cli/node_modules -packages/ngtools/webpack/node_modules -packages/schematics/angular/node_modules -modules/testing/builder/node_modules -tests/node_modules -tools/baseline_browserslist/node_modules diff --git a/.bazelrc b/.bazelrc index 4f79c86cf3b4..92e60820829a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -16,6 +16,9 @@ test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test # The below is useful to while using `fit` and `fdescribe` to avoid sharing and re-runs of failed flaky tests. test:no-sharding --flaky_test_attempts=1 --test_sharding_strategy=disabled +# Frozen lockfile +common --lockfile_mode=error + ############################### # Filesystem interactions # ############################### @@ -50,7 +53,7 @@ test --incompatible_strict_action_env build --experimental_remote_merkle_tree_cache # Ensure that tags applied in BUILDs propagate to actions -common --experimental_allow_tags_propagation +common --incompatible_allow_tags_propagation # Ensure sandboxing is enabled even for exclusive tests test --incompatible_exclusive_test_sandboxed diff --git a/.bazelversion b/.bazelversion index 93c8ddab9fef..6d2890793d47 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.6.0 +8.5.0 diff --git a/.github/shared-actions/windows-bazel-test/action.yml b/.github/shared-actions/windows-bazel-test/action.yml index 524eb1c3a684..7a5cf7c0297b 100644 --- a/.github/shared-actions/windows-bazel-test/action.yml +++ b/.github/shared-actions/windows-bazel-test/action.yml @@ -1,78 +1,42 @@ -name: 'Native Windows Bazel e2e test' -description: 'Runs an Angular CLI e2e Bazel test on native Windows (dispatched from inside WSL)' -author: 'Angular' +name: Native Windows Bazel E2E test +description: Runs an Angular CLI e2e Bazel test on native Windows +author: Angular inputs: test_target_name: - description: E2E test target name + description: E2E test target name. required: true - test_args: - description: | - Text representing the command line arguments that - should be passed to the e2e test runner. + e2e_temp_dir: + description: 'The temporary directory path for E2E tests.' required: false - default: '' + # Use D:\\ by default as it's much faster + # See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows + default: 'D:\\tmp_dir' runs: - using: composite + using: 'composite' steps: - - name: Initialize WSL - id: init_wsl - uses: angular/dev-infra/github-actions/setup-wsl@9a3e28a515bf51cd2ecfd5f4d5b17613845e6f44 - with: - wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))' - - - name: Installing pnpm (in WSL) - run: npm install -g pnpm@9 - shell: wsl-bash {0} - - - name: Install node modules in WSL (re-using from previous install/cache restore) - run: | - cd ${{steps.init_wsl.outputs.repo_path}} - pnpm install --frozen-lockfile - shell: wsl-bash {0} - - - name: Build test binary for Windows (inside WSL) - shell: wsl-bash {0} - run: | - cd ${{steps.init_wsl.outputs.repo_path}} - pnpm bazel \ - build --config=e2e //tests/legacy-cli:${{inputs.test_target_name}} --platforms=tools:windows_x64 - env: - # See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows - WSLENV: 'GOOGLE_APPLICATION_CREDENTIALS/p' - - - name: Copying binary artifact to host - shell: wsl-bash {0} + - name: Set up temp directory + shell: bash run: | - cd ${{steps.init_wsl.outputs.repo_path}} - tar -cf /tmp/test.tar.gz dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_ - mkdir /mnt/c/test - mv /tmp/test.tar.gz /mnt/c/test - (cd /mnt/c/test && tar -xf /mnt/c/test/test.tar.gz) + mkdir ${{ inputs.e2e_temp_dir }} - name: Convert symlinks for Windows host - shell: wsl-bash {0} + shell: pwsh run: | - cd ${{steps.init_wsl.outputs.repo_path}} - - runfiles_dir="/mnt/c/test/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles" - - # Make WSL symlinks compatible on Windows native file system. - node scripts/windows-testing/convert-symlinks.mjs $runfiles_dir "${{steps.init_wsl.outputs.cmd_path}}" + $runfiles_dir = "./dist/bin/tests/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles" # Needed for resolution because Aspect/Bazel looks for repositories at `/external`. # TODO(devversion): consult with Aspect on why this is needed. - (cd $runfiles_dir/_main && ${{steps.init_wsl.outputs.cmd_path}} /C "mklink /D external ..") + Set-Location -Path "${runfiles_dir}\_main" + New-Item -ItemType SymbolicLink -Path "external" -Target ".." - - name: Run tests - # Note: This is Git Bash. + - name: Run CLI E2E tests shell: bash env: BAZEL_BINDIR: '.' - working-directory: "C:\\test" + E2E_TEMP: ${{ inputs.e2e_temp_dir }} run: | - node "${{github.workspace}}\\scripts\\windows-testing\\parallel-executor.mjs" \ - $PWD/dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles \ - ${{inputs.test_target_name}} \ - "${{inputs.test_args}}" \ + node ./scripts/windows-testing/parallel-executor.mjs \ + "./dist/bin/tests/${{ inputs.test_target_name }}_/${{ inputs.test_target_name }}.bat.runfiles" \ + ${{ inputs.test_target_name }} diff --git a/.github/workflows/assistant-to-the-branch-manager.yml b/.github/workflows/assistant-to-the-branch-manager.yml index a46a76f2f4de..a30031ce31fd 100644 --- a/.github/workflows/assistant-to-the-branch-manager.yml +++ b/.github/workflows/assistant-to-the-branch-manager.yml @@ -12,10 +12,11 @@ permissions: jobs: assistant_to_the_branch_manager: runs-on: ubuntu-latest + if: github.event.repository.fork == false steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - - uses: angular/dev-infra/github-actions/branch-manager@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + - uses: angular/dev-infra/github-actions/branch-manager@942d738d8f4d65b161d06e6c399fefec318cdbfe with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b46aa942a8bb..000b239cd7a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,14 +21,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Generate JSON schema types # Schema types are required to correctly lint the TypeScript code - run: pnpm admin build-schema + run: pnpm run build-schema - name: Run ESLint run: pnpm lint --cache-strategy content - name: Validate NgBot Configuration @@ -44,11 +44,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} - name: Install node modules @@ -61,63 +61,90 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} - name: Install node modules run: pnpm install --frozen-lockfile - name: Run module and package tests - run: pnpm bazel test //modules/... //packages/... - env: - ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1' + run: pnpm bazel test -- //... -//tests/... e2e: needs: test strategy: fail-fast: false matrix: - os: [ubuntu-latest] node: [20, 22, 24] - subset: [npm, esbuild] + subset: [esbuild, webpack] shard: [0, 1, 2, 3, 4, 5] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} - name: Run CLI E2E tests - run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} + run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }} - e2e_windows: + build-e2e-windows: + runs-on: ubuntu-latest + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe + with: + google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} + - name: Install node modules + run: pnpm install --frozen-lockfile + - name: Build E2E tests for Windows on Linux + run: | + pnpm bazel build \ + --config=e2e \ + //tests:e2e.webpack_node22 \ + //tests:e2e.esbuild_node22 \ + --platforms=tools:windows_x64 + - name: Store built Windows E2E tests + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: win-e2e-build-artifacts + path: | + dist/bin/tests/** + !**/node_modules/** + retention-days: 1 + if-no-files-found: 'error' + + e2e-windows: + needs: build-e2e-windows strategy: fail-fast: false matrix: - os: [windows-2025] node: [22] - subset: [npm, esbuild] + subset: [esbuild, webpack] shard: [0, 1, 2, 3, 4, 5] - runs-on: ${{ matrix.os }} + runs-on: windows-2025 steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb - - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb - - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe + - name: Install node modules + run: pnpm install --frozen-lockfile + - name: Download built Windows E2E tests + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: - allow_windows_rbe: true - google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} + name: win-e2e-build-artifacts + path: dist/bin/tests/ - name: Run CLI E2E tests uses: ./.github/shared-actions/windows-bazel-test with: @@ -131,48 +158,47 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] node: [22] - subset: [yarn, pnpm] + subset: [yarn, pnpm, bun] shard: [0, 1, 2] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} - name: Run CLI E2E tests - run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} + run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }} e2e-snapshots: needs: test + if: github.ref == 'refs/heads/main' strategy: fail-fast: false matrix: - os: [ubuntu-latest] node: [22] - subset: [npm, esbuild] + subset: [esbuild, webpack] shard: [0, 1, 2, 3, 4, 5] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} - name: Run CLI E2E tests - run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} + run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} browsers: needs: build @@ -182,13 +208,13 @@ jobs: SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} - name: Run E2E Browser tests @@ -203,9 +229,9 @@ jobs: run: | ./scripts/saucelabs/start-tunnel.sh & ./scripts/saucelabs/wait-for-tunnel.sh - pnpm bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs + pnpm bazel test --config=saucelabs //tests:e2e.saucelabs ./scripts/saucelabs/stop-tunnel.sh - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: ${{ failure() }} with: name: sauce-connect-log @@ -218,11 +244,11 @@ jobs: CIRCLE_BRANCH: ${{ github.ref_name }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - run: pnpm admin snapshots --verbose env: SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c439b667fb5a..3932ccf6a3b8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,16 +19,16 @@ jobs: fail-fast: false steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 + uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 with: languages: javascript-typescript build-mode: none config-file: .github/codeql/config.yml - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 + uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 with: category: '/language:javascript-typescript' diff --git a/.github/workflows/dev-infra.yml b/.github/workflows/dev-infra.yml index a4c41ecb1d2c..23811dc9f573 100644 --- a/.github/workflows/dev-infra.yml +++ b/.github/workflows/dev-infra.yml @@ -12,14 +12,14 @@ jobs: labels: runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: angular/dev-infra/github-actions/commit-message-based-labels@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: angular/dev-infra/github-actions/pull-request-labeling@942d738d8f4d65b161d06e6c399fefec318cdbfe with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} post_approval_changes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: angular/dev-infra/github-actions/post-approval-changes@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: angular/dev-infra/github-actions/post-approval-changes@942d738d8f4d65b161d06e6c399fefec318cdbfe with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/feature-requests.yml b/.github/workflows/feature-requests.yml index 5f48097b7975..fae7787a6dff 100644 --- a/.github/workflows/feature-requests.yml +++ b/.github/workflows/feature-requests.yml @@ -16,6 +16,6 @@ jobs: if: github.repository == 'angular/angular-cli' runs-on: ubuntu-latest steps: - - uses: angular/dev-infra/github-actions/feature-request@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + - uses: angular/dev-infra/github-actions/feature-request@942d738d8f4d65b161d06e6c399fefec318cdbfe with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 5fbcbf75894c..abe20d3f3921 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -23,7 +23,7 @@ jobs: workflows: ${{ steps.workflows.outputs.workflows }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - id: workflows @@ -38,16 +38,16 @@ jobs: workflow: ${{ fromJSON(needs.list.outputs.workflows) }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile # We utilize the google-github-actions/auth action to allow us to get an active credential using workflow # identity federation. This allows us to request short lived credentials on demand, rather than storing # credentials in secrets long term. More information can be found at: # https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-google-cloud-platform - - uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10 + - uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0 with: project_id: 'internal-200822' workload_identity_provider: 'projects/823469418460/locations/global/workloadIdentityPools/measurables-tracking/providers/angular' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e38b513ff426..d103d3f2edcd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,7 +20,7 @@ jobs: outputs: snapshots: ${{ steps.filter.outputs.snapshots }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 @@ -28,17 +28,17 @@ jobs: with: filters: | snapshots: - - 'tests/legacy-cli/e2e/ng-snapshot/package.json' + - 'tests/e2e/ng-snapshot/package.json' lint: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup ESLint Caching - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: .eslintcache key: ${{ runner.os }}-${{ hashFiles('.eslintrc.json') }} @@ -46,7 +46,7 @@ jobs: run: pnpm install --frozen-lockfile - name: Generate JSON schema types # Schema types are required to correctly lint the TypeScript code - run: pnpm admin build-schema + run: pnpm run build-schema - name: Run ESLint run: pnpm lint --cache-strategy content - name: Validate NgBot Configuration @@ -55,8 +55,6 @@ jobs: run: pnpm ts-circular-deps check - name: Run Validation run: pnpm admin validate - - name: Check Package Licenses - uses: angular/dev-infra/github-actions/linting/licenses@2c7bab7971084f3f1f6f72735099a9591ee5ebcb - name: Check tooling setup run: pnpm check-tooling-setup - name: Check commit message @@ -67,22 +65,24 @@ jobs: # Code formatting checks are only done on pull requests as its too late to validate once # it has been merged. run: pnpm ng-dev format changed --check ${{ github.event.pull_request.base.sha }} + - name: Check Package Licenses + uses: angular/dev-infra/github-actions/linting/licenses@942d738d8f4d65b161d06e6c399fefec318cdbfe build: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Build release targets run: pnpm ng-dev release build - name: Store PR release packages - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: packages path: dist/releases/*.tgz @@ -93,79 +93,105 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Run module and package tests - run: pnpm bazel test //modules/... //packages/... - env: - ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1' + run: pnpm bazel test -- //... -//tests/... e2e: needs: build strategy: fail-fast: false matrix: - os: [ubuntu-latest] node: [22] - subset: [npm, esbuild] + subset: [esbuild, webpack] shard: [0, 1, 2, 3, 4, 5] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Run CLI E2E tests - run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} + run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }} - e2e-windows-subset: - needs: build - runs-on: windows-2025 + build-e2e-windows-subset: + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe + - name: Install node modules + run: pnpm install --frozen-lockfile + - name: Build E2E tests for Windows on Linux + run: | + pnpm bazel build \ + --config=e2e \ + //tests:e2e.esbuild_node22 \ + --platforms=tools:windows_x64 + - name: Store built Windows E2E tests + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: - allow_windows_rbe: true + name: win-e2e-build-artifacts + path: | + dist/bin/tests/** + !**/node_modules/** + retention-days: 1 + if-no-files-found: 'error' + + e2e-windows-subset: + needs: build-e2e-windows-subset + runs-on: windows-2025 + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe + - name: Install node modules + run: pnpm install --frozen-lockfile + - name: Download built Windows E2E tests + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + name: win-e2e-build-artifacts + path: dist/bin/tests/ - name: Run CLI E2E tests uses: ./.github/shared-actions/windows-bazel-test with: - test_target_name: e2e_node22 - test_args: --esbuild --glob "tests/basic/{build,rebuild}.ts" + test_target_name: e2e.esbuild_node22 + env: + E2E_SHARD_TOTAL: 1 + TESTBRIDGE_TEST_ONLY: tests/basic/{build,rebuild,serve}.ts e2e-package-managers: needs: build strategy: fail-fast: false matrix: - os: [ubuntu-latest] node: [22] - subset: [yarn, pnpm] + subset: [yarn, pnpm, bun] shard: [0, 1, 2] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Run CLI E2E tests - run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} + run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }} e2e-snapshots: needs: [analyze, build] @@ -173,19 +199,18 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] node: [22] - subset: [npm, esbuild] + subset: [esbuild, webpack] shard: [0, 1, 2, 3, 4, 5] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Install node modules run: pnpm install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/setup@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@2c7bab7971084f3f1f6f72735099a9591ee5ebcb + uses: angular/dev-infra/github-actions/bazel/configure-remote@942d738d8f4d65b161d06e6c399fefec318cdbfe - name: Run CLI E2E tests - run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} + run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c96366b92885..63ad55057037 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -25,12 +25,12 @@ jobs: steps: - name: 'Checkout code' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: 'Run analysis' - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 with: results_file: results.sarif results_format: sarif @@ -38,7 +38,7 @@ jobs: # Upload the results as artifacts. - name: 'Upload artifact' - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: SARIF file path: results.sarif @@ -46,6 +46,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 + uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 with: sarif_file: results.sarif diff --git a/.gitignore b/.gitignore index de3ad9a9154d..83582f8ece43 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,7 @@ jsconfig.json # VSCode # https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore -.vscode/ +.vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json diff --git a/.ng-dev/caretaker.mjs b/.ng-dev/caretaker.mjs index a16e023b1cd0..d21e783f4af5 100644 --- a/.ng-dev/caretaker.mjs +++ b/.ng-dev/caretaker.mjs @@ -1,6 +1,6 @@ /** * The configuration for `ng-dev caretaker` commands. - * + * * @type { import("@angular/ng-dev").CaretakerConfig } */ export const caretaker = { @@ -14,5 +14,4 @@ export const caretaker = { query: `is:pr is:open label:"action: merge-assistance"`, }, ], - caretakerGroup: 'angular-cli-caretaker', }; diff --git a/.ng-dev/commit-message.mjs b/.ng-dev/commit-message.mjs index 94fe91d8f727..d30060674355 100644 --- a/.ng-dev/commit-message.mjs +++ b/.ng-dev/commit-message.mjs @@ -1,4 +1,4 @@ -import { packages } from '../scripts/packages.mjs'; +import { packages } from '../scripts/packages.mts'; /** * The configuration for `ng-dev commit-message` commands. @@ -9,7 +9,6 @@ export const commitMessage = { maxLineLength: Infinity, minBodyLength: 0, minBodyLengthTypeExcludes: ['docs'], - disallowFixup: true, // Note: When changing this logic, also change the `contributing.ejs` file. scopes: packages.map(({ name }) => name), }; diff --git a/.ng-dev/dx-perf-workflows.yml b/.ng-dev/dx-perf-workflows.yml index 21c8b95acff3..70960ff760db 100644 --- a/.ng-dev/dx-perf-workflows.yml +++ b/.ng-dev/dx-perf-workflows.yml @@ -19,24 +19,24 @@ workflows: prepare: - bazel clean workflow: - - bazel test //packages/ngtools/webpack:webpack_test + - bazel test //packages/ngtools/webpack:test devkit-core-tests: name: '@angular/devkit/core tests' prepare: - bazel clean workflow: - - bazel test //packages/angular_devkit/core:core_test + - bazel test //packages/angular_devkit/core:test devkit-core-tests-rerun: name: '@angular/devkit/core return test' prepare: - bazel clean workflow: - - bazel test //packages/angular_devkit/core:core_test + - bazel test //packages/angular_devkit/core:test # Add a single line to the beginning of a file to trigger a rebuild/retest - sed -i '1i // comment' packages/angular_devkit/core/src/workspace/core_spec.ts - - bazel test //packages/angular_devkit/core:core_test + - bazel test //packages/angular_devkit/core:test cleanup: # Remove the single line added - sed -i '1d' packages/angular_devkit/core/src/workspace/core_spec.ts @@ -46,4 +46,4 @@ workflows: prepare: - bazel clean workflow: - - bazel test //packages/angular/build:unit_tests + - bazel test //packages/angular/build:test diff --git a/.ng-dev/format.mjs b/.ng-dev/format.mjs index 98115c626abd..c750eeea395c 100644 --- a/.ng-dev/format.mjs +++ b/.ng-dev/format.mjs @@ -4,8 +4,6 @@ * @type { import("@angular/ng-dev").FormatConfig } */ export const format = { - 'prettier': { - matchers: ['**/*.{mts,cts,ts,mjs,cjs,js,json,yml,yaml,md}'], - }, + 'prettier': true, 'buildifier': true, }; diff --git a/.ng-dev/github.mjs b/.ng-dev/github.mjs index 15e228fb5ae3..467741f70f83 100644 --- a/.ng-dev/github.mjs +++ b/.ng-dev/github.mjs @@ -1,7 +1,7 @@ /** * Github configuration for the ng-dev command. This repository is * used as remote for the merge script. - * + * * @type { import("@angular/ng-dev").GithubConfig } */ export const github = { @@ -9,4 +9,5 @@ export const github = { name: 'angular-cli', mainBranchName: 'main', useNgDevAuthService: true, + mergeMode: 'team-only', }; diff --git a/.ng-dev/pull-request.mjs b/.ng-dev/pull-request.mjs index 8beefa10c5fd..1f2d84d7ccba 100644 --- a/.ng-dev/pull-request.mjs +++ b/.ng-dev/pull-request.mjs @@ -1,12 +1,12 @@ /** * Configuration for the merge tool in `ng-dev`. This sets up the labels which * are respected by the merge script (e.g. the target labels). - * + * * @type { import("@angular/ng-dev").PullRequestConfig } */ export const pullRequest = { githubApiMerge: { - default: 'rebase', + default: 'auto', labels: [{ pattern: 'merge: squash commits', method: 'squash' }], }, }; diff --git a/.ng-dev/release.mjs b/.ng-dev/release.mjs index 3d097ea80b11..2aadf9db122c 100644 --- a/.ng-dev/release.mjs +++ b/.ng-dev/release.mjs @@ -1,5 +1,5 @@ import semver from 'semver'; -import { releasePackages } from '../scripts/packages.mjs'; +import { releasePackages } from '../scripts/packages.mts'; /** * Configuration for the `ng-dev release` command. @@ -12,14 +12,13 @@ export const release = { buildPackages: async () => { // The `performNpmReleaseBuild` function is loaded at runtime to avoid loading additional // files and dependencies unless a build is required. - const { performNpmReleaseBuild } = await import('../scripts/build-packages-dist.mjs'); + const { performNpmReleaseBuild } = await import('../scripts/build-packages-dist.mts'); return performNpmReleaseBuild(); }, prereleaseCheck: async (newVersionStr) => { const newVersion = new semver.SemVer(newVersionStr); - const { assertValidDependencyRanges } = await import( - '../scripts/release-checks/dependency-ranges/index.mjs' - ); + const { assertValidDependencyRanges } = + await import('../scripts/release-checks/dependency-ranges/index.mts'); await assertValidDependencyRanges(newVersion, releasePackages); }, diff --git a/.ng-dev/tsconfig.json b/.ng-dev/tsconfig.json index 9f0a0f84be18..a250849eb673 100644 --- a/.ng-dev/tsconfig.json +++ b/.ng-dev/tsconfig.json @@ -3,6 +3,9 @@ "compilerOptions": { "resolveJsonModule": true, "allowJs": true, + "rewriteRelativeImportExtensions": true, + "erasableSyntaxOnly": true, + "verbatimModuleSyntax": true, "module": "Node16", "moduleResolution": "Node16", "checkJs": true, diff --git a/.nvmrc b/.nvmrc index b8ffd70759fb..5767036af0e2 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22.15.0 +22.21.1 diff --git a/.prettierignore b/.prettierignore index b0b71acaf241..1adbf7759080 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,8 +11,7 @@ /packages/schematics/angular/third_party/ /README.md /CONTRIBUTING.md -.yarn/ dist/ -/tests/legacy-cli/e2e/assets/ +/tests/e2e/assets/ /tools/test/*.json pnpm-lock.yaml diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000000..6f3e0e3d3375 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,49 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +{ + "version": "0.2.0", + "configurations": [ + { + "name": "DEBUG: Attach to bazel test", + "type": "node", + "request": "attach", + "port": 9229, + "restart": true, + "timeout": 600000, + "sourceMaps": true, + "skipFiles": ["/**"], + "sourceMapPathOverrides": { + "?:*@0.0.0/node_modules/@angular-devkit/build-angular/*": "${workspaceFolder}/packages/angular_devkit/build_angular/*", + "?:*@0.0.0/node_modules/@angular-devkit/build-webpack/*": "${workspaceFolder}/packages/angular_devkit/build_webpack/*", + "?:*@0.0.0/node_modules/@angular-devkit/*": "${workspaceFolder}/packages/angular_devkit/*", + "?:*@0.0.0/node_modules/@angular/*": "${workspaceFolder}/packages/angular/*", + "?:*/bin/*": "${workspaceFolder}/*" + }, + "resolveSourceMapLocations": ["*/**", "!**/rxjs**"] + }, + { + "name": "DEBUG: Run bazel test (Custom Target)", + "type": "node", + "request": "launch", + "restart": true, + "timeout": 600000, + "runtimeExecutable": "pnpm", + "runtimeArgs": ["bazel", "test", "${input:bazelTarget}", "--config=debug"], + "console": "integratedTerminal", + "cwd": "${workspaceFolder}" + } + ], + "compounds": [ + { + "name": "DEBUG: Run bazel test (Custom Target) + Attach", + "configurations": ["DEBUG: Attach to bazel test", "DEBUG: Run bazel test (Custom Target)"] + } + ], + "inputs": [ + { + "id": "bazelTarget", + "type": "promptString", + "description": "Enter the Bazel test target (e.g., //path/to/my:unit_test)", + "default": "//packages/..." + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000000..b98a874af297 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,26 @@ +{ + "[javascript]": { + "editor.formatOnSave": true + }, + "[typescript]": { + "editor.formatOnSave": true + }, + // Exclude third party modules and build artifacts from the editor watchers/searches. + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/node_modules/**": true, + "**/bazel-out/**": true, + "**/dist/**": true, + "**/dist-schema/**": true + }, + "search.exclude": { + "**/node_modules": true, + "**/bazel-out": true, + "**/dist": true, + "**/dist-schema": true, + ".history": true + }, + "git.ignoreLimitWarning": true, + "gitlens.advanced.blame.customArguments": ["--ignore-revs-file .git-blame-ignore-revs"] +} diff --git a/BUILD.bazel b/BUILD.bazel index 9518c3a6f0bb..99bc6eb0355f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,5 +1,6 @@ load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load("@devinfra//bazel/validation:defs.bzl", "validate_ts_version_matching") load("@npm//:defs.bzl", "npm_link_all_packages") load("//tools:defaults.bzl", "copy_to_bin") @@ -18,11 +19,19 @@ exports_files([ npm_link_all_packages() +rules_js_tsconfig( + name = "tsconfig", + src = "tsconfig.json", + visibility = [ + "//:__pkg__", + ], +) + rules_js_tsconfig( name = "build-tsconfig", src = "tsconfig-build.json", deps = [ - "tsconfig.json", + ":tsconfig", "//:node_modules/@types/node", ], ) @@ -31,7 +40,7 @@ rules_js_tsconfig( name = "test-tsconfig", src = "tsconfig-test.json", deps = [ - "tsconfig.json", + ":tsconfig", "//:node_modules/@types/jasmine", "//:node_modules/@types/node", ], @@ -41,7 +50,7 @@ rules_js_tsconfig( name = "build-tsconfig-esm", src = "tsconfig-build-esm.json", deps = [ - "tsconfig.json", + ":tsconfig", ], ) @@ -94,3 +103,8 @@ config_setting( ":enable_snapshot_repo_deps": "true", }, ) + +validate_ts_version_matching( + module_lock_file = "MODULE.bazel.lock", + package_json = "package.json", +) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b5a5cc00b49..c9760339d143 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,48 +1,1376 @@ - + + +# 21.1.0-next.3 (2025-12-18) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------- | +| [348096623](https://github.com/angular/angular-cli/commit/348096623326857a5d8cf77d56712776e1190180) | fix | enhance list_projects MCP tool file system traversal and symlink handling | +| [032257a6d](https://github.com/angular/angular-cli/commit/032257a6d00360d2c4e6d5406409dcfa5b27d1d5) | fix | improve signal forms lesson examples in AI tutor | +| [18d74dde8](https://github.com/angular/angular-cli/commit/18d74dde8938dbe566df80753d5c148c19040179) | fix | rename mcp devserver tools to comply with naming spec | +| [a15db28b2](https://github.com/angular/angular-cli/commit/a15db28b29f6f43bef1ed1ca7c6a963d9943f801) | perf | cache resolved specific version in package manager abstraction | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | +| [52ace04a7](https://github.com/angular/angular-cli/commit/52ace04a7ca1c102fdf1addf5ab6fe400c0eab0e) | fix | improve VS Code background compilation start/end detection | +| [288a9225c](https://github.com/angular/angular-cli/commit/288a9225c83edec9560e2b39901740e792c54d27) | fix | remove `inlineSources` from library tsconfig template | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------- | +| [98c207bc0](https://github.com/angular/angular-cli/commit/98c207bc0e44caccd6fffa5b8d3a013a2a3a871a) | fix | add browser condition to resolver for vitest | +| [f39f7ee95](https://github.com/angular/angular-cli/commit/f39f7ee9529113f7c75d0e0e3ffa628fed9ce92f) | fix | allow non-prefixed requests when using SSR and base href | +| [7c7e6a614](https://github.com/angular/angular-cli/commit/7c7e6a6142a9d294e04c612463449d2a4360e692) | fix | conditionally manage Vitest UI option | +| [edeb41c0e](https://github.com/angular/angular-cli/commit/edeb41c0e01881c21dec4d7f63fe8d302ce0521d) | fix | ensure tests run when compilation error is resolved | +| [9744af1f8](https://github.com/angular/angular-cli/commit/9744af1f82a8e9c2816adf636e4e8a1a8be06c60) | fix | remove LmdbCacheStore export from private API | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------- | +| [e5651224b](https://github.com/angular/angular-cli/commit/e5651224b5086335d48b133e1d0b9c8536c22e5f) | fix | add leading slash to well-known non-Angular URLs | +| [081e31337](https://github.com/angular/angular-cli/commit/081e3133764c9a23f70969bfd182259be34a411e) | fix | propagate status code to redirect | +| [2d56a319d](https://github.com/angular/angular-cli/commit/2d56a319d8d45f36d9e5d958cbbd96e195c2c15e) | fix | skip SSR processing for well-known non-Angular URLs like favicon.ico | + + + + + +# 21.0.4 (2025-12-18) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | +| [b671245b9](https://github.com/angular/angular-cli/commit/b671245b9d3ba98ac0f66dbd34f272539113be61) | fix | improve VS Code background compilation start/end detection | +| [85a28dec7](https://github.com/angular/angular-cli/commit/85a28dec771cce77a3ffee35f419b5fedca807b8) | fix | remove `inlineSources` from library tsconfig template | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------- | +| [deb4fff61](https://github.com/angular/angular-cli/commit/deb4fff6196d2eb147e358a7143e2ada2b6114c9) | fix | add browser condition to resolver for vitest | +| [570ce8d3e](https://github.com/angular/angular-cli/commit/570ce8d3eeb280eeb6dca6ba54593c9325674741) | fix | allow non-prefixed requests when using SSR and base href | +| [4dd3c1a32](https://github.com/angular/angular-cli/commit/4dd3c1a324c8e90808cc1c5febf65c8fa49dd3b9) | fix | conditionally manage Vitest UI option | +| [4b8b7caec](https://github.com/angular/angular-cli/commit/4b8b7caece41f86746321a98786dfdff499582b6) | fix | ensure tests run when compilation error is resolved | +| [bef4fcecb](https://github.com/angular/angular-cli/commit/bef4fcecb6d116f9f022da845f06708cf29be02a) | fix | remove LmdbCacheStore export from private API | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------- | +| [bb54747da](https://github.com/angular/angular-cli/commit/bb54747da69fb15b6c2ebb52b45a83cbff3231c8) | fix | add leading slash to well-known non-Angular URLs | +| [0cfe2e749](https://github.com/angular/angular-cli/commit/0cfe2e749f50b832c64bbba322eb0cef7ad40365) | fix | propagate status code to redirect | +| [eadadb848](https://github.com/angular/angular-cli/commit/eadadb848ca7fa45c4dda835af39400e017bbe1c) | fix | skip SSR processing for well-known non-Angular URLs like favicon.ico | + + + + + +# 21.1.0-next.2 (2025-12-10) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- | +| [d8b76e93d](https://github.com/angular/angular-cli/commit/d8b76e93d3e9e4e7bd7ad6e12fdf59cd663cbb8e) | fix | correctly handle yarn classic tag manifest fetching | +| [7ab5c0b0a](https://github.com/angular/angular-cli/commit/7ab5c0b0a1c637f3e0adb71486e5e7e8716561e4) | fix | correctly spawn package managers on Windows in new abstraction | +| [240588b7e](https://github.com/angular/angular-cli/commit/240588b7e3c8698c83110793ab98d20caee4e1a4) | perf | optimize `ng add` version discovery | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------- | +| [985aa18d0](https://github.com/angular/angular-cli/commit/985aa18d0b6cf728c498c0873793e131a4c416c1) | fix | conditionally provide Zone.js change detection in the built-in test main file | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------- | +| [30b5d81b4](https://github.com/angular/angular-cli/commit/30b5d81b4adafca32c94672a39574daa2e3fc8b7) | fix | Add custom middleware for to present an Angular-tailored message | +| [2e7227b8d](https://github.com/angular/angular-cli/commit/2e7227b8dc04d4b2ca20e18baaeebaa65d3c2aac) | fix | Ensure disposal of close-javascript-transformer | +| [38b16ea01](https://github.com/angular/angular-cli/commit/38b16ea0108c48835dc0d81863eca84f7b8cea6e) | fix | ensure locale base href retains leading slash ([#32040](https://github.com/angular/angular-cli/pull/32040)) | +| [385165cbc](https://github.com/angular/angular-cli/commit/385165cbc6ff087e6bc1fb6f686d4929e83a075a) | fix | inject testing polyfills in Karma unit-test executor | +| [6d212206f](https://github.com/angular/angular-cli/commit/6d212206fdfc94e661a25bed1287c0bc15219b63) | fix | support NODE_EXTRA_CA_CERTS in SSR SSL plugin | + + + + + +# 21.0.3 (2025-12-10) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------- | +| [5d85f416f](https://github.com/angular/angular-cli/commit/5d85f416f43b6bcd07b28ab920cb40c61a83ebdd) | fix | conditionally provide Zone.js change detection in the built-in test main file | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------- | +| [778b4cffc](https://github.com/angular/angular-cli/commit/778b4cffc03e7c137940e3b8c89f290fd226cf17) | fix | Add custom middleware for to present an Angular-tailored message | +| [9b02ab2ee](https://github.com/angular/angular-cli/commit/9b02ab2ee0a36aa6aafd94ea8059b48679845860) | fix | Ensure disposal of close-javascript-transformer | +| [0fc7d576e](https://github.com/angular/angular-cli/commit/0fc7d576e53f45601fdbeb95f4a853ebceae4fad) | fix | ensure locale base href retains leading slash ([#32040](https://github.com/angular/angular-cli/pull/32040)) | +| [b141670a2](https://github.com/angular/angular-cli/commit/b141670a2453dd0ea5fe6aa22ddae7175893d813) | fix | inject testing polyfills in Karma unit-test executor | +| [88c18ce68](https://github.com/angular/angular-cli/commit/88c18ce68585726652b88b10ce090039fbe1829f) | fix | support NODE_EXTRA_CA_CERTS in SSR SSL plugin | + + + + + +# 21.1.0-next.1 (2025-12-03) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------ | +| [d635a6c63](https://github.com/angular/angular-cli/commit/d635a6c6335d0838fc0977f6742f6aa9f769c527) | feat | add signal forms lessons | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------- | +| [e71a72ffd](https://github.com/angular/angular-cli/commit/e71a72ffdc426e26bfb4f0bb92e8f5795a621c18) | feat | generate detailed migration report for `refactor-jasmine-vitest` | + +### @angular-devkit/schematics + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------- | +| [98e10fa0f](https://github.com/angular/angular-cli/commit/98e10fa0f29cc8f6cf6a25c45c6888a79465eaf7) | fix | remove lazy imports in node tasks | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | +| [63c3e3f64](https://github.com/angular/angular-cli/commit/63c3e3f6406d345e777ca18bfad7d6d701e5c4ea) | fix | add filename truncation to test discovery | +| [8d8ba4f61](https://github.com/angular/angular-cli/commit/8d8ba4f61fc07dd670b705c48e82cf63424b3cce) | fix | allow overriding Vitest coverage `reportsDirectory` option | + + + + + +# 21.0.2 (2025-12-03) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- | +| [f1a7116cd](https://github.com/angular/angular-cli/commit/f1a7116cdff1bd83b26b0d64cea14ec4e8084583) | fix | update `@modelcontextprotocol/sdk` to v1.24.0 | + +### @angular-devkit/schematics + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------- | +| [dc6d9469e](https://github.com/angular/angular-cli/commit/dc6d9469ea494bbfee7da191774e9fa3c0baf30a) | fix | remove lazy imports in node tasks | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | +| [f8a1939fd](https://github.com/angular/angular-cli/commit/f8a1939fdf5abbc1de439d288d9357d4f92a72a9) | fix | add filename truncation to test discovery | +| [86dd3297f](https://github.com/angular/angular-cli/commit/86dd3297f7ad81788713cfd8dae48c0fad4b89ab) | fix | allow overriding Vitest coverage `reportsDirectory` option | + + + + + +# 20.3.13 (2025-12-03) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- | +| [cfbb61602](https://github.com/angular/angular-cli/commit/cfbb61602daf32c5b942ea84702fc3638aa111e7) | fix | update `@modelcontextprotocol/sdk` to v1.24.0 | + + + + + +# 21.1.0-next.0 (2025-11-26) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------- | +| [c3c9ac506](https://github.com/angular/angular-cli/commit/c3c9ac5067275461e2d8caefba81ac9701949776) | feat | Add MCP tools for building and running devservers | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------- | +| [36cf3afb4](https://github.com/angular/angular-cli/commit/36cf3afb485a01f86c4c90f136b38a3cf338e313) | feat | add browserMode option to jasmine-vitest schematic | +| [18cf6c51b](https://github.com/angular/angular-cli/commit/18cf6c51b72ce5c7f23012585ed992cf91cef5ed) | fix | add MCP configuration file to new workspaces | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------- | +| [ad99e00ad](https://github.com/angular/angular-cli/commit/ad99e00ad7edd17e369777c8d38b4137ea736121) | fix | simplify SSL handling for `ng serve` with SSR ([#31722](https://github.com/angular/angular-cli/pull/31722)) | + + + + + +# 21.0.1 (2025-11-26) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------------- | +| [363496ae0](https://github.com/angular/angular-cli/commit/363496ae0d2850545274cd7fe4dc6902ccb64e10) | fix | ensure dependencies are resolved correctly for node modules directory check | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------- | +| [2f58705cb](https://github.com/angular/angular-cli/commit/2f58705cb5389019ceb49616a0e4ec3f92a558ed) | fix | add missing imports for lifecycle hooks in jasmine-vitest migration | +| [c973bb9ca](https://github.com/angular/angular-cli/commit/c973bb9cafc8d59b901a9d763347f4b615257867) | fix | add mock names to createSpyObj transformation | +| [4534c9848](https://github.com/angular/angular-cli/commit/4534c9848745eea516bdb58d86914252c35b5b9c) | fix | do not set `esModuleInterop` and `moduleResolution` when module is `preserve` | +| [16d898e75](https://github.com/angular/angular-cli/commit/16d898e7587036d68786cebe764da08304559d41) | fix | fix migration of `jasmine.clock().mockDate()` | +| [21c3eac72](https://github.com/angular/angular-cli/commit/21c3eac726c198132af760ffacc0dab9dfccb430) | fix | handle createSpyObj without base name on refactor-jasmine-vitest | +| [b8c99aa4c](https://github.com/angular/angular-cli/commit/b8c99aa4c909647285d1dcc61a2bb97a36100c63) | fix | improve safety of done callback transformation | +| [4a71e06fc](https://github.com/angular/angular-cli/commit/4a71e06fcafaadbcb820d285c0c186aa0e92f158) | fix | silently skip when the build target already uses one of the new builders | +| [2ffdae421](https://github.com/angular/angular-cli/commit/2ffdae42149b0f3da44f96271af1bca6d09b7ed5) | fix | support testRunner option in library schematic | +| [145de4a58](https://github.com/angular/angular-cli/commit/145de4a584ce8f72746704547282299306d9bafb) | fix | warn about loose matching in arrayWithExactContents | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- | +| [d097df2d7](https://github.com/angular/angular-cli/commit/d097df2d7088dd2bb97643c3acfc1f977a767dd9) | fix | correct Vitest coverage path resolution for JSDOM on Windows | +| [cdb607ada](https://github.com/angular/angular-cli/commit/cdb607ada4bf9aaec6ed8aafd8826d782fd13109) | fix | correctly configure per-browser headless mode in Vitest runner | +| [244931ece](https://github.com/angular/angular-cli/commit/244931ece877a1cacd1cfce64314e04a52526f80) | fix | correctly invoke `isTTY` as a function | +| [54d542738](https://github.com/angular/angular-cli/commit/54d542738e23c275ac6827f19da92213c405f9e2) | fix | ensure correct URL joining for prerender routes | +| [a28b38bbe](https://github.com/angular/angular-cli/commit/a28b38bbeba0977e99142a15d1ecc77c15abc416) | fix | force dev-server to use HTTP/1.1 when using SSR with SSL | +| [59ff867f0](https://github.com/angular/angular-cli/commit/59ff867f0d2e7f7f88480deefa0ee470c037197a) | fix | normalize `--include` paths to posix | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| [03e231216](https://github.com/angular/angular-cli/commit/03e231216d3b8ba0de81da53a446eff0c701658d) | fix | handle `X-Forwarded-Prefix` and `APP_BASE_HREF` in redirects | +| [3cac01882](https://github.com/angular/angular-cli/commit/3cac0188271175e12cc238c6610b542f3ae14db3) | fix | prevent redirect loop with encoded query parameters | + + + + + +# 20.3.12 (2025-11-25) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------- | +| [25bb7e65c](https://github.com/angular/angular-cli/commit/25bb7e65c4fc7e401c658126c53b0b7a13d62965) | fix | ensure correct URL joining for prerender routes | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| [cceb86296](https://github.com/angular/angular-cli/commit/cceb862969e541a5f54b689a6439e32773eafe65) | fix | handle `X-Forwarded-Prefix` and `APP_BASE_HREF` in redirects | +| [1abe68ad8](https://github.com/angular/angular-cli/commit/1abe68ad87f9b892734117a087b5775068bd232b) | fix | prevent redirect loop with encoded query parameters | + + + + + +# 21.0.0 (2025-11-19) + +## Breaking Changes + +### @angular/cli + +- The `ng` commands will no longer automatically detect and use `cnpm` as the package manager. As an alternative use the `.npmrc` file to ensure npm uses the cnpm registry. + +### @angular/build + +- - TypeScript versions older than 5.9 are no longer supported. +- The `javascriptEnabled` option for Less is no longer supported. Projects relying on inline JavaScript within Less files will need to refactor their stylesheets to remove this dependency. + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------ | +| [e417c89f9](https://github.com/angular/angular-cli/commit/e417c89f9e9cfe0ce50ffbc72ef555793605aea1) | feat | Add `addTypeToClassName` option to relevant schematics | +| [ede5e52bc](https://github.com/angular/angular-cli/commit/ede5e52bc701c42948bd98826cd4fa901350015c) | feat | add `include` option to jasmine-to-vitest schematic | +| [c119910f4](https://github.com/angular/angular-cli/commit/c119910f4505e280eea83ea6647b6d279a46f36d) | feat | add AGENTS.md support to ai-config schematic | +| [d0d2a17b8](https://github.com/angular/angular-cli/commit/d0d2a17b8adb2c1ce6eee70494f5d2298622c40e) | feat | add Jasmine spy API transformations to jasmine-to-vitest schematic | +| [e7d955bed](https://github.com/angular/angular-cli/commit/e7d955bedd5ca6957903cb73f8ebe06823a808da) | feat | add matcher transformations to jasmine-to-vitest schematic | +| [629f5cb18](https://github.com/angular/angular-cli/commit/629f5cb181fee562645baf02b44ebb3b39f3fb06) | feat | add misc transformations to jasmine-to-vitest schematic | +| [4912f3990](https://github.com/angular/angular-cli/commit/4912f39906b11a3212f11d5a00d577e2a0bacab4) | feat | add Tailwind CSS option to application schematic and `ng new` | +| [2a518016d](https://github.com/angular/angular-cli/commit/2a518016d9585dd4d16f90102d5409459ebba024) | feat | Applications are zoneless by default | +| [2ffc527b1](https://github.com/angular/angular-cli/commit/2ffc527b1bbe237e9f732d3506ce3a75ca1ca9d0) | feat | configure Vitest for new projects and allow runner choice | +| [58474ec7d](https://github.com/angular/angular-cli/commit/58474ec7dd85fc34639c138d9b8d545affb50e3e) | feat | introduce initial jasmine-to-vitest unit test refactor schematic | +| [9f255f2b3](https://github.com/angular/angular-cli/commit/9f255f2b3cc435f3bea2f0266a137176ca599aef) | feat | set `packageManager` in `package.json` on new projects | +| [4e6c94f21](https://github.com/angular/angular-cli/commit/4e6c94f21e882c593cf11197900c29d693af9297) | feat | support different file name style guides in `ng new` | +| [77741f5ee](https://github.com/angular/angular-cli/commit/77741f5eec735f23b0f2865101471e045e4889b8) | fix | add 'update-typescript-lib' migration | +| [f89750b27](https://github.com/angular/angular-cli/commit/f89750b27866c307da546fe4f33da980693ca5c1) | fix | add `addImports` option to jasmine-vitest schematic | +| [9dab5780a](https://github.com/angular/angular-cli/commit/9dab5780a1befbd76ee9ba4c4e6ac2d3fd714bb9) | fix | add fixture.whenStable in spec files when zoneless apps | +| [8f0f6a5f1](https://github.com/angular/angular-cli/commit/8f0f6a5f113ffc9e81d99eeeba71f8054e2d3686) | fix | add migration to update `moduleResolution` to `bundler` | +| [e8feba9ee](https://github.com/angular/angular-cli/commit/e8feba9ee163f688c51d6463336474591e886647) | fix | add missing typeSeparator to main.ts.template file | +| [515b09c4f](https://github.com/angular/angular-cli/commit/515b09c4f28ef1c2eb911cb73135a6086dcab3c9) | fix | add Vitest config generation and runner checks | +| [0e83fe1a8](https://github.com/angular/angular-cli/commit/0e83fe1a87cc3dcbc9daa4440a050ae6aafc8042) | fix | add warnings and improve Karma config generation | +| [b91fa31f2](https://github.com/angular/angular-cli/commit/b91fa31f20b49ead021c72c271f67da38b340584) | fix | align Karma project generation with unified unit-test builder | +| [c967a447c](https://github.com/angular/angular-cli/commit/c967a447ce755fbf582ec35aa24bb6e0fa0043cf) | fix | correct spacing in application spec tsconfig | +| [00d941c43](https://github.com/angular/angular-cli/commit/00d941c433de718cf3c38033d5d68dd86f790291) | fix | correct style guide paths for standalone components | +| [e33e77d12](https://github.com/angular/angular-cli/commit/e33e77d12984446fe7bc77deb7438806817ba8a7) | fix | flag '--file-name-style-guide=2016' - wrong import in main.ts | +| [f35b9f331](https://github.com/angular/angular-cli/commit/f35b9f3310995b05d501f2abaec58dcd283e3aa0) | fix | improve comment preservation in jasmine-to-vitest | +| [6615fcf03](https://github.com/angular/angular-cli/commit/6615fcf037686cd96e97b469937b7f0736afaa77) | fix | issues in apps generated with '--file-name-style-guide=2016' flag | +| [e304821d5](https://github.com/angular/angular-cli/commit/e304821d5d789fab2725d3152612d3e5b6bd0dc7) | fix | make ai-config schematic non-destructive | +| [512ad282a](https://github.com/angular/angular-cli/commit/512ad282aecbfdf1e5c9e9700cc722addb949b68) | fix | preserve blank lines in jasmine-to-vitest schematic | +| [b524ba426](https://github.com/angular/angular-cli/commit/b524ba42625cd690177a300ca4843ef4edce035f) | fix | remove empty i18n-extract target for new projects | +| [8e6e0a293](https://github.com/angular/angular-cli/commit/8e6e0a2931bfb178e77cf2c9ca7f92a56c673449) | fix | remove explicit flag for host bindings | +| [afb4d3e37](https://github.com/angular/angular-cli/commit/afb4d3e377b11315a03563cb8c143c35d37f113a) | fix | remove extra space before async in spec templates | +| [b983ea8e5](https://github.com/angular/angular-cli/commit/b983ea8e5107420a910dbbc05c6b74f0ff6fbddd) | fix | respect skip-install for tailwind schematic | +| [54c4eae2a](https://github.com/angular/angular-cli/commit/54c4eae2aa49c6b45c41f0718a5915a10d426cb4) | fix | transform Jasmine type annotations in jasmine-to-vitest schematic | +| [14c0a9bac](https://github.com/angular/angular-cli/commit/14c0a9bacbb66b1db714ea7906c7d33f49c710fc) | perf | optimize AST traversal utilities | + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------- | +| [58d101d5e](https://github.com/angular/angular-cli/commit/58d101d5e78cf4c158dbaf52103639d56b84f9ed) | feat | add `--json` output to `ng version` | +| [d014630fa](https://github.com/angular/angular-cli/commit/d014630fad765ae3928b698122038cbe00d37102) | feat | add advanced filtering to MCP example search | +| [6d3a3c579](https://github.com/angular/angular-cli/commit/6d3a3c5799bde1bab5c3878e0783ffa6854e36ad) | feat | add ai-tutor mcp tool | +| [1c06b16a9](https://github.com/angular/angular-cli/commit/1c06b16a962d3c2cc122dc40e01c64bc8a8d754d) | feat | add builder info to `list_projects` MCP tool | +| [301b50da4](https://github.com/angular/angular-cli/commit/301b50da4cf99b3cd87940606121d076b4f241c6) | feat | add fallback support for packages without direct `ng add` functionality | +| [3040b777e](https://github.com/angular/angular-cli/commit/3040b777e40bc90fd1ed961e3d134875b3f9b464) | feat | add style language detection to list_projects tool | +| [45024e836](https://github.com/angular/angular-cli/commit/45024e836b4006cc48b18bb99d025ae1a572db12) | feat | add unit test framework detection to list_projects tool | +| [104c90768](https://github.com/angular/angular-cli/commit/104c90768000b3e0052ee7e7de2c5e04c1bffdaf) | feat | enhance `ng version` output with more details | +| [286b6204c](https://github.com/angular/angular-cli/commit/286b6204c825c990761a0d5e5b91bb439dd13655) | feat | make documentation search tool version-aware | +| [406315d09](https://github.com/angular/angular-cli/commit/406315d0939c62d9f4f39ce64b168e72bbdd588c) | feat | make find_examples tool version-aware | +| [68e711307](https://github.com/angular/angular-cli/commit/68e711307eae88a621698c2a9cc2abc30d44efc8) | feat | make get_best_practices tool version-aware | +| [50453fdee](https://github.com/angular/angular-cli/commit/50453fdeec4a00d88deada49d2dd0867bdb784fb) | feat | overhaul `ng version` command output | +| [1ee9ce3c9](https://github.com/angular/angular-cli/commit/1ee9ce3c93caff419f8095a91cf58601e3df3f74) | feat | promote MCP `find_examples` tool to a stable tool | +| [0d53e82d5](https://github.com/angular/angular-cli/commit/0d53e82d5ed8986603c2005fc06041dd076b08c6) | feat | provide detailed peer dependency conflict errors in ng add | +| [f513089e2](https://github.com/angular/angular-cli/commit/f513089e276acf5a7c4f6879a95e2d6ed78ae67d) | feat | remove direct support for `cnpm` | +| [c17d7a929](https://github.com/angular/angular-cli/commit/c17d7a929adccb77f3c2c33e70005f50032d8cae) | fix | add schema versioning and metadata to example database | +| [dbf1aaf70](https://github.com/angular/angular-cli/commit/dbf1aaf70bc3e3dd0de05d760bafacc43b34dce8) | fix | add snippet support to example search MCP tool | +| [dfb4242b3](https://github.com/angular/angular-cli/commit/dfb4242b347365f3a2c6d006f07a16c982ff4dbe) | fix | add vitest to version command output | +| [11cee1acb](https://github.com/angular/angular-cli/commit/11cee1acb59afbad1ef88d8340b5438f7dbefe57) | fix | correct boolean parsing in MCP example front matter | +| [122a8c0e2](https://github.com/angular/angular-cli/commit/122a8c0e27342db79eb4d38e23032548054709b9) | fix | correct frontmatter parsing in MCP examples tool | +| [431106559](https://github.com/angular/angular-cli/commit/431106559d6e75f5113876a3f92fdf4dc4b2114d) | fix | correct query in find_examples to prevent runtime error | +| [def412a55](https://github.com/angular/angular-cli/commit/def412a558d71cb51fa16d826418bd0ed0a085cf) | fix | enhance find_examples MCP tool with structured output | +| [0922a033f](https://github.com/angular/angular-cli/commit/0922a033f546b38f83d1cae524cf7237dd37a2ac) | fix | improve JSON schema parsing for command options | +| [f099c9157](https://github.com/angular/angular-cli/commit/f099c91570b3cd748d7138bd18a4898a345549db) | fix | improve list_projects MCP tool to find all workspaces in monorepos | +| [1be35b343](https://github.com/angular/angular-cli/commit/1be35b3433179481be85ea1cb892d66170e0aebe) | fix | promote zoneless migration MCP tool to stable | +| [e5aed6d65](https://github.com/angular/angular-cli/commit/e5aed6d655ed92ea6eb3ac03716b8a02a5f731d6) | fix | show planned actions in `ng add` dry run | +| [4deac3ec7](https://github.com/angular/angular-cli/commit/4deac3ec785b1a53156aac90441d0ed129df71ef) | fix | support multi-database search in find_examples MCP tool | +| [aeb49dd52](https://github.com/angular/angular-cli/commit/aeb49dd52bf88785a193fcb6caa0b36aaeef1d37) | perf | cache dependency lookups during `ng add` | +| [5e534090e](https://github.com/angular/angular-cli/commit/5e534090e25e00a9fafbce2867030e7fdb0efbf6) | perf | parallelize peer dependency checks in `ng add` | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- | +| [6e395fc0c](https://github.com/angular/angular-cli/commit/6e395fc0c4505dd32b3237ea116e8db6bde25758) | fix | ensure vitest code coverage handles virtual files correctly | +| [53899511a](https://github.com/angular/angular-cli/commit/53899511afe5665541984085914a313390af6ce2) | fix | expand `jest` and `jest-environment-jsdom` to allow version 30 | +| [7a8c94615](https://github.com/angular/angular-cli/commit/7a8c94615164e114533fae0f84796a374dc1b47b) | fix | make zone.js optional in server and app-shell builders | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------- | +| [00426e315](https://github.com/angular/angular-cli/commit/00426e3150c846913a5aa31510b5a1126df9e570) | feat | add --list-tests flag to unit-test builder | +| [a908bf3d4](https://github.com/angular/angular-cli/commit/a908bf3d4e8a59f3546f117bcc1f12fd69ad2d0b) | feat | add 'filter' option to unit-test builder | +| [3e0209d0a](https://github.com/angular/angular-cli/commit/3e0209d0a6bc6d7985d6294fc1430cdbe4d2d9a6) | feat | add `browserViewport` option for vitest browser tests | +| [3b7dabbf1](https://github.com/angular/angular-cli/commit/3b7dabbf1df9b2b6ca9ffc6c038abb6e40b6df2b) | feat | add advanced coverage options to unit-test builder | +| [c0b00d78e](https://github.com/angular/angular-cli/commit/c0b00d78ec37426f4474f473ddf9e627a0dd23df) | feat | add reporter output file option for unit-test | +| [66dd6dd83](https://github.com/angular/angular-cli/commit/66dd6dd835d6b489e6b4be2138aa443e11bfa076) | feat | allow options for unit test reporters | +| [a90bea5b5](https://github.com/angular/angular-cli/commit/a90bea5b51c6978441919ed2af85c090fe99fd38) | feat | support `.test.ts` files by default in unit test builder | +| [b2f048773](https://github.com/angular/angular-cli/commit/b2f048773c6014022983e7ccc52cb760619d8a1b) | fix | add --ui option for Vitest runner | +| [530d9270e](https://github.com/angular/angular-cli/commit/530d9270e87786594dd8d1956b0806a28650db25) | fix | add `define` option to dev-server | +| [b554bd73a](https://github.com/angular/angular-cli/commit/b554bd73a9c248d986ed718028edf52ab5da6ccf) | fix | add temporary directory cleanup for Vitest executor | +| [c6176f6df](https://github.com/angular/angular-cli/commit/c6176f6dffdae5c8d8708a1dd20fb51ca72e3c24) | fix | add upfront dependency validation for unit-test runners | +| [63c98741a](https://github.com/angular/angular-cli/commit/63c98741adcd21701b8bc572e9410cc1cf4f91c3) | fix | add webcontainer support for Vitest browser provider | +| [fcdbf6c19](https://github.com/angular/angular-cli/commit/fcdbf6c19b5a8549011aebec9e517feb12a99895) | fix | allow `globals` to be set to false | +| [542d52868](https://github.com/angular/angular-cli/commit/542d528683cc0e51fd5a55ed6dbf43168f7a51a5) | fix | allow custom runner configuration file for unit-test | +| [0505f954d](https://github.com/angular/angular-cli/commit/0505f954dcf3b3339749ff461592d46d8ecc5e23) | fix | allow unit-test progress option passthrough for building | +| [931c62d20](https://github.com/angular/angular-cli/commit/931c62d20915c6c772b61d76ab88657c0858f6bd) | fix | allow unit-test runner config with absolute path | +| [a11dd31f0](https://github.com/angular/angular-cli/commit/a11dd31f0c80a189e7dcb3172c89a731cfc34702) | fix | configure Vitest cache to use Angular cache | +| [abf003268](https://github.com/angular/angular-cli/commit/abf003268c6cb18f0944665b0b3f2794c9469c3e) | fix | correct Vitest builder watch mode execution | +| [f05ffd104](https://github.com/angular/angular-cli/commit/f05ffd104255e86fe93f3736e1430f940cb83007) | fix | correct Vitest coverage include handling for virtual files | +| [cd5c92b99](https://github.com/angular/angular-cli/commit/cd5c92b99a5d8e9cb991a2551f564353c3df0fbe) | fix | correct Vitest coverage reporting for test files | +| [07f712253](https://github.com/angular/angular-cli/commit/07f712253bb6c37d27ae7be9845f497002b0780c) | fix | correctly handle absolute paths and casing in test discovery | +| [bf468e1eb](https://github.com/angular/angular-cli/commit/bf468e1eb1050c60359b6f52692ce0db286982c2) | fix | direct check include file exists in unit-test discovery | +| [50e330d33](https://github.com/angular/angular-cli/commit/50e330d331fc8cfc4c12f7258012305ecb419d2d) | fix | disable glob directory expansion when finding tests | +| [49b65aba8](https://github.com/angular/angular-cli/commit/49b65aba8d7cd2839776e987366b981d7762760c) | fix | disable Vitest test isolation by default | +| [1529595d4](https://github.com/angular/angular-cli/commit/1529595d4a8d8ff9251d1680b1a23bf4ef817db0) | fix | drop support for TypeScript 5.8 | +| [a44f8fa94](https://github.com/angular/angular-cli/commit/a44f8fa94bbf6ce8cdee05552dc56124507c6971) | fix | dynamically select Vitest DOM environment | +| [ae35543af](https://github.com/angular/angular-cli/commit/ae35543af7f5b3a5328c39fd4617d61b48067357) | fix | enhance Vitest config merging and validation | +| [fec106b60](https://github.com/angular/angular-cli/commit/fec106b60553394aab51d713e5437a713085089b) | fix | enhance Vitest dependency externalization and pre-bundling | +| [f7c4a4c1d](https://github.com/angular/angular-cli/commit/f7c4a4c1dcd575dec82cc06597e3d6620b1be729) | fix | enhance Vitest resolution for optimal package loading | +| [ee5e127d5](https://github.com/angular/angular-cli/commit/ee5e127d551269fa9a3e39b9b28e38d7ab35806f) | fix | ensure `ɵgetOrCreateAngularServerApp` is always defined after errors | +| [0830f4fb5](https://github.com/angular/angular-cli/commit/0830f4fb549e2c45b1ef752dd42f002a1347d7c8) | fix | ensure TestBed cleanup hooks are always registered | +| [41b12509a](https://github.com/angular/angular-cli/commit/41b12509a9db8bca637e0c67d21301a75774129c) | fix | ensure TestBed setup is robust in non-isolated Vitest | +| [55145f582](https://github.com/angular/angular-cli/commit/55145f582253b4ecb47add7ff2ef459b7535dfdb) | fix | ensure Vitest setup files are executed in order | +| [3478aa332](https://github.com/angular/angular-cli/commit/3478aa332ef0241c04e7eeef9dd74b017292b2c4) | fix | exclude .angular from coverage instrumentation | +| [7c529c1bc](https://github.com/angular/angular-cli/commit/7c529c1bc606101ab8c506e0b7845d2e9f509db4) | fix | externalize Angular dependencies in Vitest runner | +| [69c3b1226](https://github.com/angular/angular-cli/commit/69c3b1226880835fd8087cea5684ababb92b1c05) | fix | improve error handling in unit-test builder | +| [bab5806c2](https://github.com/angular/angular-cli/commit/bab5806c281fd4cdd63b7969e691d703ed1e7680) | fix | introduce vitest-base.config for test configuration | +| [73621998f](https://github.com/angular/angular-cli/commit/73621998f91db189ad9b1ab006681404e30f7900) | fix | normalize paths for Vitest runner output files | +| [fa5c92346](https://github.com/angular/angular-cli/commit/fa5c92346d14a6ad03aa30ad6392fc649038605e) | fix | prioritize string type for runnerConfig schema | +| [d0787c11d](https://github.com/angular/angular-cli/commit/d0787c11d68841c36ef28bc3f15963406d1209a9) | fix | provide default excludes for vitest coverage | +| [ac10f323e](https://github.com/angular/angular-cli/commit/ac10f323ece9f4a35068e510f10786fbcb15adbb) | fix | relax requirement for files to be in TS compilation | +| [139758586](https://github.com/angular/angular-cli/commit/13975858683421a5712bbfccee57cf141a0b96f6) | fix | remove deprecated `javascriptEnabled` option for Less | +| [6576bb598](https://github.com/angular/angular-cli/commit/6576bb5985c18dca7cecd9509939c2a78bf9758a) | fix | remove explicit test isolation configuration | +| [9132e6af9](https://github.com/angular/angular-cli/commit/9132e6af9fd573d8b39c69a50b4b93e256145fd4) | fix | resolve browser provider packages using project resolver | +| [26127bd3b](https://github.com/angular/angular-cli/commit/26127bd3bb2c4b9aacf2a8f4c2cbdf732512bafb) | fix | resolve PostCSS plugins relative to config file | +| [dae732059](https://github.com/angular/angular-cli/commit/dae732059d17e9e374ac7635fbca9480751f70b3) | fix | serve build assets and styles in vitest | +| [705af2278](https://github.com/angular/angular-cli/commit/705af22788102eeade08404d357582c39de8900b) | fix | set coverage report directory to coverage/project-name | +| [0851d2eae](https://github.com/angular/angular-cli/commit/0851d2eae1e5b854a0a8a7df3a47b00693508a0f) | fix | show full aggregate errors from vitest | +| [cc2668f57](https://github.com/angular/angular-cli/commit/cc2668f5744588f9c3d847d2450dd1361e73c690) | fix | simplify SSL handling for `ng serve` with SSR ([#31723](https://github.com/angular/angular-cli/pull/31723)) | +| [907eabdd3](https://github.com/angular/angular-cli/commit/907eabdd3c7447ed2c211b6d6c2719b04443c545) | fix | support ESM PostCSS plugins | +| [62938e799](https://github.com/angular/angular-cli/commit/62938e79977d14045b7883d459d786dbb8d4d7ee) | fix | update vitest to 4.0.6 and remove coverage workaround | + + + + + +# 20.3.11 (2025-11-19) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------- | +| [8053f2d92](https://github.com/angular/angular-cli/commit/8053f2d92a68a8bd01854eb81aa472249f5a83b2) | fix | ensure `ɵgetOrCreateAngularServerApp` is always defined after errors | + + + + + +# 20.3.10 (2025-11-12) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- | +| [c854a719b](https://github.com/angular/angular-cli/commit/c854a719bb3a8d92fe42c8fba4b0b1789081b21c) | fix | correct `tsconfig.spec.json` include for spec files | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------- | +| [b3908f68e](https://github.com/angular/angular-cli/commit/b3908f68ed2f05cee56cbf0d9895dcfc3dc0ac25) | fix | do not remove `@angular/localize` when having external packages ([#31721](https://github.com/angular/angular-cli/pull/31721)) | + + + + + +# 20.3.9 (2025-11-05) + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------ | +| [08e07e338](https://github.com/angular/angular-cli/commit/08e07e338edd799400e18cd62cd131b6d408f4cf) | fix | improve locale handling in app-engine | +| [683697ebc](https://github.com/angular/angular-cli/commit/683697ebc5e129d2b17bded9e4ff318d598e0bd3) | fix | improve route matching for wildcard routes | + + + + + +# 20.3.8 (2025-10-29) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | +| [813cba9b9](https://github.com/angular/angular-cli/commit/813cba9b9bfe60e874595ce25608ca85a890f6bf) | fix | expand jest and jest-environment-jsdom to allow version 30 | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- | +| [542973ab0](https://github.com/angular/angular-cli/commit/542973ab074ccd9a5f09f73ee7f2706a21db45fc) | fix | add adapters to new reporter | +| [f0885691d](https://github.com/angular/angular-cli/commit/f0885691d18b6575351774fcc50d746d981285f6) | fix | ensure locale data plugin runs before other plugins | +| [45e498f95](https://github.com/angular/angular-cli/commit/45e498f9576ff83eebe02deb235d36498ce06bde) | fix | handle redirects from guards during prerendering | + + + + + +# 19.2.19 (2025-10-29) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------- | +| [4d8ea27a1](https://github.com/angular/angular-cli/commit/4d8ea27a1726709b8398a26915395e7611571dae) | fix | update vite to v6.4.1 | + + + + + +# 20.3.7 (2025-10-22) + +### @angular-devkit/schematics + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- | +| [a31533cf4](https://github.com/angular/angular-cli/commit/a31533cf492048f62a41b9c09e53779269ee172d) | fix | respect `--force` option when schematic contains `host.create` | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ | +| [8cdda111c](https://github.com/angular/angular-cli/commit/8cdda111cc0b343aa5eb6a7ccbad93302a543226) | fix | resolve Angular locale data namespace in esbuild | +| [5847ccc54](https://github.com/angular/angular-cli/commit/5847ccc545e54eb77a78b2435db7970faf748156) | fix | update `vite` to `7.11.1` | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------- | +| [3a28fb6a1](https://github.com/angular/angular-cli/commit/3a28fb6a13061215b881c49232db979fc3c2f641) | fix | correctly handle routes with matrix parameters | +| [5db6d6487](https://github.com/angular/angular-cli/commit/5db6d64870c7ce0b883722a07c828946b7d2217d) | fix | ensure server-side navigation triggers a redirect | + + + + + +# 20.3.6 (2025-10-15) + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------ | +| [5271547c8](https://github.com/angular/angular-cli/commit/5271547c80662de10cb3bcb648779a83f6efedfb) | fix | prevent malicious URL from overriding host | + + + + + +# 19.2.18 (2025-10-15) + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------ | +| [9136a5d13](https://github.com/angular/angular-cli/commit/9136a5d1302bb224ea245460ae29474bd2a3a10b) | fix | prevent malicious URL from overriding host | + + + + + +# 20.3.5 (2025-10-08) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------- | +| [7f7140680](https://github.com/angular/angular-cli/commit/7f7140680b75ff6b41f7f04349fe10cd928f1a23) | fix | cleanup karma temporary directory after process exit | + + + + + +# 20.3.4 (2025-10-02) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------- | +| [c94bf7ff0](https://github.com/angular/angular-cli/commit/c94bf7ff0845fe325c39737057ff1ed4ea553011) | fix | Out of the box support for PM2 | +| [465436c9f](https://github.com/angular/angular-cli/commit/465436c9fa21173befe5e39b61afb7f29435c2aa) | fix | use bracket notation for `process.env['pm_id']` | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | +| [bc6b63114](https://github.com/angular/angular-cli/commit/bc6b631146c719a337c937e95c7cc5ebca29254b) | fix | mark `InjectionToken` as pure for improved tree-shaking | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | +| [e510ff828](https://github.com/angular/angular-cli/commit/e510ff828f033478d8e1720050a7b3d75d551e16) | fix | mark `InjectionToken` as pure for improved tree-shaking | + + + + + +# 20.3.3 (2025-09-24) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------- | +| [b7f92da78](https://github.com/angular/angular-cli/commit/b7f92da7835c14b568d07dfb3313802704f28cfd) | fix | add `__screenshots__/` to `.gitignore` | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------- | +| [a4c9a2007](https://github.com/angular/angular-cli/commit/a4c9a2007ab3e33b2c97fa63f0df8f8662427031) | fix | avoid retaining rendered HTML in memory post-request | + + + + + +# 20.3.2 (2025-09-17) + + + + + +# 19.2.17 (2025-09-17) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------ | +| [365d525b5](https://github.com/angular/angular-cli/commit/365d525b596b437ad0b1a74b1417eaae6aa8694e) | fix | update `vite` to `6.3.6` | + + + + + +# 20.3.1 (2025-09-11) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------- | +| [be60be499](https://github.com/angular/angular-cli/commit/be60be4997ea0f7be3a4fb993f87b1bd29fc1493) | fix | add timestamp to bundle generation log | +| [d60f4e53d](https://github.com/angular/angular-cli/commit/d60f4e53d8f511d313e517161dc26eb3cc005f1c) | fix | update vite to version `7.1.5` | + + + + + +# 18.2.21 (2025-09-10) + +## Breaking Changes + +### @angular/ssr + +- The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector. + + Before: + + ```ts + const bootstrap = () => bootstrapApplication(AppComponent, config); + ``` + + After: + + ```ts + const bootstrap = (context: BootstrapContext) => + bootstrapApplication(AppComponent, config, context); + ``` + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------ | +| [700e6bc01](https://github.com/angular/angular-cli/commit/700e6bc0177a3e345a88e31be22496cc3054349b) | fix | avoid extra tick in SSR builds | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------- | +| [cccc91b91](https://github.com/angular/angular-cli/commit/cccc91b919b4a8365efce9ee691940e351349075) | fix | avoid extra tick in SSR dev-server builds | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | +| [4af385201](https://github.com/angular/angular-cli/commit/4af385201bf8ba05352faec26c6efa866b69d999) | feat | introduce BootstrapContext for isolated server-side rendering | + + + + + +# 19.2.16 (2025-09-10) + +## Breaking Changes + +### @angular/ssr + +- The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector. + + Before: + + ```ts + const bootstrap = () => bootstrapApplication(AppComponent, config); + ``` + + After: + + ```ts + const bootstrap = (context: BootstrapContext) => + bootstrapApplication(AppComponent, config, context); + ``` + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------ | +| [b0f4330a9](https://github.com/angular/angular-cli/commit/b0f4330a9a2f598b71f12d07e49b6c7c6891febd) | fix | avoid extra tick in SSR builds | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------- | +| [ee5c5f823](https://github.com/angular/angular-cli/commit/ee5c5f823c87a36c9bcb92db2fc9b4e652dc16c2) | fix | avoid extra tick in SSR dev-server builds | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | +| [32980f7e7](https://github.com/angular/angular-cli/commit/32980f7e7a5821bc9bd311dda6e134970e735722) | feat | introduce BootstrapContext for isolated server-side rendering | + + + + + +# 20.3.0 (2025-09-10) + +## Breaking Changes + +### @angular/ssr + +- The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector. + + Before: + + ```ts + const bootstrap = () => bootstrapApplication(AppComponent, config); + ``` + + After: + + ```ts + const bootstrap = (context: BootstrapContext) => + bootstrapApplication(AppComponent, config, context); + ``` + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------- | +| [ef20a278d](https://github.com/angular/angular-cli/commit/ef20a278d1455b9cdffc5102b13d0b2206ef1ecb) | fix | align labels in ai-config schema | + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- | +| [f6ad41c13](https://github.com/angular/angular-cli/commit/f6ad41c134c7ae938ccda908967e7cc863b3db16) | fix | improve bun lockfile detection and optimize lockfile checks | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------ | +| [1a7890873](https://github.com/angular/angular-cli/commit/1a789087344aa94d061839122e6a63efbfc9c905) | fix | avoid extra tick in SSR builds | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| [5d46d6ec1](https://github.com/angular/angular-cli/commit/5d46d6ec114052715a8bd17761a4f258961ad26b) | fix | preserve names in esbuild for improved debugging in dev mode | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | +| [7eacb4187](https://github.com/angular/angular-cli/commit/7eacb41878f5fdac8d40aedfcca6794b77eda5ff) | feat | introduce BootstrapContext for isolated server-side rendering | + + + + + +# 20.2.2 (2025-09-03) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | +| [a793bbc47](https://github.com/angular/angular-cli/commit/a793bbc473dfaddf3fe6ed15805dc4fc84f52865) | fix | don't set a default for array options when length is 0 | +| [2736599e2](https://github.com/angular/angular-cli/commit/2736599e2f6c61032810d8e336c1646db4066392) | fix | set process title when running architect commands | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | +| [5c2abffea](https://github.com/angular/angular-cli/commit/5c2abffea6cf3f672ee256a944dba56dd257665b) | fix | avoid extra tick in SSR dev-server builds | +| [f3c826853](https://github.com/angular/angular-cli/commit/f3c826853501c9cf6d07a1c8ee3363eb79f53005) | fix | maintain media output hashing with vitest unit-testing | + + + + + +# 20.2.1 (2025-08-27) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------- | +| [3b693e09e](https://github.com/angular/angular-cli/commit/3b693e09e8148ef22031aab8f6bc70c928aabc03) | fix | correctly set default array values | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------ | +| [6937123a3](https://github.com/angular/angular-cli/commit/6937123a393e2ba9221962b0174056c14437a988) | fix | directly resolve karma config template in migration | +| [5d6dd4425](https://github.com/angular/angular-cli/commit/5d6dd44259a0d89098c2a0c784e726b43ce32316) | fix | prevent AI config schematic from failing when 'none' and other AI tools are selected | + +### @angular-devkit/schematics-cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------- | +| [e93919dea](https://github.com/angular/angular-cli/commit/e93919dea7df55a3aac2fa5c93c4560c50a2d749) | fix | correctly set default array values | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | +| [06a6ddc10](https://github.com/angular/angular-cli/commit/06a6ddc102f5dc9018ec982f6e4cf56259cc4b52) | fix | correct JS/TS file paths when running under Bazel | +| [b6816b0cb](https://github.com/angular/angular-cli/commit/b6816b0cbaf1262d7015b9d7f7fb425f53995947) | fix | ensure karma polyfills reporter factory returns a value | + + + + + +# 20.2.0 (2025-08-20) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------- | +| [b4de9a1bf](https://github.com/angular/angular-cli/commit/b4de9a1bf50a35404fb79eb3f120faafd0ce825a) | feat | add --experimental-tool option to mcp command | +| [755ba70fd](https://github.com/angular/angular-cli/commit/755ba70fd7ef38793d15797ba402020c375c3295) | feat | add --local-only option to mcp command | +| [59d7ef343](https://github.com/angular/angular-cli/commit/59d7ef343b6f1feea37a019935578c560d3d5e41) | feat | add --read-only option to mcp command | +| [4e92eb6f1](https://github.com/angular/angular-cli/commit/4e92eb6f17cb30259bc8e8d1979bbd9989bc5ad0) | feat | add modernize tool to the MCP server | +| [a3b25f675](https://github.com/angular/angular-cli/commit/a3b25f675283fdd8cc5689e3ec88f27aa1386390) | fix | add choices to command line parser when type is array and has an enum | +| [e19eee614](https://github.com/angular/angular-cli/commit/e19eee61404a9ca6268ebbc69f671a422d81df9b) | fix | address Node.js deprecation DEP0190 | +| [4ee6f327a](https://github.com/angular/angular-cli/commit/4ee6f327a206f8ff2ad5eeab43193df56b92b5e0) | fix | apply default to array types | +| [8ba6b0bcc](https://github.com/angular/angular-cli/commit/8ba6b0bcc8c8087875d14a0aefc6b7b52f39ce2a) | fix | use correct path for MCP get_best_practices tool | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------- | +| [2e3cfd598](https://github.com/angular/angular-cli/commit/2e3cfd598c9366d0036a52cd18024317b33e6fca) | feat | add migration to remove default Karma configurations | +| [d80dae276](https://github.com/angular/angular-cli/commit/d80dae276e9554c13e0c37640d0db8acafc9d48b) | feat | add schematics to generate ai context files. | +| [ffe6fb916](https://github.com/angular/angular-cli/commit/ffe6fb916d496da1c6c20942f6e6b05a679b0f7d) | fix | allow AI config prompt to be skipped without selecting a value | +| [ae2802b7d](https://github.com/angular/angular-cli/commit/ae2802b7db358c5a3f0590feea212a768a710353) | fix | improve AI config prompt wording | +| [b017f84fd](https://github.com/angular/angular-cli/commit/b017f84fdaf36bc0fcad2241846665c73b52b6d8) | fix | improve coverage directory handling for Karma configuration comparisons | +| [6a79f9a75](https://github.com/angular/angular-cli/commit/6a79f9a75cdcbb0761c4044066748f4eb788a57f) | fix | zoneless is now stable | + +### @angular-devkit/schematics + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------- | +| [c43504d8d](https://github.com/angular/angular-cli/commit/c43504d8d96a4436ce71c23d957aec2d080106b8) | fix | address Node.js deprecation DEP0190 | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------- | +| [fb06bb505](https://github.com/angular/angular-cli/commit/fb06bb5050e92eb4d0f95d7774552d0902163f6a) | feat | add headless mode for vitest browser mode | + + + + + +# 20.1.6 (2025-08-13) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- | +| [584bc1d41](https://github.com/angular/angular-cli/commit/584bc1d4173e7f129aa20e829f1dfb03e1e0dc9e) | fix | add extra prettier config | +| [02b0506fd](https://github.com/angular/angular-cli/commit/02b0506fde638b89510e5a78b3d190ba60a8d6ba) | fix | correct configure the `typeSeparator` in the library schematic | + + + + + +# 20.1.5 (2025-08-06) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- | +| [48ca04474](https://github.com/angular/angular-cli/commit/48ca044745f49bc7fc365a621827294f4cc82c50) | fix | cache MCP best practices content and add tool annotations | + + + + + +# 20.1.4 (2025-07-30) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | +| [2d753cc62](https://github.com/angular/angular-cli/commit/2d753cc62c9a801c40923a43e4af5f74b22700e0) | fix | skip workspace-specific tools when outside a workspace | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------- | +| [42d72ef4d](https://github.com/angular/angular-cli/commit/42d72ef4d99380dbb1c0e03e3e3abfb2223fa539) | fix | skip vite transformation of CSS-like assets | + + + + + +# 20.1.3 (2025-07-24) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------ | +| [ea5cd0e81](https://github.com/angular/angular-cli/commit/ea5cd0e81196467ea66f50c106cffec1cd8a1a56) | fix | update `vite` to `7.0.6` | + + + + + +# 20.1.2 (2025-07-23) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------- | +| [96785224f](https://github.com/angular/angular-cli/commit/96785224f55291cd60553aead07ead10d9d2fbda) | fix | `define` option is being included multiple times in the JSON help | -# 19.2.11 (2025-05-07) +### @angular-devkit/core + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------- | +| [0d0040bdf](https://github.com/angular/angular-cli/commit/0d0040bdf58a82e18f7669363b6f149313524bfc) | fix | use crypto.randomUUID instead of Date.now for unique string in tmp file names | + + + + + +# 20.1.1 (2025-07-16) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------ | +| [541b33f8d](https://github.com/angular/angular-cli/commit/541b33f8d977c1fe8f609099a8b8ed1c5f8e827e) | fix | emit a warning when `outputHashing` is set to `all` or `bundles` when HMR is enabled | +| [558a0fe92](https://github.com/angular/angular-cli/commit/558a0fe9275e68e0b768de3ee2e5bee0d6d84a6e) | fix | normalize code coverage include paths to POSIX | + + + + + +# 20.1.0 (2025-07-09) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------- | +| [dc45c186e](https://github.com/angular/angular-cli/commit/dc45c186ec16e345b75ffcd57961a8e0cfd4b649) | feat | add initial MCP server implementation | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------- | +| [1c19e0dcd](https://github.com/angular/angular-cli/commit/1c19e0dcd4a87fbf542201e09a402a8fccdfcd88) | feat | use signal in app component | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------- | +| [49a09737d](https://github.com/angular/angular-cli/commit/49a09737d5412c302d09b40de198251bb99789d1) | feat | provide partial custom postcss configuration support | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | +| [1159cf081](https://github.com/angular/angular-cli/commit/1159cf08103081d2b851e59bc1c5fb200f114982) | feat | add code coverage reporters option for unit-test | +| [8f305ef0b](https://github.com/angular/angular-cli/commit/8f305ef0ba91ec9bf6417b7084965205cf5488e7) | feat | add dataurl, base64 loaders | +| [adfeee0a4](https://github.com/angular/angular-cli/commit/adfeee0a4c95a03d430054eeecd4cca1bdb0efeb) | fix | adjust coverage includes/excludes for unit-test vitest runner | +| [c19cd2985](https://github.com/angular/angular-cli/commit/c19cd2985cbf1ea8c1c15f020bc530d6768cb0fa) | fix | coverage reporter option | +| [8879716ca](https://github.com/angular/angular-cli/commit/8879716cac9b2134db2795b1810595ea56e9d421) | fix | expose unit test and karma builder API | +| [a415a4999](https://github.com/angular/angular-cli/commit/a415a4999f337f5bc3c0ee626aaba58b6c5ad4e1) | fix | improve default coverage reporter handling for vitest | +| [e0de8680d](https://github.com/angular/angular-cli/commit/e0de8680d1ea25aa71024d7b89beaa1e75889c47) | fix | inject zone.js/testing before karma builder execution | +| [2672f6ec1](https://github.com/angular/angular-cli/commit/2672f6ec17de6e05b19acda0e0b09a6715c9f83f) | fix | json and json-summary as vitest coverage reporters | +| [b67fdfd6b](https://github.com/angular/angular-cli/commit/b67fdfd6bc422bd6a46db923470579c760c5ec27) | fix | resolve "Controller is already closed" error in Karma | +| [2784883ec](https://github.com/angular/angular-cli/commit/2784883ecfb63e4aa6a6c69fd10e457316b4958c) | fix | support extra test setup files with unit-test vitest runner | +| [f177f5508](https://github.com/angular/angular-cli/commit/f177f5508adb23f604d9abb5f4a33f3af5f32561) | fix | support injecting global styles into vitest unit-tests | +| [130c65014](https://github.com/angular/angular-cli/commit/130c650146595f237bc3285302d0075ba0387546) | fix | use an empty array as default value for vitest exclude | +| [917af12ae](https://github.com/angular/angular-cli/commit/917af12aeb82b1437e7b43a03ae80b58a09f0224) | fix | use date/time based output path for vitest unit-test | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------- | +| [21b5852f1](https://github.com/angular/angular-cli/commit/21b5852f120dd42ea4ae9fce043e04ec61da16dd) | fix | ensure `loadChildren` runs in correct injection context during route extraction | + + + + + +# 20.0.6 (2025-07-09) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------- | +| [5542445d3](https://github.com/angular/angular-cli/commit/5542445d30685a2ebbf66d15848a5abc657863c8) | fix | remove constructor from service template | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | +| [0836ad28f](https://github.com/angular/angular-cli/commit/0836ad28f8e4702f8ba12beef615d60c01a7947c) | fix | correctly remap Angular diagnostics | +| [c475e546b](https://github.com/angular/angular-cli/commit/c475e546bfdfee0c098e5198325b52a53882d034) | fix | exclude `@vitest/browser/context` from esbuild bundling | +| [1a2da161e](https://github.com/angular/angular-cli/commit/1a2da161e73f4f1fe876329adf8ed89f9044b404) | fix | failed to proxy error for assets | + + + + + +# 20.0.5 (2025-07-01) ### @angular-devkit/build-angular +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- | +| [1ebd53df7](https://github.com/angular/angular-cli/commit/1ebd53df7168307f699a9f9ae8f5ef5b9bcf352c) | fix | remove unused `@vitejs/plugin-basic-ssl` dependency | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------- | +| [05cebdbcd](https://github.com/angular/angular-cli/commit/05cebdbcd1466bf5c95eb724a784aeb8c7ac083f) | fix | proxy karma request from `/` to `/base` | + + + + + +# 20.0.4 (2025-06-25) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------- | +| [2316fe29d](https://github.com/angular/angular-cli/commit/2316fe29de57c593e5ccb8be612d3918b60d9761) | fix | add missing prettier config | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------- | +| [309742289](https://github.com/angular/angular-cli/commit/30974228988d7ff96741fe0515c35275e8a6bc0a) | fix | avoid preloading unnecessary dynamic bundles | +| [82691b98f](https://github.com/angular/angular-cli/commit/82691b98fa458febf40a16beb91b24c4b6c519c9) | fix | ensure correct referer header handling in web request conversion | + + + + + +# 20.0.3 (2025-06-18) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- | +| [e90a808c0](https://github.com/angular/angular-cli/commit/e90a808c0100beb319bae36ca3b771ee2da89435) | fix | include `main.server.ts` in `tsconfig.files` when present | +| [5c48b8e0a](https://github.com/angular/angular-cli/commit/5c48b8e0ac38a108740ebb290dc1e666ce390806) | fix | reset module `typeSeparator` when generating applications | + +### @angular/build + | Commit | Type | Description | | --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------- | -| [9eaf34405](https://github.com/angular/angular-cli/commit/9eaf344056b8772b623b0bfc27a66ad985941ae6) | fix | correctly set i18n subPath in webpack browser builder | +| [56f426e25](https://github.com/angular/angular-cli/commit/56f426e2548b86c00d4da19b9f7b5cf97dc79104) | fix | include custom bundle name scripts with karma | +| [dfe3a8b73](https://github.com/angular/angular-cli/commit/dfe3a8b7342dd492e42ec48052612255ba76c09b) | fix | increase worker idle timeout | +| [e6d27bd5e](https://github.com/angular/angular-cli/commit/e6d27bd5e3fe64f597621e0d5c08060cea64a302) | fix | set scripts option output as classic script for karma | + + + + + +# 20.0.2 (2025-06-11) + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------- | +| [bf64a0f2d](https://github.com/angular/angular-cli/commit/bf64a0f2dcc2cbd5dc56e575dd337c16f2a3342b) | fix | add `less` as a devDependency when selected as the style preprocessor | +| [cb258a3e1](https://github.com/angular/angular-cli/commit/cb258a3e1525cda985109692fb88449259119ff2) | fix | correctly detect modules using new file extension format | ### @angular/build +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | +| [424f1cbbf](https://github.com/angular/angular-cli/commit/424f1cbbfb709b4d6f480e6321ec1a152813cf5c) | fix | do not consider internal Angular files as external imports | + + + + + +# 19.2.15 (2025-06-11) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------- | +| [b120e1411](https://github.com/angular/angular-cli/commit/b120e1411c28c99defb34274a11f0fb54972178a) | fix | update dependency webpack-dev-server to v5.2.2 | + + + + + +# 18.2.20 (2025-06-11) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| ------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------- | +| [f048078](https://github.com/angular/angular-cli/commit/f048078ab6012b5da4dff024c107f42f79693682) | fix | update dependency webpack-dev-server to v5.2.2 | + + + + + +# 20.0.1 (2025-06-04) + +### @angular/cli + | Commit | Type | Description | | --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ | -| [cba66a85c](https://github.com/angular/angular-cli/commit/cba66a85c0bb26813d320281072495473a2d14e3) | fix | avoid attempting to watch bundler internal files | -| [009fc3776](https://github.com/angular/angular-cli/commit/009fc377636817a4dc178908245695d5cff29e75) | fix | avoid internal karma request cache for assets | -| [b43da3949](https://github.com/angular/angular-cli/commit/b43da39499ca477a896f7f957debb05ceed1372a) | perf | fix unnecessary esbuild rebuilds | +| [0883248cb](https://github.com/angular/angular-cli/commit/0883248cbdebcad09393349a0a5d9487b2a452ae) | fix | improve Node.js version check and error messages | + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------- | +| [525ddcbd2](https://github.com/angular/angular-cli/commit/525ddcbd290525e4dac2547c352cf6c774d728a2) | fix | only overwrite JSON file if actually changed | +| [83c820e5a](https://github.com/angular/angular-cli/commit/83c820e5ab55d01662417a51e4cc8d094e409fc6) | fix | remove karma config devkit package usages during application migration | +| [87266b38a](https://github.com/angular/angular-cli/commit/87266b38a09ce783ac6d18f532ebe1f8ae5954c0) | fix | skip zone.js dependency for zoneless applications | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------- | +| [e5efdc577](https://github.com/angular/angular-cli/commit/e5efdc577be913870b29173345b8194b87420474) | fix | also disable outputMode in vitest unit-tests | +| [5814393db](https://github.com/angular/angular-cli/commit/5814393dbb2f9227ce10f1df77a8deee06c7d1c5) | fix | resolve junit karma reporter output to workspace root | - + -# 20.0.0-next.9 (2025-04-30) +# 20.0.0 (2025-05-28) + +## Breaking Changes + +### @angular/cli + +- Node.js v18 is no longer supported with Angular. + + Before updating a project to Angular v20, the Node.js version must be + at least 20.11.1. For the full list of supported Node.js versions, + see https://angular.dev/reference/versions. + +- Node.js versions from 22.0 to 22.10 are no longer supported ### @schematics/angular -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------- | -| [5876577af](https://github.com/angular/angular-cli/commit/5876577af163b534846e720b0184558197dce741) | feat | Add prompt for new apps to be zoneless | -| [c557a19ef](https://github.com/angular/angular-cli/commit/c557a19ef4eed9f2d805bb235d3819c69a1aaef6) | fix | avoid empty polyfill option for new zoneless application | -| [148498c2b](https://github.com/angular/angular-cli/commit/148498c2bcd0feb495dc0aa14b6a4555ac01facb) | fix | Remove experimental from zoneless | -| [0f7dc2cd8](https://github.com/angular/angular-cli/commit/0f7dc2cd8f76f928e64e734563a433ff6a0d478c) | fix | skip spec project reference for minimal ng new | +- `--server-routing` option has been removed from several schematics. Server routing will be used when using the application builder. + +### @angular-devkit/schematics + +- The `NodePackageLinkTask` has been removed without a replacement. Create a custom task if needed. + + Note: This does not affect application developers. + +### @angular/build + +- TypeScript versions less than 5.8 are no longer supported. + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------------------------- | +| [e03f2b899](https://github.com/angular/angular-cli/commit/e03f2b89992cb1e34a57f9cd5beef77674c116b6) | feat | Add global error listeners to new app generation | +| [1e137ca84](https://github.com/angular/angular-cli/commit/1e137ca848839402bc214fbccdc04243862d01d0) | feat | add migration to update `moduleResolution` to `bundler` | +| [26fd4ea73](https://github.com/angular/angular-cli/commit/26fd4ea73ad2a0148ae587d582134c68a0bf4b86) | feat | add migrations for server rendering updates | +| [5876577af](https://github.com/angular/angular-cli/commit/5876577af163b534846e720b0184558197dce741) | feat | Add prompt for new apps to be zoneless | +| [fdc6291dd](https://github.com/angular/angular-cli/commit/fdc6291dda4903f418667d415b05367390cf829d) | feat | add update migration to keep previous style guide generation behavior | +| [093c5a315](https://github.com/angular/angular-cli/commit/093c5a3152c4282d4afb51df40945283cc94d281) | feat | directly use `@angular/build` in new projects | +| [d6f594fe0](https://github.com/angular/angular-cli/commit/d6f594fe0f8f21d9c0e2abedb5c8433a1aa5c157) | feat | generate applications using TypeScript project references | +| [0ab1ddf63](https://github.com/angular/angular-cli/commit/0ab1ddf632b7305db28a2f87f5c6b099a44669f6) | feat | generate libraries using TypeScript project references | +| [18e13e2ce](https://github.com/angular/angular-cli/commit/18e13e2ceed931d29aa5582980c7d6d1f66c9787) | feat | remove `--server-routing` option | +| [03180fe03](https://github.com/angular/angular-cli/commit/03180fe0358662f8fd3255ad546994da3e3bda9c) | feat | use TypeScript module preserve option for new projects | +| [86d241629](https://github.com/angular/angular-cli/commit/86d241629ff51f0bb5988e81cac8658b01704d49) | fix | add `@angular/ssr` dependency only when `provideServerRendering` import has been updated | +| [9e6b9b537](https://github.com/angular/angular-cli/commit/9e6b9b5379d0448578b3bfb6100852dea7febe75) | fix | add type checking of host bindings to strict config | +| [8654b3fea](https://github.com/angular/angular-cli/commit/8654b3fea4e2ba5af651e6c2a4afddaf6fc42802) | fix | application migration should migrate karma builder package | +| [c557a19ef](https://github.com/angular/angular-cli/commit/c557a19ef4eed9f2d805bb235d3819c69a1aaef6) | fix | avoid empty polyfill option for new zoneless application | +| [90615a88b](https://github.com/angular/angular-cli/commit/90615a88b10535d7f0197008b9d48ceac4409c23) | fix | default component templates to not use `.ng.html` extension | +| [672ae14cd](https://github.com/angular/angular-cli/commit/672ae14cd21d02a3b4727e2febd88747b9e4c684) | fix | drop composite in tsconfig | +| [da6ef626f](https://github.com/angular/angular-cli/commit/da6ef626f960b187a7862f0caa3d8aed38224ac2) | fix | ensure app-shell schematic consistently uses `withAppShell` | +| [f126f8d34](https://github.com/angular/angular-cli/commit/f126f8d34b087dd3a916dfb93cd255aac4d6c309) | fix | ensure module discovery checks for an NgModule decorator | +| [dc2f65999](https://github.com/angular/angular-cli/commit/dc2f65999a64453a26b61c96080b732fdc4147c8) | fix | generate component templates with a `.ng.html` file extension | +| [23fc8e1e1](https://github.com/angular/angular-cli/commit/23fc8e1e176f23442876b086bff52dd5f35abbc0) | fix | generate components without a `.component` extension/type | +| [8d715fa94](https://github.com/angular/angular-cli/commit/8d715fa948d432b18d06bcf42eed3a7681383523) | fix | generate directives without a .directive extension/type | +| [5fc595144](https://github.com/angular/angular-cli/commit/5fc5951440c9306c4349fa3f8dbcb1b584441fe8) | fix | generate guards with a dash type separator | +| [040282d8f](https://github.com/angular/angular-cli/commit/040282d8fd5838266785997442c4f5a269666cf3) | fix | generate interceptors with a dash type separator | +| [070d60fb3](https://github.com/angular/angular-cli/commit/070d60fb383bb14d39f969942641253e54980fcf) | fix | generate modules with a dash type separator | +| [e6083b57b](https://github.com/angular/angular-cli/commit/e6083b57bb5b38db14264253095a9729738d22f2) | fix | generate pipes with a dash type separator | +| [92e193c0b](https://github.com/angular/angular-cli/commit/92e193c0b9a2b85b68d83c5f378d30fc8d10f13e) | fix | generate resolvers with a dash type separator | +| [bc0f07b48](https://github.com/angular/angular-cli/commit/bc0f07b484300848ee81c5719c58909b40f99deb) | fix | generate services without a .service extension/type | +| [ea1143ddd](https://github.com/angular/angular-cli/commit/ea1143ddd801b775828f0b62788f4cce0dd7e9ce) | fix | infer app component name and path in server schematic | +| [bcc0892a6](https://github.com/angular/angular-cli/commit/bcc0892a65f00e68709e84c380f448a5e0fd05e7) | fix | migrate `provideServerRoutesConfig` to `provideServerRendering` | +| [5e8c6494d](https://github.com/angular/angular-cli/commit/5e8c6494d3eb5a0f61e8b07de4c53233147e9d46) | fix | relative tsconfig paths in references | +| [381d35fe4](https://github.com/angular/angular-cli/commit/381d35fe40f062713eac550a12b58c30c1ec33a9) | fix | remove empty `scripts` option value from new applications | +| [148498c2b](https://github.com/angular/angular-cli/commit/148498c2bcd0feb495dc0aa14b6a4555ac01facb) | fix | Remove experimental from zoneless | +| [a910fe9ae](https://github.com/angular/angular-cli/commit/a910fe9ae0423146f6509c5b9c45c88415365c9f) | fix | remove explicit `outputPath` option value from generated applications | +| [901ab60d9](https://github.com/angular/angular-cli/commit/901ab60d9f63fcff17213dbf7fe17e4a46835974) | fix | remove explicit index option from new applications | +| [be6f13ec1](https://github.com/angular/angular-cli/commit/be6f13ec16f01851d38b900dbfc4df7ccfb94d16) | fix | remove setting files tsconfig field with SSR/Server generation | +| [661609e3e](https://github.com/angular/angular-cli/commit/661609e3e583198828baf236338db17b6222f4d8) | fix | set explicit type in library schematic | +| [0f7dc2cd8](https://github.com/angular/angular-cli/commit/0f7dc2cd8f76f928e64e734563a433ff6a0d478c) | fix | skip spec project reference for minimal ng new | +| [3cf6ab0f7](https://github.com/angular/angular-cli/commit/3cf6ab0f77b23b8717e79b7125ea930cb018ebc5) | fix | support using default browser option when not present | +| [b13805a77](https://github.com/angular/angular-cli/commit/b13805a77a5654a352a6c6f760965c326977ff14) | fix | use protected for class member | + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | +| [e513cd4aa](https://github.com/angular/angular-cli/commit/e513cd4aa218e5ab634f05c18b6aa90f223e096c) | fix | add Node.js 24 as supported version | +| [5e90c1b4e](https://github.com/angular/angular-cli/commit/5e90c1b4ec3f1d05ad00f2f854347a5bf8cb0860) | fix | remove Node.js v18 support | +| [787e510dc](https://github.com/angular/angular-cli/commit/787e510dccabf30589194fcefdb74a687dfa3945) | fix | update min Node.js support to 20.19, 22.12, and 24.0 | +| [64732534e](https://github.com/angular/angular-cli/commit/64732534ecb84d702bde2469466a05e765879f9a) | fix | update minimum supported Node.js 22 version to 22.11.0 | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | +| [a42e045ba](https://github.com/angular/angular-cli/commit/a42e045bab3bfbeb0bb69c3406fd0a76ae263cdf) | fix | respect i18nDuplicateTranslation option when duplicates exist | + +### @angular-devkit/schematics + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | -------- | --------------------------------------- | +| [e6be37601](https://github.com/angular/angular-cli/commit/e6be37601d57f884a1ddf2cc1ddecf51819b9f51) | refactor | remove deprecated `NodePackageLinkTask` | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------- | +| [d6ea6b09f](https://github.com/angular/angular-cli/commit/d6ea6b09f182433f859a78d4a4d38a9db521e593) | feat | add experimental vitest browser support to unit-testing | +| [12def3a2e](https://github.com/angular/angular-cli/commit/12def3a2e907ca8e7d530cea1b39bba90e153144) | feat | add experimental vitest unit-testing support | +| [c1de63300](https://github.com/angular/angular-cli/commit/c1de633007c423cfd9113cc781b5647e59306146) | feat | allow control of source map sources content for application builds | +| [31c81e9c6](https://github.com/angular/angular-cli/commit/31c81e9c6859e68d00828b345d996d1aff431b25) | feat | drop support for TypeScript older than 5.8 | +| [e80963036](https://github.com/angular/angular-cli/commit/e8096303659f4f02ac05fe8f655bb29bc12fda28) | feat | expand browser support policy to widely available Baseline | +| [3c9172159](https://github.com/angular/angular-cli/commit/3c9172159c72f3c8ea116557ba5bf917a15d2f07) | feat | integrate Chrome automatic workspace folders | +| [9b682e625](https://github.com/angular/angular-cli/commit/9b682e62519e761477e6266650239bf58026a9f4) | feat | support a default outputPath option for applications | +| [d067cedf0](https://github.com/angular/angular-cli/commit/d067cedf05051e3a0f237d50306e1e4c881a0328) | feat | support custom resolution conditions with applications | +| [f4be83119](https://github.com/angular/angular-cli/commit/f4be831197010a17394264bc74b1eb385ba95028) | feat | Support Sass package importers | +| [f36a27272](https://github.com/angular/angular-cli/commit/f36a27272f3f7e2673d692d73286280f4c6d357a) | fix | allow a default application `browser` option | +| [f42f5c14c](https://github.com/angular/angular-cli/commit/f42f5c14c0c51d7705bee7b67afc317c45fb9230) | fix | allow component HMR for templates with i18n | +| [e36bf964a](https://github.com/angular/angular-cli/commit/e36bf964a776b04f6a9193387692274865e1630b) | fix | allow TestBed provider configuration with vitest unit-testing | +| [769961e4a](https://github.com/angular/angular-cli/commit/769961e4a9a67f88f8fb4b7de80dea67825219f9) | fix | allow vitest-based unit testing to use watch option | +| [3e24a59a9](https://github.com/angular/angular-cli/commit/3e24a59a9db9f11a80fa616c68be4380c4816ed5) | fix | disable TypeScript `composite` option with Angular compiler | +| [b155ba1dc](https://github.com/angular/angular-cli/commit/b155ba1dcdbc3c506311e4434c37f1b4c77c7572) | fix | enable unit-test builder watch outside CI | +| [7bb1f8747](https://github.com/angular/angular-cli/commit/7bb1f87478d441e35b73b920c8bfcd4376a3422d) | fix | enable unit-test reporters option | +| [05485ede7](https://github.com/angular/angular-cli/commit/05485ede7b472f98120c51f28bd485eeb635bac2) | fix | ensure `com.chrome.devtools.json` is consistently served after initial run | +| [7877d9a97](https://github.com/angular/angular-cli/commit/7877d9a971dbef5025fdb9a40f49f36e9b42569d) | fix | ensure disabled vitest config loading | +| [c8c73185a](https://github.com/angular/angular-cli/commit/c8c73185a66c7c7825e30f7fcedbaacc9ca1c593) | fix | ensure matching coverage excludes with karma on Windows | +| [aec95042b](https://github.com/angular/angular-cli/commit/aec95042b4d690c25645af590788c608b4b353dc) | fix | exclude only source test files with unit-test vitest support | +| [5bea3de4c](https://github.com/angular/angular-cli/commit/5bea3de4cb2ffa26ad04aced22be3ff11f519f92) | fix | invalidate `com.chrome.devtools.json` if project is moved | +| [1cd65a08d](https://github.com/angular/angular-cli/commit/1cd65a08d5278134115f33ff0e666aee420faf8a) | fix | perform testing module cleanup when using Vitest | +| [c51a540ce](https://github.com/angular/angular-cli/commit/c51a540ce4fb191811d2be06a9937f11826b38a5) | fix | provide direct debugging support for unit test builder | +| [c7f2cb596](https://github.com/angular/angular-cli/commit/c7f2cb59684a264bb4ecab2024d8a8c58efbefa7) | fix | provide vitest globals in unit-test builder | +| [d2bfc6bd4](https://github.com/angular/angular-cli/commit/d2bfc6bd4eb0892e9eb6205838158142b716d21c) | fix | revert setup unit-test polyfills before TestBed init | +| [0d40cdecd](https://github.com/angular/angular-cli/commit/0d40cdecd0fdc1b03d2cafcdd5321db0d31b56ee) | fix | setup unit-test polyfills before TestBed init | +| [fa3dc6387](https://github.com/angular/angular-cli/commit/fa3dc6387db971be265c1c5391c71a23c62df15c) | fix | show unit-test error for missing vitest browser package | +| [247cd3352](https://github.com/angular/angular-cli/commit/247cd335217d9997995321b4b235c40480adadb3) | fix | show unit-test error for missing vitest package | +| [eee816f79](https://github.com/angular/angular-cli/commit/eee816f79b4464286dcecc16f53c06be8afd4ccf) | fix | use global unit-test hooks during TestBed init | +| [566de64cb](https://github.com/angular/angular-cli/commit/566de64cbeebeb532db3c0f4ed1dd607c31dedf1) | fix | use virtual module for Karma TestBed initialization | +| [52fbffcd7](https://github.com/angular/angular-cli/commit/52fbffcd7bb129720a10e6bf865e4e3a01f939d6) | fix | warn and remove jsdom launcher when used with karma | +| [5ff6188c4](https://github.com/angular/angular-cli/commit/5ff6188c4330b009201a64a23d0090bfcec0612f) | perf | directly check code for Angular partial linking | + +### @angular/pwa + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- | +| [fa0a06f9f](https://github.com/angular/angular-cli/commit/fa0a06f9f92b28929fc775074245a0b97c3d9adc) | fix | support using default index option when not present | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------- | +| [33b9de3eb](https://github.com/angular/angular-cli/commit/33b9de3eb1fa596a4d5a975d05275739f2f7b8ae) | feat | expose `provideServerRendering` and remove `provideServerRouting` | +| [cdfc50c29](https://github.com/angular/angular-cli/commit/cdfc50c29a2aa6f32d172b505a0ef09e563dfc59) | feat | stabilize `AngularNodeAppEngine`, `AngularAppEngine`, and `provideServerRouting` APIs | +| [319b8e0c2](https://github.com/angular/angular-cli/commit/319b8e0c2a0cd30ab96576464b4172a1f76a97a6) | fix | manage unhandled errors in zoneless applications | +| [2d11e8e45](https://github.com/angular/angular-cli/commit/2d11e8e45b29cf879ee72ffbcf438198d73ffaba) | fix | return 302 when redirectTo is a function | +| [059c10eb4](https://github.com/angular/angular-cli/commit/059c10eb4df72b0d67f73783826e2bbae611ad35) | fix | SSR should work without `@angular/router` | +| [63428f3f1](https://github.com/angular/angular-cli/commit/63428f3f1e2ffd427011ea8a17b70f8829ae0bdf) | perf | flush headers prior to start rendering the HTML | +| [280693231](https://github.com/angular/angular-cli/commit/280693231e143aa09f841e3179317573a3576545) | perf | optimize response times by introducing header flushing | +| [6bd7b9b4a](https://github.com/angular/angular-cli/commit/6bd7b9b4a59240caa4f19185570aec8263d8a0a7) | perf | optimized request handling performance | + +### @ngtools/webpack + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- | +| [427bd846f](https://github.com/angular/angular-cli/commit/427bd846f552b393cb969472a05488ac11d47e9f) | fix | disable TypeScript composite option with Angular compiler | + + + + + +# 19.2.14 (2025-05-28) + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | +| [a3504fd45](https://github.com/angular/angular-cli/commit/a3504fd45602ec73ce1781e46e6c92b6042a51da) | fix | HMR requires AOT do not show HMR enabled when using JIT | +| [5ce9f96a4](https://github.com/angular/angular-cli/commit/5ce9f96a4efeb4efabe3c161ab596d049a1edd97) | fix | include full metadata for AOT unit-testing | + + + + + +# 19.2.13 (2025-05-21) + +### @angular/pwa + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- | +| [ad2fb2959](https://github.com/angular/angular-cli/commit/ad2fb29597e22767618d046fef3fb54bf8e95b5d) | fix | remove `background_color` and `theme_color` from manifest | + + + + + +# 19.2.12 (2025-05-14) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- | +| [0098c38c6](https://github.com/angular/angular-cli/commit/0098c38c6d77310effa8c647e1bbfb32fb92afc5) | fix | properly handle Node.js `require()` errors with ESM modules | + + + + + +# 19.2.11 (2025-05-07) -### @angular/build +### @angular-devkit/build-angular -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------- | -| [d6ea6b09f](https://github.com/angular/angular-cli/commit/d6ea6b09f182433f859a78d4a4d38a9db521e593) | feat | add experimental vitest browser support to unit-testing | -| [05485ede7](https://github.com/angular/angular-cli/commit/05485ede7b472f98120c51f28bd485eeb635bac2) | fix | ensure `com.chrome.devtools.json` is consistently served after initial run | +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------- | +| [9eaf34405](https://github.com/angular/angular-cli/commit/9eaf344056b8772b623b0bfc27a66ad985941ae6) | fix | correctly set i18n subPath in webpack browser builder | -### @angular/ssr +### @angular/build -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------- | -| [2d11e8e45](https://github.com/angular/angular-cli/commit/2d11e8e45b29cf879ee72ffbcf438198d73ffaba) | fix | return 302 when redirectTo is a function | +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ | +| [cba66a85c](https://github.com/angular/angular-cli/commit/cba66a85c0bb26813d320281072495473a2d14e3) | fix | avoid attempting to watch bundler internal files | +| [009fc3776](https://github.com/angular/angular-cli/commit/009fc377636817a4dc178908245695d5cff29e75) | fix | avoid internal karma request cache for assets | +| [b43da3949](https://github.com/angular/angular-cli/commit/b43da39499ca477a896f7f957debb05ceed1372a) | perf | fix unnecessary esbuild rebuilds | @@ -70,51 +1398,6 @@ - - -# 20.0.0-next.8 (2025-04-23) - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | -| [0ab1ddf63](https://github.com/angular/angular-cli/commit/0ab1ddf632b7305db28a2f87f5c6b099a44669f6) | feat | generate libraries using TypeScript project references | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------- | -| [12def3a2e](https://github.com/angular/angular-cli/commit/12def3a2e907ca8e7d530cea1b39bba90e153144) | feat | add experimental vitest unit-testing support | - - - - - -# 20.0.0-next.7 (2025-04-23) - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ | -| [e03f2b899](https://github.com/angular/angular-cli/commit/e03f2b89992cb1e34a57f9cd5beef77674c116b6) | feat | Add global error listeners to new app generation | -| [672ae14cd](https://github.com/angular/angular-cli/commit/672ae14cd21d02a3b4727e2febd88747b9e4c684) | fix | drop composite in tsconfig | -| [5e8c6494d](https://github.com/angular/angular-cli/commit/5e8c6494d3eb5a0f61e8b07de4c53233147e9d46) | fix | relative tsconfig paths in references | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------- | -| [e80963036](https://github.com/angular/angular-cli/commit/e8096303659f4f02ac05fe8f655bb29bc12fda28) | feat | expand browser support policy to widely available Baseline | -| [566de64cb](https://github.com/angular/angular-cli/commit/566de64cbeebeb532db3c0f4ed1dd607c31dedf1) | fix | use virtual module for Karma TestBed initialization | - -### @angular/ssr - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ | -| [8bfcae4c1](https://github.com/angular/angular-cli/commit/8bfcae4c1ba19c9bbd75ddb1ed61ddbf6fa2b76b) | fix | support `getPrerenderParams` for wildcard routes | - - - # 19.2.9 (2025-04-23) @@ -151,29 +1434,6 @@ - - -# 20.0.0-next.6 (2025-04-16) - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- | -| [d6f594fe0](https://github.com/angular/angular-cli/commit/d6f594fe0f8f21d9c0e2abedb5c8433a1aa5c157) | feat | generate applications using TypeScript project references | -| [8654b3fea](https://github.com/angular/angular-cli/commit/8654b3fea4e2ba5af651e6c2a4afddaf6fc42802) | fix | application migration should migrate karma builder package | -| [be6f13ec1](https://github.com/angular/angular-cli/commit/be6f13ec16f01851d38b900dbfc4df7ccfb94d16) | fix | remove setting files tsconfig field with SSR/Server generation | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------- | -| [d5a409a79](https://github.com/angular/angular-cli/commit/d5a409a79da16d368a6c0c588f9c987355ead529) | fix | include `module` value check when adding custom conditions | -| [95d16dc52](https://github.com/angular/angular-cli/commit/95d16dc52113a1d5f67c95a5f6d82e5e937f299c) | fix | pass `preserveSymlinks` option to Karma esbuild builder | -| [3d997feb6](https://github.com/angular/angular-cli/commit/3d997feb689b838a9777b7727bf937098c7d5e83) | fix | prevent nested CSS in components | -| [6e6315d72](https://github.com/angular/angular-cli/commit/6e6315d72686a88f29ec9e7565b463e302fdbed8) | fix | properly resolve transitive external dependencies in vite-dev-server | - - - # 19.2.8 (2025-04-16) @@ -189,46 +1449,6 @@ - - -# 20.0.0-next.5 (2025-04-09) - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------- | -| [fdc6291dd](https://github.com/angular/angular-cli/commit/fdc6291dda4903f418667d415b05367390cf829d) | feat | add update migration to keep previous style guide generation behavior | -| [90615a88b](https://github.com/angular/angular-cli/commit/90615a88b10535d7f0197008b9d48ceac4409c23) | fix | default component templates to not use `.ng.html` extension | -| [5fc595144](https://github.com/angular/angular-cli/commit/5fc5951440c9306c4349fa3f8dbcb1b584441fe8) | fix | generate guards with a dash type separator | -| [040282d8f](https://github.com/angular/angular-cli/commit/040282d8fd5838266785997442c4f5a269666cf3) | fix | generate interceptors with a dash type separator | -| [070d60fb3](https://github.com/angular/angular-cli/commit/070d60fb383bb14d39f969942641253e54980fcf) | fix | generate modules with a dash type separator | -| [e6083b57b](https://github.com/angular/angular-cli/commit/e6083b57bb5b38db14264253095a9729738d22f2) | fix | generate pipes with a dash type separator | -| [92e193c0b](https://github.com/angular/angular-cli/commit/92e193c0b9a2b85b68d83c5f378d30fc8d10f13e) | fix | generate resolvers with a dash type separator | -| [ea1143ddd](https://github.com/angular/angular-cli/commit/ea1143ddd801b775828f0b62788f4cce0dd7e9ce) | fix | infer app component name and path in server schematic | -| [661609e3e](https://github.com/angular/angular-cli/commit/661609e3e583198828baf236338db17b6222f4d8) | fix | set explicit type in library schematic | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- | -| [3e24a59a9](https://github.com/angular/angular-cli/commit/3e24a59a9db9f11a80fa616c68be4380c4816ed5) | fix | disable TypeScript `composite` option with Angular compiler | -| [6f913ad5e](https://github.com/angular/angular-cli/commit/6f913ad5e4d8ad9932ef2607851e3b8776e1af3a) | fix | include component test metadata in development builds | -| [fc0e05fea](https://github.com/angular/angular-cli/commit/fc0e05fea89598204a7e5de494da897c396c4e52) | fix | skip normalization of relative externals | - -### @angular/ssr - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ | -| [319b8e0c2](https://github.com/angular/angular-cli/commit/319b8e0c2a0cd30ab96576464b4172a1f76a97a6) | fix | manage unhandled errors in zoneless applications | - -### @ngtools/webpack - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- | -| [427bd846f](https://github.com/angular/angular-cli/commit/427bd846f552b393cb969472a05488ac11d47e9f) | fix | disable TypeScript composite option with Angular compiler | - - - # 19.2.7 (2025-04-09) @@ -267,32 +1487,6 @@ - - -# 20.0.0-next.4 (2025-04-02) - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | -| [1e137ca84](https://github.com/angular/angular-cli/commit/1e137ca848839402bc214fbccdc04243862d01d0) | feat | add migration to update `moduleResolution` to `bundler` | - -### @angular-devkit/schematics - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------- | -| [4955ee0aa](https://github.com/angular/angular-cli/commit/4955ee0aa31c1021b6369c29a250dd5a9a3f11cd) | fix | properly resolve relative schematics when executed from a nested directory | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | -| [d067cedf0](https://github.com/angular/angular-cli/commit/d067cedf05051e3a0f237d50306e1e4c881a0328) | feat | support custom resolution conditions with applications | -| [8a89438be](https://github.com/angular/angular-cli/commit/8a89438bef66e00d9795a5684c2b91dfdc102b3f) | fix | correctly handle `false` value in server option | -| [52fbffcd7](https://github.com/angular/angular-cli/commit/52fbffcd7bb129720a10e6bf865e4e3a01f939d6) | fix | warn and remove jsdom launcher when used with karma | - - - # 19.2.6 (2025-04-02) @@ -336,49 +1530,6 @@ - - -# 20.0.0-next.3 (2025-03-26) - -## Breaking Changes - -### @angular/cli - -- Node.js versions from 22.0 to 22.10 are no longer supported - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------- | -| [9e6b9b537](https://github.com/angular/angular-cli/commit/9e6b9b5379d0448578b3bfb6100852dea7febe75) | fix | add type checking of host bindings to strict config | -| [381d35fe4](https://github.com/angular/angular-cli/commit/381d35fe40f062713eac550a12b58c30c1ec33a9) | fix | remove empty `scripts` option value from new applications | -| [a910fe9ae](https://github.com/angular/angular-cli/commit/a910fe9ae0423146f6509c5b9c45c88415365c9f) | fix | remove explicit `outputPath` option value from generated applications | - -### @angular/cli - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | -| [64732534e](https://github.com/angular/angular-cli/commit/64732534ecb84d702bde2469466a05e765879f9a) | fix | update minimum supported Node.js 22 version to 22.11.0 | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------- | -| [c1de63300](https://github.com/angular/angular-cli/commit/c1de633007c423cfd9113cc781b5647e59306146) | feat | allow control of source map sources content for application builds | -| [9b682e625](https://github.com/angular/angular-cli/commit/9b682e62519e761477e6266650239bf58026a9f4) | feat | support a default outputPath option for applications | -| [156a14e38](https://github.com/angular/angular-cli/commit/156a14e387d83002fa01b33d574a6fbc078dad84) | fix | correct handling of response/request errors | -| [a8817a3b2](https://github.com/angular/angular-cli/commit/a8817a3b2a9a94bdfcba4bf690e217e7d2d4686c) | fix | handle undefined `getOrCreateAngularServerApp` during error compilation | -| [bd917d92a](https://github.com/angular/angular-cli/commit/bd917d92a653b1a5ece7ab96adfde8f8d282c34a) | fix | normalize karma asset paths before lookup | - -### @angular/ssr - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------- | -| [63428f3f1](https://github.com/angular/angular-cli/commit/63428f3f1e2ffd427011ea8a17b70f8829ae0bdf) | perf | flush headers prior to start rendering the HTML | -| [6bd7b9b4a](https://github.com/angular/angular-cli/commit/6bd7b9b4a59240caa4f19185570aec8263d8a0a7) | perf | optimized request handling performance | - - - # 19.2.5 (2025-03-26) @@ -424,47 +1575,6 @@ - - -# 20.0.0-next.2 (2025-03-19) - -## Breaking Changes - -### @schematics/angular - -- `--server-routing` option has been removed from several schematics. Server routing will be used when using the application builder. - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------------------------- | -| [26fd4ea73](https://github.com/angular/angular-cli/commit/26fd4ea73ad2a0148ae587d582134c68a0bf4b86) | feat | add migrations for server rendering updates | -| [18e13e2ce](https://github.com/angular/angular-cli/commit/18e13e2ceed931d29aa5582980c7d6d1f66c9787) | feat | remove `--server-routing` option | -| [86d241629](https://github.com/angular/angular-cli/commit/86d241629ff51f0bb5988e81cac8658b01704d49) | fix | add `@angular/ssr` dependency only when `provideServerRendering` import has been updated | -| [da6ef626f](https://github.com/angular/angular-cli/commit/da6ef626f960b187a7862f0caa3d8aed38224ac2) | fix | ensure app-shell schematic consistently uses `withAppShell` | -| [f126f8d34](https://github.com/angular/angular-cli/commit/f126f8d34b087dd3a916dfb93cd255aac4d6c309) | fix | ensure module discovery checks for an NgModule decorator | -| [23fc8e1e1](https://github.com/angular/angular-cli/commit/23fc8e1e176f23442876b086bff52dd5f35abbc0) | fix | generate components without a `.component` extension/type | -| [8d715fa94](https://github.com/angular/angular-cli/commit/8d715fa948d432b18d06bcf42eed3a7681383523) | fix | generate directives without a .directive extension/type | -| [bc0f07b48](https://github.com/angular/angular-cli/commit/bc0f07b484300848ee81c5719c58909b40f99deb) | fix | generate services without a .service extension/type | -| [c0de72317](https://github.com/angular/angular-cli/commit/c0de723173549f62a524b6e6c58c6d80c8054581) | fix | replace `@angular/platform-browser-dynamic` with `@angular/platform-browser` | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------- | -| [f4be83119](https://github.com/angular/angular-cli/commit/f4be831197010a17394264bc74b1eb385ba95028) | feat | Support Sass package importers | -| [cb2ab43ab](https://github.com/angular/angular-cli/commit/cb2ab43abcf0e3c1a2cc584a326e1eea5eede7a8) | fix | ensure errors for missing component resources | -| [f780e8beb](https://github.com/angular/angular-cli/commit/f780e8beb3ccea27ef0442d1d3814ec2a668057d) | fix | ensure relative karma stack traces for test failures | - -### @angular/ssr - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------- | -| [33b9de3eb](https://github.com/angular/angular-cli/commit/33b9de3eb1fa596a4d5a975d05275739f2f7b8ae) | feat | expose `provideServerRendering` and remove `provideServerRouting` | -| [cdfc50c29](https://github.com/angular/angular-cli/commit/cdfc50c29a2aa6f32d172b505a0ef09e563dfc59) | feat | stabilize `AngularNodeAppEngine`, `AngularAppEngine`, and `provideServerRouting` APIs | - - - # 19.2.4 (2025-03-19) @@ -520,49 +1630,6 @@ - - -# 20.0.0-next.1 (2025-03-13) - -## Breaking Changes - -### @angular/build - -- TypeScript versions less than 5.8 are no longer supported. - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | -| [03180fe03](https://github.com/angular/angular-cli/commit/03180fe0358662f8fd3255ad546994da3e3bda9c) | feat | use TypeScript module preserve option for new projects | -| [dc2f65999](https://github.com/angular/angular-cli/commit/dc2f65999a64453a26b61c96080b732fdc4147c8) | fix | generate component templates with a `.ng.html` file extension | - -### @angular/cli - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------- | -| [2d03d8f11](https://github.com/angular/angular-cli/commit/2d03d8f11325cfba72b43f531e4bc27140d45caf) | fix | record analytics for nested schematics | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- | -| [31c81e9c6](https://github.com/angular/angular-cli/commit/31c81e9c6859e68d00828b345d996d1aff431b25) | feat | drop support for TypeScript older than 5.8 | -| [3c9172159](https://github.com/angular/angular-cli/commit/3c9172159c72f3c8ea116557ba5bf917a15d2f07) | feat | integrate Chrome automatic workspace folders | -| [f0dd60be1](https://github.com/angular/angular-cli/commit/f0dd60be1ec72d9c8674471965b11be83083a0f1) | fix | exclude all entrypoints of a library from prebundling | -| [3e3516785](https://github.com/angular/angular-cli/commit/3e35167855b3eacb9f45948ef75e999956819490) | fix | handle postcss compilation errors gracefully | -| [5bea3de4c](https://github.com/angular/angular-cli/commit/5bea3de4cb2ffa26ad04aced22be3ff11f519f92) | fix | invalidate `com.chrome.devtools.json` if project is moved | -| [b100c71cc](https://github.com/angular/angular-cli/commit/b100c71ccd39ff62203f16cbe543ba77b98bbe1d) | fix | provide `extract-i18n` does not respect | -| [beab546bf](https://github.com/angular/angular-cli/commit/beab546bf2680d568af12e51e948a100098ae3fd) | fix | remove duplicate prebundling warning | - -### @angular/ssr - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ | -| [ee8466de5](https://github.com/angular/angular-cli/commit/ee8466de520c3db08579be376dbd2b98795f50a8) | fix | prevent stream draining if `write` does not return a boolean | - - - # 19.2.2 (2025-03-12) @@ -590,58 +1657,6 @@ - - -# 20.0.0-next.0 (2025-03-05) - -## Breaking Changes - -### @angular/cli - -- Node.js v18 is no longer supported with Angular. - - Before updating a project to Angular v20, the Node.js version must be - at least 20.11.1. For the full list of supported Node.js versions, - see https://angular.dev/reference/versions. - -### @angular-devkit/schematics - -- The `NodePackageLinkTask` has been removed without a replacement. Create a custom task if needed. - - Note: This does not affect application developers. - -### @schematics/angular - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- | -| [093c5a315](https://github.com/angular/angular-cli/commit/093c5a3152c4282d4afb51df40945283cc94d281) | feat | directly use `@angular/build` in new projects | - -### @angular/cli - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | -------------------------- | -| [5e90c1b4e](https://github.com/angular/angular-cli/commit/5e90c1b4ec3f1d05ad00f2f854347a5bf8cb0860) | fix | remove Node.js v18 support | - -### @angular-devkit/schematics - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | -------- | --------------------------------------- | -| [e6be37601](https://github.com/angular/angular-cli/commit/e6be37601d57f884a1ddf2cc1ddecf51819b9f51) | refactor | remove deprecated `NodePackageLinkTask` | - -### @angular/build - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- | -| [c8c73185a](https://github.com/angular/angular-cli/commit/c8c73185a66c7c7825e30f7fcedbaacc9ca1c593) | fix | ensure matching coverage excludes with karma on Windows | - -### @angular/ssr - -| Commit | Type | Description | -| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------ | -| [280693231](https://github.com/angular/angular-cli/commit/280693231e143aa09f841e3179317573a3576545) | perf | optimize response times by introducing header flushing | - - - # 19.2.1 (2025-03-05) @@ -1215,7 +2230,6 @@ - Protractor is no longer supported. Protractor was marked end-of-life in August 2023 (see https://protractortest.org/). Projects still relying on Protractor should consider migrating to another E2E testing framework, several support solid migration paths from Protractor. - - https://angular.dev/tools/cli/end-to-end - https://blog.angular.dev/the-state-of-end-to-end-testing-with-angular-d175f751cb9c @@ -4850,7 +5864,6 @@ Alan Agius, Charles Lyding and Doug Parker ### @angular/cli - Several changes to the `ng analytics` command syntax. - - `ng analytics project ` has been replaced with `ng analytics ` - `ng analytics ` has been replaced with `ng analytics --global` @@ -4861,7 +5874,6 @@ Alan Agius, Charles Lyding and Doug Parker - `--configuration` cannot be used with `ng run`. Provide the configuration as part of the target. Ex: `ng run project:builder:configuration`. - Deprecated `ng x18n` and `ng i18n-extract` commands have been removed in favor of `ng extract-i18n`. - Several changes in the Angular CLI commands and arguments handling. - - `ng help` has been removed in favour of the `—-help` option. - `ng —-version` has been removed in favour of `ng version` and `ng v`. - Deprecated camel cased arguments are no longer supported. Ex. using `—-sourceMap` instead of `—-source-map` will result in an error. @@ -4881,7 +5893,6 @@ Alan Agius, Charles Lyding and Doug Parker - `browser` and `karma` builders `script` and `styles` options input files extensions are now validated. Valid extensions for `scripts` are: - - `.js` - `.cjs` - `.mjs` @@ -4890,7 +5901,6 @@ Alan Agius, Charles Lyding and Doug Parker - `.mjsx` Valid extensions for `styles` are: - - `.css` - `.less` - `.sass` @@ -4933,7 +5943,6 @@ Alan Agius, Charles Lyding and Doug Parker ### @ngtools/webpack - `ivy` namespace has been removed from the public API. - - `ivy.AngularWebpackPlugin` -> `AngularWebpackPlugin` - `ivy.AngularPluginOptions` -> `AngularPluginOptions` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0642e0b7ff65..06db9756c89d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -294,22 +294,10 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise [coc]: https://github.com/angular/code-of-conduct/blob/main/CODE_OF_CONDUCT.md [commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# [corporate-cla]: https://code.google.com/legal/corporate-cla-v1.0.html -[dev-doc]: https://github.com/angular/angular-cli/blob/main/packages/angular/cli/README.md#development-hints-for-working-on-angular-cli +[dev-doc]: https://github.com/angular/angular-cli/blob/main/docs/DEVELOPER.md [GitHub]: https://github.com/angular/angular-cli [gitter]: https://gitter.im/angular/angular-cli [individual-cla]: https://code.google.com/legal/individual-cla-v1.0.html [js-style-guide]: https://google.github.io/styleguide/jsguide.html [stackoverflow]: https://stackoverflow.com/questions/tagged/angular-devkit -## Updating the Public API -Our Public API surface is tracked using golden files. - -You check all golden files by running: -```bash -pnpm public-api:check -``` - -If you modified the public API, the test will fail. To update the golden files you need to run: -```bash -pnpm public-api:update -``` diff --git a/MODULE.bazel b/MODULE.bazel index f90ed9010d4c..b4bf8a27a1aa 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,5 +1,173 @@ -# TODO(devversion): Investigate bzlmod and use it where possible. +"""Rules/toolchains for angular_cli with Bazel.""" module( name = "angular_cli", ) + +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "yq.bzl", version = "0.3.2") +bazel_dep(name = "rules_nodejs", version = "6.6.2") +bazel_dep(name = "aspect_rules_js", version = "2.8.3") +bazel_dep(name = "aspect_rules_ts", version = "3.8.1") +bazel_dep(name = "rules_pkg", version = "1.1.0") +bazel_dep(name = "rules_cc", version = "0.2.15") +bazel_dep(name = "aspect_bazel_lib", version = "2.22.0") +bazel_dep(name = "bazel_skylib", version = "1.9.0") +bazel_dep(name = "aspect_rules_esbuild", version = "0.25.0") +bazel_dep(name = "aspect_rules_jasmine", version = "2.0.2") +bazel_dep(name = "rules_angular") +git_override( + module_name = "rules_angular", + commit = "7133b97252508f8528e5c5818a9a73cacc2e2a0e", + remote = "https://github.com/devversion/rules_angular.git", +) + +bazel_dep(name = "devinfra") +git_override( + module_name = "devinfra", + commit = "942d738d8f4d65b161d06e6c399fefec318cdbfe", + remote = "https://github.com/angular/dev-infra.git", +) + +bazel_dep(name = "rules_sass") +git_override( + module_name = "rules_sass", + commit = "1184a80751a21af8348f308abc5b38a41f26850e", + remote = "https://github.com/devversion/rules_sass.git", +) + +bazel_dep(name = "rules_browsers") +git_override( + module_name = "rules_browsers", + commit = "8ef3e996d5fc040a35770f860987d8b9cad8ef3d", + remote = "https://github.com/devversion/rules_browsers.git", +) + +node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +node.toolchain(node_version_from_nvmrc = "//:.nvmrc") +use_repo( + node, + "nodejs_darwin_amd64", + "nodejs_darwin_arm64", + "nodejs_linux_amd64", + "nodejs_linux_arm64", + "nodejs_toolchains", + "nodejs_windows_amd64", +) + +node_dev = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) + +# Node.js 20 +node_dev.toolchain( + name = "node20", + node_version = "20.19.0", +) + +# Node.js 22 +node_dev.toolchain( + name = "node22", + node_version = "22.12.0", +) + +# Node.js 24 +node_dev.toolchain( + name = "node24", + node_version = "24.0.0", +) +use_repo( + node_dev, + "node20_darwin_amd64", + "node20_darwin_arm64", + "node20_linux_amd64", + "node20_linux_arm64", + "node20_toolchains", + "node20_windows_amd64", + "node22_darwin_amd64", + "node22_darwin_arm64", + "node22_linux_amd64", + "node22_linux_arm64", + "node22_toolchains", + "node22_windows_amd64", + "node24_darwin_amd64", + "node24_darwin_arm64", + "node24_linux_amd64", + "node24_linux_arm64", + "node24_toolchains", + "node24_windows_amd64", +) + +pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +pnpm.pnpm( + name = "pnpm", + pnpm_version = "10.26.0", + pnpm_version_integrity = "sha512-Oz9scl6+cSUGwKsa1BM8+GsfS2h+/85iqbOLTXLjlUJC5kMZD8UfoWQpScc19APevUT1yw7dZXq+Y6i2p+HkAg==", +) +use_repo(pnpm, "pnpm") + +npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") +npm.npm_translate_lock( + name = "npm", + custom_postinstalls = { + # TODO: Standardize browser management for `rules_js` + "webdriver-manager": "node ./bin/webdriver-manager update --standalone false --gecko false --versions.chrome 106.0.5249.21", + }, + data = [ + "//:package.json", + "//:pnpm-workspace.yaml", + "//modules/testing/builder:package.json", + "//packages/angular/build:package.json", + "//packages/angular/cli:package.json", + "//packages/angular/create/package.json", + "//packages/angular/pwa:package.json", + "//packages/angular/ssr:package.json", + "//packages/angular_devkit/architect:package.json", + "//packages/angular_devkit/architect_cli:package.json", + "//packages/angular_devkit/build_angular:package.json", + "//packages/angular_devkit/build_webpack:package.json", + "//packages/angular_devkit/core:package.json", + "//packages/angular_devkit/schematics:package.json", + "//packages/angular_devkit/schematics_cli:package.json", + "//packages/ngtools/webpack:package.json", + "//packages/schematics/angular:package.json", + "//tests:package.json", + ], + lifecycle_hooks_envs = { + # TODO: Standardize browser management for `rules_js` + "puppeteer": ["PUPPETEER_DOWNLOAD_PATH=./downloads"], + }, + lifecycle_hooks_execution_requirements = { + # Needed for downloading chromedriver. + # Also `update-config` of webdriver manager would store an absolute path; + # which would then break execution. + "webdriver-manager": ["local"], + }, + npmrc = "//:.npmrc", + pnpm_lock = "//:pnpm-lock.yaml", +) +use_repo(npm, "npm") + +rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext") +rules_ts_ext.deps( + name = "angular_cli_npm_typescript", + # Obtained by: npm info typescript@5.9.3 dist.integrity + ts_integrity = "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + ts_version = "5.9.3", +) +use_repo(rules_ts_ext, **{"npm_typescript": "angular_cli_npm_typescript"}) + +rules_angular = use_extension("@rules_angular//setup:extensions.bzl", "rules_angular") +rules_angular.setup( + name = "components_rules_angular_configurable_deps", + angular_compiler_cli = "//:node_modules/@angular/compiler-cli", + typescript = "//:node_modules/typescript", +) +use_repo(rules_angular, **{"rules_angular_configurable_deps": "components_rules_angular_configurable_deps"}) + +register_toolchains( + "@devinfra//bazel/git-toolchain:git_linux_toolchain", + "@devinfra//bazel/git-toolchain:git_macos_x86_toolchain", + "@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain", + "@devinfra//bazel/git-toolchain:git_windows_toolchain", + "//tools/toolchains:dummy_cc_windows_no_exec_toolchain", + "//tools/toolchains:node22_windows_no_exec_toolchain", +) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 3137c9f1d3fc..1f9bb1615d4e 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,110 +1,4460 @@ { - "lockFileVersion": 13, + "lockFileVersion": 24, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", - "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", - "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.0.0/MODULE.bazel": "e118477db5c49419a88d78ebc7a2c2cea9d49600fe0f490c1903324a2c16ecd9", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.17.1/MODULE.bazel": "9b027af55f619c7c444cead71061578fab6587e5e1303fa4ed61d49d2b1a7262", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.3/MODULE.bazel": "253d739ba126f62a5767d832765b12b59e9f8d2bc88cc1572f4a73e46eb298ca", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.22.0/MODULE.bazel": "7fe0191f047d4fe4a4a46c1107e2350cbb58a8fc2e10913aa4322d3190dec0bf", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.22.0/source.json": "369df5b7f2eae82f200fff95cf1425f90dee90a0d0948122060b48150ff0e224", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.7.7/MODULE.bazel": "491f8681205e31bb57892d67442ce448cda4f472a8e6b3dc062865e29a64f89c", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "812d2dd42f65dca362152101fbec418029cc8fd34cbad1a2fde905383d705838", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.9.3/MODULE.bazel": "66baf724dbae7aff4787bf2245cc188d50cb08e07789769730151c0943587c14", + "https://bcr.bazel.build/modules/aspect_rules_esbuild/0.25.0/MODULE.bazel": "5fef5ec709c837312823f9bcf0f276661e2cb48ad52f17c4e01176bbf1e9bf58", + "https://bcr.bazel.build/modules/aspect_rules_esbuild/0.25.0/source.json": "5e42968c6d23ab8bd95c02634b16864d866334347827cb6a8425b86c11cc4363", + "https://bcr.bazel.build/modules/aspect_rules_jasmine/2.0.2/MODULE.bazel": "45f054400ff242c4433f6d7f20f6123a9a72739cb7a1f44247d738db1644f46c", + "https://bcr.bazel.build/modules/aspect_rules_jasmine/2.0.2/source.json": "3ed399a5654259a822448f9cdbf21f6c738f16ccd7f89249c7507e374cbdd1e3", + "https://bcr.bazel.build/modules/aspect_rules_js/2.0.0/MODULE.bazel": "b45b507574aa60a92796e3e13c195cd5744b3b8aff516a9c0cb5ae6a048161c5", + "https://bcr.bazel.build/modules/aspect_rules_js/2.4.2/MODULE.bazel": "0d01db38b96d25df7ed952a5e96eac4b3802723d146961974bf020f6dd07591d", + "https://bcr.bazel.build/modules/aspect_rules_js/2.6.2/MODULE.bazel": "ed2a871f4ab8fbde0cab67c425745069d84ea64b64313fa1a2954017326511f5", + "https://bcr.bazel.build/modules/aspect_rules_js/2.8.3/MODULE.bazel": "807ce5f624124a8bc586c743394d174e85f0f9c6c4e0e2410b4088aebe790ac8", + "https://bcr.bazel.build/modules/aspect_rules_js/2.8.3/source.json": "c35cb4e04f61a09c17f8c569894b80de884b1e3dee2d33829704786e3f778037", + "https://bcr.bazel.build/modules/aspect_rules_ts/3.6.3/MODULE.bazel": "d09db394970f076176ce7bab5b5fa7f0d560fd4f30b8432ea5e2c2570505b130", + "https://bcr.bazel.build/modules/aspect_rules_ts/3.7.0/MODULE.bazel": "5aace216caf88638950ef061245d23c36f57c8359e56e97f02a36f70bb09c50f", + "https://bcr.bazel.build/modules/aspect_rules_ts/3.8.1/MODULE.bazel": "796622c65ae3008374fc2d77c32ddb4ef6da9fe891826ce648f70033a48b3667", + "https://bcr.bazel.build/modules/aspect_rules_ts/3.8.1/source.json": "a7c4f332f5c21f4e63d073f8dda40bf278d5307499fb307b35058dba558f417a", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.2.3/MODULE.bazel": "20f53b145f40957a51077ae90b37b7ce83582a1daf9350349f0f86179e19dd0d", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.2.6/MODULE.bazel": "cafb8781ad591bc57cc765dca5fefab08cf9f65af363d162b79d49205c7f8af7", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.2.8/MODULE.bazel": "aa975a83e72bcaac62ee61ab12b788ea324a1d05c4aab28aadb202f647881679", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.3.3/MODULE.bazel": "37c764292861c2f70314efa9846bb6dbb44fc0308903b3285da6528305450183", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.3.3/source.json": "605086bbc197743a0d360f7ddc550a1d4dfa0441bc807236e17170f636153348", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", + "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", + "https://bcr.bazel.build/modules/bazel_features/1.34.0/MODULE.bazel": "e8475ad7c8965542e0c7aac8af68eb48c4af904be3d614b6aa6274c092c2ea1e", + "https://bcr.bazel.build/modules/bazel_features/1.34.0/source.json": "dfa5c4b01110313153b484a735764d247fee5624bbab63d25289e43b151a657a", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_lib/3.0.0-beta.1/MODULE.bazel": "407729e232f611c3270005b016b437005daa7b1505826798ea584169a476e878", + "https://bcr.bazel.build/modules/bazel_lib/3.0.0/MODULE.bazel": "22b70b80ac89ad3f3772526cd9feee2fa412c2b01933fea7ed13238a448d370d", + "https://bcr.bazel.build/modules/bazel_lib/3.0.0/source.json": "895f21909c6fba01d7c17914bb6c8e135982275a1b18cdaa4e62272217ef1751", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.0/MODULE.bazel": "2ab127ef8d56a739a99bb2ce00ec4c7d1ecc7977d4370c0ca6efd0d8f03d6d99", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "cdf8cbe5ee750db04b78878c9633cc76e80dcf4416cbe982ac3a9222f80713c8", + "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/source.json": "fa7b512dfcb5eafd90ce3959cf42a2a6fe96144ebbb4b3b3928054895f2afac2", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", - "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/jq.bzl/0.1.0/MODULE.bazel": "2ce69b1af49952cd4121a9c3055faa679e748ce774c7f1fda9657f936cae902f", + "https://bcr.bazel.build/modules/jq.bzl/0.1.0/source.json": "746bf13cac0860f091df5e4911d0c593971cd8796b5ad4e809b2f8e133eee3d5", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92", + "https://bcr.bazel.build/modules/package_metadata/0.0.2/source.json": "e53a759a72488d2c0576f57491ef2da0cf4aab05ac0997314012495935531b73", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", - "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", - "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580", + "https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96", "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", - "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", + "https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513", + "https://bcr.bazel.build/modules/rules_cc/0.2.15/MODULE.bazel": "6a0a4a75a57aa6dc888300d848053a58c6b12a29f89d4304e1c41448514ec6e8", + "https://bcr.bazel.build/modules/rules_cc/0.2.15/source.json": "197965c6dcca5c98a9288f93849e2e1c69d622e71b0be8deb524e22d48c88e32", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", - "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.14.0/MODULE.bazel": "717717ed40cc69994596a45aec6ea78135ea434b8402fb91b009b9151dd65615", + "https://bcr.bazel.build/modules/rules_java/8.14.0/source.json": "8a88c4ca9e8759da53cddc88123880565c520503321e2566b4e33d0287a3d4bc", + "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", - "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_nodejs/6.2.0/MODULE.bazel": "ec27907f55eb34705adb4e8257952162a2d4c3ed0f0b3b4c3c1aad1fac7be35e", + "https://bcr.bazel.build/modules/rules_nodejs/6.3.0/MODULE.bazel": "45345e4aba35dd6e4701c1eebf5a4e67af4ed708def9ebcdc6027585b34ee52d", + "https://bcr.bazel.build/modules/rules_nodejs/6.5.0/MODULE.bazel": "546d0cf79f36f9f6e080816045f97234b071c205f4542e3351bd4424282a8810", + "https://bcr.bazel.build/modules/rules_nodejs/6.5.2/MODULE.bazel": "7f9ea68a0ce6d82905ce9f74e76ab8a8b4531ed4c747018c9d76424ad0b3370d", + "https://bcr.bazel.build/modules/rules_nodejs/6.6.2/MODULE.bazel": "9fdb5e1d50246a25761f150fcc820dc47e4052330a8408451e628804f9ca64a6", + "https://bcr.bazel.build/modules/rules_nodejs/6.6.2/source.json": "6e8c1ecc64ff8da147c1620f862ad77d7b19c5d1b52b3aa5e847d5b3d0de4cc3", "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.1.0/MODULE.bazel": "9db8031e71b6ef32d1846106e10dd0ee2deac042bd9a2de22b4761b0c3036453", + "https://bcr.bazel.build/modules/rules_pkg/1.1.0/source.json": "fef768df13a92ce6067e1cd0cdc47560dace01354f1d921cfb1d632511f7d608", "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", + "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", - "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", - "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43", + "https://bcr.bazel.build/modules/rules_python/1.0.0/source.json": "b0162a65c6312e45e7912e39abd1a7f8856c2c7e41ecc9b6dc688a6f6400a917", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592", + "https://bcr.bazel.build/modules/rules_shell/0.4.1/source.json": "4757bd277fe1567763991c4425b483477bb82e35e777a56fd846eb5cceda324a", "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", - "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.4/MODULE.bazel": "6569966df04610b8520957cb8e97cf2e9faac2c0309657c537ab51c16c18a2a4", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", + "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", + "https://bcr.bazel.build/modules/tar.bzl/0.2.1/MODULE.bazel": "52d1c00a80a8cc67acbd01649e83d8dd6a9dc426a6c0b754a04fe8c219c76468", + "https://bcr.bazel.build/modules/tar.bzl/0.5.1/MODULE.bazel": "7c2eb3dcfc53b0f3d6f9acdfd911ca803eaf92aadf54f8ca6e4c1f3aee288351", + "https://bcr.bazel.build/modules/tar.bzl/0.7.0/MODULE.bazel": "cc1acd85da33c80e430b65219a620d54d114628df24a618c3a5fa0b65e988da9", + "https://bcr.bazel.build/modules/tar.bzl/0.7.0/source.json": "9becb80306f42d4810bfa16379fb48aad0b01ce5342bc12fe47dcd6af3ac4d7a", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", + "https://bcr.bazel.build/modules/yq.bzl/0.1.1/MODULE.bazel": "9039681f9bcb8958ee2c87ffc74bdafba9f4369096a2b5634b88abc0eaefa072", + "https://bcr.bazel.build/modules/yq.bzl/0.2.0/MODULE.bazel": "6f3a675677db8885be4d607fde14cc51829715e3a879fb016eb9bf336786ce6d", + "https://bcr.bazel.build/modules/yq.bzl/0.3.2/MODULE.bazel": "0384efa70e8033d842ea73aa4b7199fa099709e236a7264345c03937166670b6", + "https://bcr.bazel.build/modules/yq.bzl/0.3.2/source.json": "c4ec3e192477e154f08769e29d69e8fd36e8a4f0f623997f3e1f6f7d328f7d7d", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", - "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" }, "selectedYankedVersions": {}, "moduleExtensions": { - "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { + "@@aspect_rules_esbuild+//esbuild:extensions.bzl%esbuild": { "general": { - "bzlTransitiveDigest": "PjIds3feoYE8SGbbIq2SFTZy3zmxeO2tQevJZNDo7iY=", - "usagesDigest": "+hz7IHWN6A1oVJJWNDB6yZRG+RYhF76wAYItpAeIUIg=", + "bzlTransitiveDigest": "0aod3RK04ALA/OKTExzd7QqyeqcC4O2GWuDwUxhQHp4=", + "usagesDigest": "ToTaCONCN/E05krnHXLM1kpV1zrHNxHrGpUip973II4=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "local_config_apple_cc_toolchains": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf_toolchains", - "attributes": {} + "esbuild_darwin-x64": { + "repoRuleId": "@@aspect_rules_esbuild+//esbuild:repositories.bzl%esbuild_repositories", + "attributes": { + "esbuild_version": "0.19.9", + "integrity": "", + "platform": "darwin-x64" + } + }, + "esbuild_darwin-arm64": { + "repoRuleId": "@@aspect_rules_esbuild+//esbuild:repositories.bzl%esbuild_repositories", + "attributes": { + "esbuild_version": "0.19.9", + "integrity": "", + "platform": "darwin-arm64" + } + }, + "esbuild_linux-x64": { + "repoRuleId": "@@aspect_rules_esbuild+//esbuild:repositories.bzl%esbuild_repositories", + "attributes": { + "esbuild_version": "0.19.9", + "integrity": "", + "platform": "linux-x64" + } + }, + "esbuild_linux-arm64": { + "repoRuleId": "@@aspect_rules_esbuild+//esbuild:repositories.bzl%esbuild_repositories", + "attributes": { + "esbuild_version": "0.19.9", + "integrity": "", + "platform": "linux-arm64" + } + }, + "esbuild_win32-x64": { + "repoRuleId": "@@aspect_rules_esbuild+//esbuild:repositories.bzl%esbuild_repositories", + "attributes": { + "esbuild_version": "0.19.9", + "integrity": "", + "platform": "win32-x64" + } + }, + "esbuild_toolchains": { + "repoRuleId": "@@aspect_rules_esbuild+//esbuild/private:toolchains_repo.bzl%toolchains_repo", + "attributes": { + "esbuild_version": "0.19.9", + "user_repository_name": "esbuild" + } + }, + "npm__esbuild_0.19.9": { + "repoRuleId": "@@aspect_rules_js+//npm/private:npm_import.bzl%npm_import_rule", + "attributes": { + "package": "esbuild", + "version": "0.19.9", + "root_package": "", + "link_workspace": "", + "link_packages": {}, + "integrity": "sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==", + "url": "", + "commit": "", + "patch_args": [ + "-p0" + ], + "patches": [], + "custom_postinstall": "", + "npm_auth": "", + "npm_auth_basic": "", + "npm_auth_username": "", + "npm_auth_password": "", + "lifecycle_hooks": [], + "extra_build_content": "", + "generate_bzl_library_targets": false, + "extract_full_archive": false, + "exclude_package_contents": [] + } + }, + "npm__esbuild_0.19.9__links": { + "repoRuleId": "@@aspect_rules_js+//npm/private:npm_import.bzl%npm_import_links", + "attributes": { + "package": "esbuild", + "version": "0.19.9", + "dev": false, + "root_package": "", + "link_packages": {}, + "deps": {}, + "transitive_closure": {}, + "lifecycle_build_target": false, + "lifecycle_hooks_env": [], + "lifecycle_hooks_execution_requirements": [ + "no-sandbox" + ], + "lifecycle_hooks_use_default_shell_env": false, + "bins": {}, + "package_visibility": [ + "//visibility:public" + ], + "replace_package": "", + "exclude_package_contents": [] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "aspect_bazel_lib+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_bazel_lib+", + "bazel_tools", + "bazel_tools" + ], + [ + "aspect_bazel_lib+", + "tar.bzl", + "tar.bzl+" + ], + [ + "aspect_rules_esbuild+", + "aspect_rules_js", + "aspect_rules_js+" + ], + [ + "aspect_rules_esbuild+", + "aspect_tools_telemetry_report", + "aspect_tools_telemetry++telemetry+aspect_tools_telemetry_report" + ], + [ + "aspect_rules_esbuild+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_rules_js+", + "aspect_bazel_lib", + "aspect_bazel_lib+" + ], + [ + "aspect_rules_js+", + "aspect_rules_js", + "aspect_rules_js+" + ], + [ + "aspect_rules_js+", + "aspect_tools_telemetry_report", + "aspect_tools_telemetry++telemetry+aspect_tools_telemetry_report" + ], + [ + "aspect_rules_js+", + "bazel_lib", + "bazel_lib+" + ], + [ + "aspect_rules_js+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_rules_js+", + "bazel_tools", + "bazel_tools" + ], + [ + "bazel_lib+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "bazel_lib+", + "bazel_tools", + "bazel_tools" + ], + [ + "tar.bzl+", + "bazel_lib", + "bazel_lib+" + ], + [ + "tar.bzl+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "tar.bzl+", + "tar.bzl", + "tar.bzl+" + ] + ] + } + }, + "@@aspect_rules_js+//npm:extensions.bzl%pnpm": { + "general": { + "bzlTransitiveDigest": "tQ+7EwLfQwqi/T4v5/N3NNHTmP6Wu/FqXxRDndEB2OU=", + "usagesDigest": "fkR8y929BQ1GFezNYBR/HXJUcMa3NtJvhzsZrG8I9vI=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "pnpm": { + "repoRuleId": "@@aspect_rules_js+//npm/private:npm_import.bzl%npm_import_rule", + "attributes": { + "package": "pnpm", + "version": "10.26.0", + "root_package": "", + "link_workspace": "", + "link_packages": {}, + "integrity": "sha512-Oz9scl6+cSUGwKsa1BM8+GsfS2h+/85iqbOLTXLjlUJC5kMZD8UfoWQpScc19APevUT1yw7dZXq+Y6i2p+HkAg==", + "url": "", + "commit": "", + "patch_args": [ + "-p0" + ], + "patches": [], + "custom_postinstall": "", + "npm_auth": "", + "npm_auth_basic": "", + "npm_auth_username": "", + "npm_auth_password": "", + "lifecycle_hooks": [], + "extra_build_content": "load(\"@aspect_rules_js//js:defs.bzl\", \"js_binary\")\njs_binary(name = \"pnpm\", data = glob([\"package/**\"]), entry_point = \"package/dist/pnpm.cjs\", visibility = [\"//visibility:public\"])", + "generate_bzl_library_targets": false, + "extract_full_archive": true, + "exclude_package_contents": [] + } + }, + "pnpm__links": { + "repoRuleId": "@@aspect_rules_js+//npm/private:npm_import.bzl%npm_import_links", + "attributes": { + "package": "pnpm", + "version": "10.26.0", + "dev": false, + "root_package": "", + "link_packages": {}, + "deps": {}, + "transitive_closure": {}, + "lifecycle_build_target": false, + "lifecycle_hooks_env": [], + "lifecycle_hooks_execution_requirements": [ + "no-sandbox" + ], + "lifecycle_hooks_use_default_shell_env": false, + "bins": {}, + "package_visibility": [ + "//visibility:public" + ], + "replace_package": "", + "exclude_package_contents": [] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "aspect_bazel_lib+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_bazel_lib+", + "bazel_tools", + "bazel_tools" + ], + [ + "aspect_bazel_lib+", + "tar.bzl", + "tar.bzl+" + ], + [ + "aspect_rules_js+", + "aspect_bazel_lib", + "aspect_bazel_lib+" + ], + [ + "aspect_rules_js+", + "aspect_rules_js", + "aspect_rules_js+" + ], + [ + "aspect_rules_js+", + "aspect_tools_telemetry_report", + "aspect_tools_telemetry++telemetry+aspect_tools_telemetry_report" + ], + [ + "aspect_rules_js+", + "bazel_features", + "bazel_features+" + ], + [ + "aspect_rules_js+", + "bazel_lib", + "bazel_lib+" + ], + [ + "aspect_rules_js+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_rules_js+", + "bazel_tools", + "bazel_tools" + ], + [ + "bazel_features+", + "bazel_features_globals", + "bazel_features++version_extension+bazel_features_globals" + ], + [ + "bazel_features+", + "bazel_features_version", + "bazel_features++version_extension+bazel_features_version" + ], + [ + "bazel_lib+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "bazel_lib+", + "bazel_tools", + "bazel_tools" + ], + [ + "tar.bzl+", + "bazel_lib", + "bazel_lib+" + ], + [ + "tar.bzl+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "tar.bzl+", + "tar.bzl", + "tar.bzl+" + ] + ] + } + }, + "@@aspect_rules_ts+//ts:extensions.bzl%ext": { + "general": { + "bzlTransitiveDigest": "7k3bewVApw4Kc6Rpho1Rrs1nrW/5jphUA5Mh1iHE2U4=", + "usagesDigest": "aaqqxEFKCRGFkeAf0pKmXvZZTLGYIk3pQsDFG28ZbNg=", + "recordedFileInputs": { + "@@rules_browsers+//package.json": "84dc1ba9b1c667a25894e97218bd8f247d54f24bb694efb397a881be3c06a4c5" + }, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "angular_cli_npm_typescript": { + "repoRuleId": "@@aspect_rules_ts+//ts/private:npm_repositories.bzl%http_archive_version", + "attributes": { + "version": "5.9.3", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "urls": [ + "https://registry.npmjs.org/typescript/-/typescript-{}.tgz" + ] + } + }, + "rules_angular_npm_typescript": { + "repoRuleId": "@@aspect_rules_ts+//ts/private:npm_repositories.bzl%http_archive_version", + "attributes": { + "version": "5.9.2", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "urls": [ + "https://registry.npmjs.org/typescript/-/typescript-{}.tgz" + ] + } }, - "local_config_apple_cc": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf", + "npm_typescript": { + "repoRuleId": "@@aspect_rules_ts+//ts/private:npm_repositories.bzl%http_archive_version", + "attributes": { + "version": "5.9.3", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "urls": [ + "https://registry.npmjs.org/typescript/-/typescript-{}.tgz" + ] + } + }, + "npm_rules_browsers_typescript": { + "repoRuleId": "@@aspect_rules_ts+//ts/private:npm_repositories.bzl%http_archive_version", + "attributes": { + "version": "", + "version_from": "@@rules_browsers+//:package.json", + "integrity": "", + "urls": [ + "https://registry.npmjs.org/typescript/-/typescript-{}.tgz" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "aspect_rules_ts+", + "aspect_rules_ts", + "aspect_rules_ts+" + ], + [ + "aspect_rules_ts+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@aspect_tools_telemetry+//:extension.bzl%telemetry": { + "general": { + "bzlTransitiveDigest": "cl5A2O84vDL6Tt+Qga8FCj1DUDGqn+e7ly5rZ+4xvcc=", + "usagesDigest": "jHASCmhI+ziv94KZ5hlx6t1ixFDdVXFm2VnOVVbAqww=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "aspect_tools_telemetry_report": { + "repoRuleId": "@@aspect_tools_telemetry+//:extension.bzl%tel_repository", + "attributes": { + "deps": { + "aspect_rules_js": "2.8.3", + "aspect_rules_ts": "3.8.1", + "aspect_rules_esbuild": "0.25.0", + "aspect_rules_jasmine": "2.0.2", + "aspect_tools_telemetry": "0.3.3" + } + } + } + }, + "recordedRepoMappingEntries": [ + [ + "aspect_tools_telemetry+", + "bazel_lib", + "bazel_lib+" + ], + [ + "aspect_tools_telemetry+", + "bazel_skylib", + "bazel_skylib+" + ] + ] + } + }, + "@@pybind11_bazel+//:python_configure.bzl%extension": { + "general": { + "bzlTransitiveDigest": "c9ZWWeXeu6bctL4/SsY2otFWyeFN0JJ20+ymGyJZtWk=", + "usagesDigest": "fycyB39YnXIJkfWCIXLUKJMZzANcuLy9ZE73hRucjFk=", + "recordedFileInputs": { + "@@pybind11_bazel+//MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e" + }, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_python": { + "repoRuleId": "@@pybind11_bazel+//:python_configure.bzl%python_configure", "attributes": {} + }, + "pybind11": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@pybind11_bazel+//:pybind11.BUILD", + "strip_prefix": "pybind11-2.11.1", + "urls": [ + "https://github.com/pybind/pybind11/archive/v2.11.1.zip" + ] + } } }, "recordedRepoMappingEntries": [ [ - "apple_support~", + "pybind11_bazel+", "bazel_tools", "bazel_tools" ] ] } }, - "@@platforms//host:extension.bzl%host_platform": { + "@@rules_angular+//setup:extensions.bzl%rules_angular": { + "general": { + "bzlTransitiveDigest": "fkaH7HMicL3g7/NDaFzlq39kcLopMyQ3KdbDn+5CRzA=", + "usagesDigest": "ZinuLP7QHxaW5achD0Vz19qElMu4r2LvGvh96Z5zYlA=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "components_rules_angular_configurable_deps": { + "repoRuleId": "@@rules_angular+//setup:repositories.bzl%configurable_deps_repo", + "attributes": { + "angular_compiler_cli": "@@rules_angular+//:node_modules/@angular/compiler-cli", + "typescript": "@@rules_angular+//:node_modules/typescript" + } + }, + "rules_angular_configurable_deps": { + "repoRuleId": "@@rules_angular+//setup:repositories.bzl%configurable_deps_repo", + "attributes": { + "angular_compiler_cli": "@@rules_angular+//:node_modules/@angular/compiler-cli", + "typescript": "@@rules_angular+//:node_modules/typescript-local" + } + }, + "dev_infra_rules_angular_configurable_deps": { + "repoRuleId": "@@rules_angular+//setup:repositories.bzl%configurable_deps_repo", + "attributes": { + "angular_compiler_cli": "@@rules_angular+//:node_modules/@angular/compiler-cli", + "typescript": "@@rules_angular+//:node_modules/typescript" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_browsers+//browsers:extensions.bzl%browsers": { + "general": { + "bzlTransitiveDigest": "ljZlVgWkQJnI6EvlHVfYit2EttUE52gDTbvmota5YO8=", + "usagesDigest": "FS7q5WaIwg3KirS3njhuPFkTIBYvDaTInVGrlzu0XL8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rules_browsers_chrome_linux": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "1419fa328bd7ea2697f26412ec693867516e4ef23c32eb13143a0b0b179b604b", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/linux64/chrome-headless-shell-linux64.zip" + ], + "named_files": { + "CHROME-HEADLESS-SHELL": "chrome-headless-shell-linux64/chrome-headless-shell" + }, + "exclude_patterns": [ + "**/*.log" + ], + "exports_files": [ + "chrome-headless-shell-linux64/chrome-headless-shell" + ] + } + }, + "rules_browsers_chrome_mac": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "792cbf9b77219b4476e41c49647bcd15e55f0988002fa1e4e6a720eb430c7eda", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/mac-x64/chrome-headless-shell-mac-x64.zip" + ], + "named_files": { + "CHROME-HEADLESS-SHELL": "chrome-headless-shell-mac-x64/chrome-headless-shell" + }, + "exclude_patterns": [ + "**/*.log" + ], + "exports_files": [ + "chrome-headless-shell-mac-x64/chrome-headless-shell" + ] + } + }, + "rules_browsers_chrome_mac_arm": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "f0c1917769775e826dfa69936381d0d95b06fe67cf631ecd842380d5de0e4c7f", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/mac-arm64/chrome-headless-shell-mac-arm64.zip" + ], + "named_files": { + "CHROME-HEADLESS-SHELL": "chrome-headless-shell-mac-arm64/chrome-headless-shell" + }, + "exclude_patterns": [ + "**/*.log" + ], + "exports_files": [ + "chrome-headless-shell-mac-arm64/chrome-headless-shell" + ] + } + }, + "rules_browsers_chrome_win64": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "6ce0f20dd743a804890f45f5349370e1aa7cd3ac3482c04686fcff5fafd01bb3", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/win64/chrome-headless-shell-win64.zip" + ], + "named_files": { + "CHROME-HEADLESS-SHELL": "chrome-headless-shell-win64/chrome-headless-shell.exe" + }, + "exclude_patterns": [ + "**/*.log" + ], + "exports_files": [ + "chrome-headless-shell-win64/chrome-headless-shell.exe" + ] + } + }, + "rules_browsers_chromedriver_linux": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "baf4bf9d22881265487732f17d35a49e9aadd0837aa5c1c1eea520c8aa24a97f", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/linux64/chromedriver-linux64.zip" + ], + "named_files": { + "CHROMEDRIVER": "chromedriver-linux64/chromedriver" + }, + "exclude_patterns": [], + "exports_files": [ + "chromedriver-linux64/chromedriver" + ] + } + }, + "rules_browsers_chromedriver_mac": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "87560768d5aa203b37c0a1b8459a35b05e4ece54afee2df530f3bc33de4f63c5", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/mac-x64/chromedriver-mac-x64.zip" + ], + "named_files": { + "CHROMEDRIVER": "chromedriver-mac-x64/chromedriver" + }, + "exclude_patterns": [], + "exports_files": [ + "chromedriver-mac-x64/chromedriver" + ] + } + }, + "rules_browsers_chromedriver_mac_arm": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "99821795fa7c87eb92fb15248e23b237c83f397486d22ad9a10771622c36a5a0", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/mac-arm64/chromedriver-mac-arm64.zip" + ], + "named_files": { + "CHROMEDRIVER": "chromedriver-mac-arm64/chromedriver" + }, + "exclude_patterns": [], + "exports_files": [ + "chromedriver-mac-arm64/chromedriver" + ] + } + }, + "rules_browsers_chromedriver_win64": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "6e180e234a710c3cbf69566f64a662ed85473db6ae82275fd359f80ab288df99", + "urls": [ + "https://storage.googleapis.com/chrome-for-testing-public/144.0.7531.0/win64/chromedriver-win64.zip" + ], + "named_files": { + "CHROMEDRIVER": "chromedriver-win64/chromedriver.exe" + }, + "exclude_patterns": [], + "exports_files": [ + "chromedriver-win64/chromedriver.exe" + ] + } + }, + "rules_browsers_firefox_linux": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "00fb922cda6bab971e02bcbfb77923b0a234388ed7d77c23506ca0a1a61d4a86", + "urls": [ + "https://archive.mozilla.org/pub/firefox/releases/145.0/linux-x86_64/en-US/firefox-145.0.tar.xz" + ], + "named_files": { + "FIREFOX": "firefox/firefox" + }, + "exclude_patterns": [], + "exports_files": [ + "firefox/firefox" + ] + } + }, + "rules_browsers_firefox_mac": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "1c4556480deac8424049f3081a6de1e2c6de619bab3e8ce53e5a497b8d6d919e", + "urls": [ + "https://archive.mozilla.org/pub/firefox/releases/145.0/mac/en-US/Firefox%20145.0.dmg" + ], + "named_files": { + "FIREFOX": "Firefox.app/Contents/MacOS/firefox" + }, + "exclude_patterns": [], + "exports_files": [ + "Firefox.app/Contents/MacOS/firefox" + ] + } + }, + "rules_browsers_firefox_mac_arm": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "1c4556480deac8424049f3081a6de1e2c6de619bab3e8ce53e5a497b8d6d919e", + "urls": [ + "https://archive.mozilla.org/pub/firefox/releases/145.0/mac/en-US/Firefox%20145.0.dmg" + ], + "named_files": { + "FIREFOX": "Firefox.app/Contents/MacOS/firefox" + }, + "exclude_patterns": [], + "exports_files": [ + "Firefox.app/Contents/MacOS/firefox" + ] + } + }, + "rules_browsers_firefox_win64": { + "repoRuleId": "@@rules_browsers+//browsers/private:browser_repo.bzl%browser_repo", + "attributes": { + "sha256": "4b0345c113242653d923b369fcbd48e3089c57658f8c1542f887c8a375d50306", + "urls": [ + "https://archive.mozilla.org/pub/firefox/releases/145.0/win64/en-US/Firefox%20Setup%20145.0.exe" + ], + "named_files": { + "FIREFOX": "core/firefox.exe" + }, + "exclude_patterns": [], + "exports_files": [ + "core/firefox.exe" + ] + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_fuzzing+//fuzzing/private:extensions.bzl%non_module_dependencies": { "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "pCYpDQmqMbmiiPI1p2Kd3VLm5T48rRAht5WdW0X2GlA=", + "bzlTransitiveDigest": "WHRlQQnxW7e7XMRBhq7SARkDarLDOAbg6iLaJpk5QYM=", + "usagesDigest": "wy6ISK6UOcBEjj/mvJ/S3WeXoO67X+1llb9yPyFtPgc=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "host_platform": { - "bzlFile": "@@platforms//host:extension.bzl", - "ruleClassName": "host_platform_repo", + "platforms": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz" + ], + "sha256": "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74" + } + }, + "rules_python": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "d70cd72a7a4880f0000a6346253414825c19cdd40a28289bdf67b8e6480edff8", + "strip_prefix": "rules_python-0.28.0", + "url": "https://github.com/bazelbuild/rules_python/releases/download/0.28.0/rules_python-0.28.0.tar.gz" + } + }, + "bazel_skylib": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz" + ] + } + }, + "com_google_absl": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.zip" + ], + "strip_prefix": "abseil-cpp-20240116.1", + "integrity": "sha256-7capMWOvWyoYbUaHF/b+I2U6XLMaHmky8KugWvfXYuk=" + } + }, + "rules_fuzzing_oss_fuzz": { + "repoRuleId": "@@rules_fuzzing+//fuzzing/private/oss_fuzz:repository.bzl%oss_fuzz_repository", "attributes": {} + }, + "honggfuzz": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@rules_fuzzing+//:honggfuzz.BUILD", + "sha256": "6b18ba13bc1f36b7b950c72d80f19ea67fbadc0ac0bb297ec89ad91f2eaa423e", + "url": "https://github.com/google/honggfuzz/archive/2.5.zip", + "strip_prefix": "honggfuzz-2.5" + } + }, + "rules_fuzzing_jazzer": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar", + "attributes": { + "sha256": "ee6feb569d88962d59cb59e8a31eb9d007c82683f3ebc64955fd5b96f277eec2", + "url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.20.1/jazzer-0.20.1.jar" + } + }, + "rules_fuzzing_jazzer_api": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar", + "attributes": { + "sha256": "f5a60242bc408f7fa20fccf10d6c5c5ea1fcb3c6f44642fec5af88373ae7aa1b", + "url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.20.1/jazzer-api-0.20.1.jar" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_fuzzing+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "rL/34P1aFDq2GqVC2zCFgQ8nTuOC6ziogocpvG50Qz8=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_kotlin+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_nodejs+//nodejs:extensions.bzl%node": { + "general": { + "bzlTransitiveDigest": "NwcLXHrbh2hoorA/Ybmcpjxsn/6avQmewDglodkDrgo=", + "usagesDigest": "S8pbOD3W4rSYjK/dNi5FSVLmT25mLbwVs9g/9fC2SN8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "nodejs_linux_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "linux_amd64" + } + }, + "nodejs_linux_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "linux_arm64" + } + }, + "nodejs_linux_s390x": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "linux_s390x" + } + }, + "nodejs_linux_ppc64le": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "linux_ppc64le" + } + }, + "nodejs_darwin_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "darwin_amd64" + } + }, + "nodejs_darwin_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "darwin_arm64" + } + }, + "nodejs_windows_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "windows_amd64" + } + }, + "nodejs_windows_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.5", + "node_version_from_nvmrc": "@@//:.nvmrc", + "include_headers": false, + "platform": "windows_arm64" + } + }, + "nodejs": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_host": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_toolchains": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl%nodejs_toolchains_repo", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "node20_linux_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "linux_amd64" + } + }, + "node20_linux_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "linux_arm64" + } + }, + "node20_linux_s390x": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "linux_s390x" + } + }, + "node20_linux_ppc64le": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "linux_ppc64le" + } + }, + "node20_darwin_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "darwin_amd64" + } + }, + "node20_darwin_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "darwin_arm64" + } + }, + "node20_windows_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "windows_amd64" + } + }, + "node20_windows_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "20.19.0", + "include_headers": false, + "platform": "windows_arm64" + } + }, + "node20": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "node20" + } + }, + "node20_host": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "node20" + } + }, + "node20_toolchains": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl%nodejs_toolchains_repo", + "attributes": { + "user_node_repository_name": "node20" + } + }, + "node22_linux_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "linux_amd64" + } + }, + "node22_linux_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "linux_arm64" + } + }, + "node22_linux_s390x": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "linux_s390x" + } + }, + "node22_linux_ppc64le": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "linux_ppc64le" + } + }, + "node22_darwin_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "darwin_amd64" + } + }, + "node22_darwin_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "darwin_arm64" + } + }, + "node22_windows_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "windows_amd64" + } + }, + "node22_windows_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "22.12.0", + "include_headers": false, + "platform": "windows_arm64" + } + }, + "node22": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "node22" + } + }, + "node22_host": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "node22" + } + }, + "node22_toolchains": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl%nodejs_toolchains_repo", + "attributes": { + "user_node_repository_name": "node22" + } + }, + "node24_linux_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "linux_amd64" + } + }, + "node24_linux_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "linux_arm64" + } + }, + "node24_linux_s390x": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "linux_s390x" + } + }, + "node24_linux_ppc64le": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "linux_ppc64le" + } + }, + "node24_darwin_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "darwin_amd64" + } + }, + "node24_darwin_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "darwin_arm64" + } + }, + "node24_windows_amd64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "windows_amd64" + } + }, + "node24_windows_arm64": { + "repoRuleId": "@@rules_nodejs+//nodejs:repositories.bzl%_nodejs_repositories", + "attributes": { + "node_download_auth": {}, + "node_repositories": {}, + "node_urls": [ + "https://nodejs.org/dist/v{version}/{filename}" + ], + "node_version": "24.0.0", + "include_headers": false, + "platform": "windows_arm64" + } + }, + "node24": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "node24" + } + }, + "node24_host": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_repo_host_os_alias.bzl%nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "node24" + } + }, + "node24_toolchains": { + "repoRuleId": "@@rules_nodejs+//nodejs/private:nodejs_toolchains_repo.bzl%nodejs_toolchains_repo", + "attributes": { + "user_node_repository_name": "node24" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_python+//python/extensions:pip.bzl%pip": { + "general": { + "bzlTransitiveDigest": "39J6fxZx6VyebAMZs6LDsQSGw91SROMECqQx77bSJqE=", + "usagesDigest": "AK1R124YPWwAs8z1CQYyjYuci8RO5Ofot+EP5ZCNQDc=", + "recordedFileInputs": { + "@@protobuf+//python/requirements.txt": "983be60d3cec4b319dcab6d48aeb3f5b2f7c3350f26b3a9e97486c37967c73c5", + "@@rules_fuzzing+//fuzzing/requirements.txt": "ab04664be026b632a0d2a2446c4f65982b7654f5b6851d2f9d399a19b7242a5b", + "@@rules_python+//tools/publish/requirements_darwin.txt": "2994136eab7e57b083c3de76faf46f70fad130bc8e7360a7fed2b288b69e79dc", + "@@rules_python+//tools/publish/requirements_linux.txt": "8175b4c8df50ae2f22d1706961884beeb54e7da27bd2447018314a175981997d", + "@@rules_python+//tools/publish/requirements_windows.txt": "7673adc71dc1a81d3661b90924d7a7c0fc998cd508b3cb4174337cef3f2de556" + }, + "recordedDirentsInputs": {}, + "envVariables": { + "RULES_PYTHON_REPO_DEBUG": null, + "RULES_PYTHON_REPO_DEBUG_VERBOSITY": null + }, + "generatedRepoSpecs": { + "pip_deps_310_numpy": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_10_host//:python", + "repo": "pip_deps_310", + "requirement": "numpy<=1.26.1" + } + }, + "pip_deps_310_setuptools": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_10_host//:python", + "repo": "pip_deps_310", + "requirement": "setuptools<=70.3.0" + } + }, + "pip_deps_311_numpy": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "pip_deps_311", + "requirement": "numpy<=1.26.1" + } + }, + "pip_deps_311_setuptools": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "pip_deps_311", + "requirement": "setuptools<=70.3.0" + } + }, + "pip_deps_312_numpy": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_12_host//:python", + "repo": "pip_deps_312", + "requirement": "numpy<=1.26.1" + } + }, + "pip_deps_312_setuptools": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_12_host//:python", + "repo": "pip_deps_312", + "requirement": "setuptools<=70.3.0" + } + }, + "pip_deps_38_numpy": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_8_host//:python", + "repo": "pip_deps_38", + "requirement": "numpy<=1.26.1" + } + }, + "pip_deps_38_setuptools": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_8_host//:python", + "repo": "pip_deps_38", + "requirement": "setuptools<=70.3.0" + } + }, + "pip_deps_39_numpy": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_9_host//:python", + "repo": "pip_deps_39", + "requirement": "numpy<=1.26.1" + } + }, + "pip_deps_39_setuptools": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@pip_deps//{name}:{target}", + "python_interpreter_target": "@@rules_python++python+python_3_9_host//:python", + "repo": "pip_deps_39", + "requirement": "setuptools<=70.3.0" + } + }, + "rules_fuzzing_py_deps_310_absl_py": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_10_host//:python", + "repo": "rules_fuzzing_py_deps_310", + "requirement": "absl-py==2.0.0 --hash=sha256:9a28abb62774ae4e8edbe2dd4c49ffcd45a6a848952a5eccc6a49f3f0fc1e2f3" + } + }, + "rules_fuzzing_py_deps_310_six": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_10_host//:python", + "repo": "rules_fuzzing_py_deps_310", + "requirement": "six==1.16.0 --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + } + }, + "rules_fuzzing_py_deps_311_absl_py": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_fuzzing_py_deps_311", + "requirement": "absl-py==2.0.0 --hash=sha256:9a28abb62774ae4e8edbe2dd4c49ffcd45a6a848952a5eccc6a49f3f0fc1e2f3" + } + }, + "rules_fuzzing_py_deps_311_six": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_fuzzing_py_deps_311", + "requirement": "six==1.16.0 --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + } + }, + "rules_fuzzing_py_deps_312_absl_py": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_12_host//:python", + "repo": "rules_fuzzing_py_deps_312", + "requirement": "absl-py==2.0.0 --hash=sha256:9a28abb62774ae4e8edbe2dd4c49ffcd45a6a848952a5eccc6a49f3f0fc1e2f3" + } + }, + "rules_fuzzing_py_deps_312_six": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_12_host//:python", + "repo": "rules_fuzzing_py_deps_312", + "requirement": "six==1.16.0 --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + } + }, + "rules_fuzzing_py_deps_38_absl_py": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_8_host//:python", + "repo": "rules_fuzzing_py_deps_38", + "requirement": "absl-py==2.0.0 --hash=sha256:9a28abb62774ae4e8edbe2dd4c49ffcd45a6a848952a5eccc6a49f3f0fc1e2f3" + } + }, + "rules_fuzzing_py_deps_38_six": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_8_host//:python", + "repo": "rules_fuzzing_py_deps_38", + "requirement": "six==1.16.0 --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + } + }, + "rules_fuzzing_py_deps_39_absl_py": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_9_host//:python", + "repo": "rules_fuzzing_py_deps_39", + "requirement": "absl-py==2.0.0 --hash=sha256:9a28abb62774ae4e8edbe2dd4c49ffcd45a6a848952a5eccc6a49f3f0fc1e2f3" + } + }, + "rules_fuzzing_py_deps_39_six": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_fuzzing_py_deps//{name}:{target}", + "extra_pip_args": [ + "--require-hashes" + ], + "python_interpreter_target": "@@rules_python++python+python_3_9_host//:python", + "repo": "rules_fuzzing_py_deps_39", + "requirement": "six==1.16.0 --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + } + }, + "rules_python_publish_deps_311_backports_tarfile_py3_none_any_77e284d7": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "backports.tarfile-1.2.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "backports-tarfile==1.2.0", + "sha256": "77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", + "urls": [ + "https://files.pythonhosted.org/packages/b9/fa/123043af240e49752f1c4bd24da5053b6bd00cad78c2be53c0d1e8b975bc/backports.tarfile-1.2.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_backports_tarfile_sdist_d75e02c2": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "backports_tarfile-1.2.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "backports-tarfile==1.2.0", + "sha256": "d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991", + "urls": [ + "https://files.pythonhosted.org/packages/86/72/cd9b395f25e290e633655a100af28cb253e4393396264a98bd5f5951d50f/backports_tarfile-1.2.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_certifi_py3_none_any_922820b5": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "certifi-2024.8.30-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "certifi==2024.8.30", + "sha256": "922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8", + "urls": [ + "https://files.pythonhosted.org/packages/12/90/3c9ff0512038035f59d279fddeb79f5f1eccd8859f06d6163c58798b9487/certifi-2024.8.30-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_certifi_sdist_bec941d2": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "certifi-2024.8.30.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "certifi==2024.8.30", + "sha256": "bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9", + "urls": [ + "https://files.pythonhosted.org/packages/b0/ee/9b19140fe824b367c04c5e1b369942dd754c4c5462d5674002f75c4dedc1/certifi-2024.8.30.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_aarch64_a1ed2dd2": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41", + "urls": [ + "https://files.pythonhosted.org/packages/2e/ea/70ce63780f096e16ce8588efe039d3c4f91deb1dc01e9c73a287939c79a6/cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_ppc64le_46bf4316": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1", + "urls": [ + "https://files.pythonhosted.org/packages/1c/a0/a4fa9f4f781bda074c3ddd57a572b060fa0df7655d2a4247bbe277200146/cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_s390x_a24ed04c": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6", + "urls": [ + "https://files.pythonhosted.org/packages/62/12/ce8710b5b8affbcdd5c6e367217c242524ad17a02fe5beec3ee339f69f85/cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_x86_64_610faea7": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d", + "urls": [ + "https://files.pythonhosted.org/packages/ff/6b/d45873c5e0242196f042d555526f92aa9e0c32355a1be1ff8c27f077fd37/cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_musllinux_1_1_aarch64_a9b15d49": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6", + "urls": [ + "https://files.pythonhosted.org/packages/1a/52/d9a0e523a572fbccf2955f5abe883cfa8bcc570d7faeee06336fbd50c9fc/cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_musllinux_1_1_x86_64_fc48c783": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b", + "urls": [ + "https://files.pythonhosted.org/packages/f8/4a/34599cac7dfcd888ff54e801afe06a19c17787dfd94495ab0c8d35fe99fb/cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_sdist_1c39c601": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "cffi-1.17.1.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.17.1", + "sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824", + "urls": [ + "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_universal2_0d99dd8f": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c", + "urls": [ + "https://files.pythonhosted.org/packages/9c/61/73589dcc7a719582bf56aae309b6103d2762b526bffe189d635a7fcfd998/charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_x86_64_c57516e5": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944", + "urls": [ + "https://files.pythonhosted.org/packages/77/d5/8c982d58144de49f59571f940e329ad6e8615e1e82ef84584c5eeb5e1d72/charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_11_0_arm64_6dba5d19": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee", + "urls": [ + "https://files.pythonhosted.org/packages/bf/19/411a64f01ee971bed3231111b69eb56f9331a769072de479eae7de52296d/charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_aarch64_bf4475b8": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c", + "urls": [ + "https://files.pythonhosted.org/packages/4c/92/97509850f0d00e9f14a46bc751daabd0ad7765cff29cdfb66c68b6dad57f/charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_ppc64le_ce031db0": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6", + "urls": [ + "https://files.pythonhosted.org/packages/e2/29/d227805bff72ed6d6cb1ce08eec707f7cfbd9868044893617eb331f16295/charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_s390x_8ff4e7cd": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea", + "urls": [ + "https://files.pythonhosted.org/packages/13/bc/87c2c9f2c144bedfa62f894c3007cd4530ba4b5351acb10dc786428a50f0/charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_x86_64_3710a975": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc", + "urls": [ + "https://files.pythonhosted.org/packages/eb/5b/6f10bad0f6461fa272bfbbdf5d0023b5fb9bc6217c92bf068fa5a99820f5/charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_aarch64_47334db7": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594", + "urls": [ + "https://files.pythonhosted.org/packages/d7/a1/493919799446464ed0299c8eef3c3fad0daf1c3cd48bff9263c731b0d9e2/charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_ppc64le_f1a2f519": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365", + "urls": [ + "https://files.pythonhosted.org/packages/75/d2/0ab54463d3410709c09266dfb416d032a08f97fd7d60e94b8c6ef54ae14b/charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_s390x_63bc5c4a": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129", + "urls": [ + "https://files.pythonhosted.org/packages/8d/c9/27e41d481557be53d51e60750b85aa40eaf52b841946b3cdeff363105737/charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_x86_64_bcb4f8ea": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236", + "urls": [ + "https://files.pythonhosted.org/packages/ee/44/4f62042ca8cdc0cabf87c0fc00ae27cd8b53ab68be3605ba6d071f742ad3/charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_win_amd64_cee4373f": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27", + "urls": [ + "https://files.pythonhosted.org/packages/0b/6e/b13bd47fa9023b3699e94abf565b5a2f0b0be6e9ddac9812182596ee62e4/charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_py3_none_any_fe9f97fe": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "charset_normalizer-3.4.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079", + "urls": [ + "https://files.pythonhosted.org/packages/bf/9b/08c0432272d77b04803958a4598a51e2a4b51c06640af8b8f0f908c18bf2/charset_normalizer-3.4.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_sdist_223217c3": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "charset_normalizer-3.4.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.4.0", + "sha256": "223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e", + "urls": [ + "https://files.pythonhosted.org/packages/f2/4f/e1808dc01273379acc506d18f1504eb2d299bd4131743b9fc54d7be4df1e/charset_normalizer-3.4.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_17_aarch64_846da004": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5", + "urls": [ + "https://files.pythonhosted.org/packages/2f/78/55356eb9075d0be6e81b59f45c7b48df87f76a20e73893872170471f3ee8/cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_17_x86_64_0f996e72": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4", + "urls": [ + "https://files.pythonhosted.org/packages/2a/2c/488776a3dc843f95f86d2f957ca0fc3407d0242b50bede7fad1e339be03f/cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_28_aarch64_f7b178f1": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7", + "urls": [ + "https://files.pythonhosted.org/packages/7c/04/2345ca92f7a22f601a9c62961741ef7dd0127c39f7310dffa0041c80f16f/cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_28_x86_64_c2e6fc39": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405", + "urls": [ + "https://files.pythonhosted.org/packages/ac/25/e715fa0bc24ac2114ed69da33adf451a38abb6f3f24ec207908112e9ba53/cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp39_abi3_musllinux_1_2_aarch64_e1be4655": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16", + "urls": [ + "https://files.pythonhosted.org/packages/21/ce/b9c9ff56c7164d8e2edfb6c9305045fbc0df4508ccfdb13ee66eb8c95b0e/cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp39_abi3_musllinux_1_2_x86_64_df6b6c6d": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73", + "urls": [ + "https://files.pythonhosted.org/packages/2a/33/b3682992ab2e9476b9c81fff22f02c8b0a1e6e1d49ee1750a67d85fd7ed2/cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_sdist_315b9001": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "cryptography-43.0.3.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==43.0.3", + "sha256": "315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805", + "urls": [ + "https://files.pythonhosted.org/packages/0d/05/07b55d1fa21ac18c3a8c79f764e2514e6f6a9698f1be44994f5adf0d29db/cryptography-43.0.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_docutils_py3_none_any_dafca5b9": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "docutils-0.21.2-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "docutils==0.21.2", + "sha256": "dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2", + "urls": [ + "https://files.pythonhosted.org/packages/8f/d7/9322c609343d929e75e7e5e6255e614fcc67572cfd083959cdef3b7aad79/docutils-0.21.2-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_docutils_sdist_3a6b1873": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "docutils-0.21.2.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "docutils==0.21.2", + "sha256": "3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f", + "urls": [ + "https://files.pythonhosted.org/packages/ae/ed/aefcc8cd0ba62a0560c3c18c33925362d46c6075480bfa4df87b28e169a9/docutils-0.21.2.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_idna_py3_none_any_946d195a": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "idna-3.10-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "idna==3.10", + "sha256": "946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", + "urls": [ + "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_idna_sdist_12f65c9b": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "idna-3.10.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "idna==3.10", + "sha256": "12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", + "urls": [ + "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_importlib_metadata_py3_none_any_45e54197": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "importlib_metadata-8.5.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "importlib-metadata==8.5.0", + "sha256": "45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b", + "urls": [ + "https://files.pythonhosted.org/packages/a0/d9/a1e041c5e7caa9a05c925f4bdbdfb7f006d1f74996af53467bc394c97be7/importlib_metadata-8.5.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_importlib_metadata_sdist_71522656": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "importlib_metadata-8.5.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "importlib-metadata==8.5.0", + "sha256": "71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7", + "urls": [ + "https://files.pythonhosted.org/packages/cd/12/33e59336dca5be0c398a7482335911a33aa0e20776128f038019f1a95f1b/importlib_metadata-8.5.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_jaraco_classes_py3_none_any_f662826b": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "jaraco.classes-3.4.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-classes==3.4.0", + "sha256": "f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790", + "urls": [ + "https://files.pythonhosted.org/packages/7f/66/b15ce62552d84bbfcec9a4873ab79d993a1dd4edb922cbfccae192bd5b5f/jaraco.classes-3.4.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_jaraco_classes_sdist_47a024b5": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "jaraco.classes-3.4.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-classes==3.4.0", + "sha256": "47a024b51d0239c0dd8c8540c6c7f484be3b8fcf0b2d85c13825780d3b3f3acd", + "urls": [ + "https://files.pythonhosted.org/packages/06/c0/ed4a27bc5571b99e3cff68f8a9fa5b56ff7df1c2251cc715a652ddd26402/jaraco.classes-3.4.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_jaraco_context_py3_none_any_f797fc48": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "jaraco.context-6.0.1-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-context==6.0.1", + "sha256": "f797fc481b490edb305122c9181830a3a5b76d84ef6d1aef2fb9b47ab956f9e4", + "urls": [ + "https://files.pythonhosted.org/packages/ff/db/0c52c4cf5e4bd9f5d7135ec7669a3a767af21b3a308e1ed3674881e52b62/jaraco.context-6.0.1-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_jaraco_context_sdist_9bae4ea5": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "jaraco_context-6.0.1.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-context==6.0.1", + "sha256": "9bae4ea555cf0b14938dc0aee7c9f32ed303aa20a3b73e7dc80111628792d1b3", + "urls": [ + "https://files.pythonhosted.org/packages/df/ad/f3777b81bf0b6e7bc7514a1656d3e637b2e8e15fab2ce3235730b3e7a4e6/jaraco_context-6.0.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_jaraco_functools_py3_none_any_ad159f13": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "jaraco.functools-4.1.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-functools==4.1.0", + "sha256": "ad159f13428bc4acbf5541ad6dec511f91573b90fba04df61dafa2a1231cf649", + "urls": [ + "https://files.pythonhosted.org/packages/9f/4f/24b319316142c44283d7540e76c7b5a6dbd5db623abd86bb7b3491c21018/jaraco.functools-4.1.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_jaraco_functools_sdist_70f7e0e2": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "jaraco_functools-4.1.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-functools==4.1.0", + "sha256": "70f7e0e2ae076498e212562325e805204fc092d7b4c17e0e86c959e249701a9d", + "urls": [ + "https://files.pythonhosted.org/packages/ab/23/9894b3df5d0a6eb44611c36aec777823fc2e07740dabbd0b810e19594013/jaraco_functools-4.1.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_jeepney_py3_none_any_c0a454ad": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "jeepney-0.8.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jeepney==0.8.0", + "sha256": "c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755", + "urls": [ + "https://files.pythonhosted.org/packages/ae/72/2a1e2290f1ab1e06f71f3d0f1646c9e4634e70e1d37491535e19266e8dc9/jeepney-0.8.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_jeepney_sdist_5efe48d2": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "jeepney-0.8.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "jeepney==0.8.0", + "sha256": "5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806", + "urls": [ + "https://files.pythonhosted.org/packages/d6/f4/154cf374c2daf2020e05c3c6a03c91348d59b23c5366e968feb198306fdf/jeepney-0.8.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_keyring_py3_none_any_5426f817": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "keyring-25.4.1-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "keyring==25.4.1", + "sha256": "5426f817cf7f6f007ba5ec722b1bcad95a75b27d780343772ad76b17cb47b0bf", + "urls": [ + "https://files.pythonhosted.org/packages/83/25/e6d59e5f0a0508d0dca8bb98c7f7fd3772fc943ac3f53d5ab18a218d32c0/keyring-25.4.1-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_keyring_sdist_b07ebc55": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "keyring-25.4.1.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "keyring==25.4.1", + "sha256": "b07ebc55f3e8ed86ac81dd31ef14e81ace9dd9c3d4b5d77a6e9a2016d0d71a1b", + "urls": [ + "https://files.pythonhosted.org/packages/a5/1c/2bdbcfd5d59dc6274ffb175bc29aa07ecbfab196830e0cfbde7bd861a2ea/keyring-25.4.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_markdown_it_py_py3_none_any_35521684": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "markdown_it_py-3.0.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "markdown-it-py==3.0.0", + "sha256": "355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", + "urls": [ + "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_markdown_it_py_sdist_e3f60a94": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "markdown-it-py-3.0.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "markdown-it-py==3.0.0", + "sha256": "e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", + "urls": [ + "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_mdurl_py3_none_any_84008a41": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "mdurl-0.1.2-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "mdurl==0.1.2", + "sha256": "84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", + "urls": [ + "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_mdurl_sdist_bb413d29": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "mdurl-0.1.2.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "mdurl==0.1.2", + "sha256": "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", + "urls": [ + "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_more_itertools_py3_none_any_037b0d32": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "more_itertools-10.5.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "more-itertools==10.5.0", + "sha256": "037b0d3203ce90cca8ab1defbbdac29d5f993fc20131f3664dc8d6acfa872aef", + "urls": [ + "https://files.pythonhosted.org/packages/48/7e/3a64597054a70f7c86eb0a7d4fc315b8c1ab932f64883a297bdffeb5f967/more_itertools-10.5.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_more_itertools_sdist_5482bfef": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "more-itertools-10.5.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "more-itertools==10.5.0", + "sha256": "5482bfef7849c25dc3c6dd53a6173ae4795da2a41a80faea6700d9f5846c5da6", + "urls": [ + "https://files.pythonhosted.org/packages/51/78/65922308c4248e0eb08ebcbe67c95d48615cc6f27854b6f2e57143e9178f/more-itertools-10.5.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_macosx_10_12_x86_64_14c5a72e": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "14c5a72e9fe82aea5fe3072116ad4661af5cf8e8ff8fc5ad3450f123e4925e86", + "urls": [ + "https://files.pythonhosted.org/packages/b3/89/1daff5d9ba5a95a157c092c7c5f39b8dd2b1ddb4559966f808d31cfb67e0/nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_macosx_10_12_x86_64_7b7c2a3c": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "7b7c2a3c9eb1a827d42539aa64091640bd275b81e097cd1d8d82ef91ffa2e811", + "urls": [ + "https://files.pythonhosted.org/packages/2c/b6/42fc3c69cabf86b6b81e4c051a9b6e249c5ba9f8155590222c2622961f58/nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_aarch64_42c64511": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "42c64511469005058cd17cc1537578eac40ae9f7200bedcfd1fc1a05f4f8c200", + "urls": [ + "https://files.pythonhosted.org/packages/45/b9/833f385403abaf0023c6547389ec7a7acf141ddd9d1f21573723a6eab39a/nh3-0.2.18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_armv7l_0411beb0": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "0411beb0589eacb6734f28d5497ca2ed379eafab8ad8c84b31bb5c34072b7164", + "urls": [ + "https://files.pythonhosted.org/packages/05/2b/85977d9e11713b5747595ee61f381bc820749daf83f07b90b6c9964cf932/nh3-0.2.18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_ppc64_5f36b271": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "5f36b271dae35c465ef5e9090e1fdaba4a60a56f0bb0ba03e0932a66f28b9189", + "urls": [ + "https://files.pythonhosted.org/packages/72/f2/5c894d5265ab80a97c68ca36f25c8f6f0308abac649aaf152b74e7e854a8/nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_ppc64le_34c03fa7": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "34c03fa78e328c691f982b7c03d4423bdfd7da69cd707fe572f544cf74ac23ad", + "urls": [ + "https://files.pythonhosted.org/packages/ab/a7/375afcc710dbe2d64cfbd69e31f82f3e423d43737258af01f6a56d844085/nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_s390x_19aaba96": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "19aaba96e0f795bd0a6c56291495ff59364f4300d4a39b29a0abc9cb3774a84b", + "urls": [ + "https://files.pythonhosted.org/packages/c2/a8/3bb02d0c60a03ad3a112b76c46971e9480efa98a8946677b5a59f60130ca/nh3-0.2.18-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_x86_64_de3ceed6": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "de3ceed6e661954871d6cd78b410213bdcb136f79aafe22aa7182e028b8c7307", + "urls": [ + "https://files.pythonhosted.org/packages/1b/63/6ab90d0e5225ab9780f6c9fb52254fa36b52bb7c188df9201d05b647e5e1/nh3-0.2.18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_musllinux_1_2_aarch64_f0eca9ca": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-musllinux_1_2_aarch64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "f0eca9ca8628dbb4e916ae2491d72957fdd35f7a5d326b7032a345f111ac07fe", + "urls": [ + "https://files.pythonhosted.org/packages/a3/da/0c4e282bc3cff4a0adf37005fa1fb42257673fbc1bbf7d1ff639ec3d255a/nh3-0.2.18-cp37-abi3-musllinux_1_2_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_musllinux_1_2_armv7l_3a157ab1": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-musllinux_1_2_armv7l.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "3a157ab149e591bb638a55c8c6bcb8cdb559c8b12c13a8affaba6cedfe51713a", + "urls": [ + "https://files.pythonhosted.org/packages/de/81/c291231463d21da5f8bba82c8167a6d6893cc5419b0639801ee5d3aeb8a9/nh3-0.2.18-cp37-abi3-musllinux_1_2_armv7l.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_musllinux_1_2_x86_64_36c95d4b": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-musllinux_1_2_x86_64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "36c95d4b70530b320b365659bb5034341316e6a9b30f0b25fa9c9eff4c27a204", + "urls": [ + "https://files.pythonhosted.org/packages/eb/61/73a007c74c37895fdf66e0edcd881f5eaa17a348ff02f4bb4bc906d61085/nh3-0.2.18-cp37-abi3-musllinux_1_2_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_cp37_abi3_win_amd64_8ce0f819": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "nh3-0.2.18-cp37-abi3-win_amd64.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "8ce0f819d2f1933953fca255db2471ad58184a60508f03e6285e5114b6254844", + "urls": [ + "https://files.pythonhosted.org/packages/26/8d/53c5b19c4999bdc6ba95f246f4ef35ca83d7d7423e5e38be43ad66544e5d/nh3-0.2.18-cp37-abi3-win_amd64.whl" + ] + } + }, + "rules_python_publish_deps_311_nh3_sdist_94a16692": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "nh3-0.2.18.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "nh3==0.2.18", + "sha256": "94a166927e53972a9698af9542ace4e38b9de50c34352b962f4d9a7d4c927af4", + "urls": [ + "https://files.pythonhosted.org/packages/62/73/10df50b42ddb547a907deeb2f3c9823022580a7a47281e8eae8e003a9639/nh3-0.2.18.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pkginfo_py3_none_any_889a6da2": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "pkginfo-1.10.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pkginfo==1.10.0", + "sha256": "889a6da2ed7ffc58ab5b900d888ddce90bce912f2d2de1dc1c26f4cb9fe65097", + "urls": [ + "https://files.pythonhosted.org/packages/56/09/054aea9b7534a15ad38a363a2bd974c20646ab1582a387a95b8df1bfea1c/pkginfo-1.10.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_pkginfo_sdist_5df73835": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "pkginfo-1.10.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pkginfo==1.10.0", + "sha256": "5df73835398d10db79f8eecd5cd86b1f6d29317589ea70796994d49399af6297", + "urls": [ + "https://files.pythonhosted.org/packages/2f/72/347ec5be4adc85c182ed2823d8d1c7b51e13b9a6b0c1aae59582eca652df/pkginfo-1.10.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pycparser_py3_none_any_c3702b6d": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "pycparser-2.22-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pycparser==2.22", + "sha256": "c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc", + "urls": [ + "https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_pycparser_sdist_491c8be9": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "pycparser-2.22.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pycparser==2.22", + "sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", + "urls": [ + "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pygments_py3_none_any_b8e6aca0": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "pygments-2.18.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pygments==2.18.0", + "sha256": "b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a", + "urls": [ + "https://files.pythonhosted.org/packages/f7/3f/01c8b82017c199075f8f788d0d906b9ffbbc5a47dc9918a945e13d5a2bda/pygments-2.18.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_pygments_sdist_786ff802": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "pygments-2.18.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pygments==2.18.0", + "sha256": "786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199", + "urls": [ + "https://files.pythonhosted.org/packages/8e/62/8336eff65bcbc8e4cb5d05b55faf041285951b6e80f33e2bff2024788f31/pygments-2.18.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pywin32_ctypes_py3_none_any_8a151337": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_windows_x86_64" + ], + "filename": "pywin32_ctypes-0.2.3-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pywin32-ctypes==0.2.3", + "sha256": "8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8", + "urls": [ + "https://files.pythonhosted.org/packages/de/3d/8161f7711c017e01ac9f008dfddd9410dff3674334c233bde66e7ba65bbf/pywin32_ctypes-0.2.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_pywin32_ctypes_sdist_d162dc04": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "pywin32-ctypes-0.2.3.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "pywin32-ctypes==0.2.3", + "sha256": "d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755", + "urls": [ + "https://files.pythonhosted.org/packages/85/9f/01a1a99704853cb63f253eea009390c88e7131c67e66a0a02099a8c917cb/pywin32-ctypes-0.2.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_readme_renderer_py3_none_any_2fbca89b": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "readme_renderer-44.0-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "readme-renderer==44.0", + "sha256": "2fbca89b81a08526aadf1357a8c2ae889ec05fb03f5da67f9769c9a592166151", + "urls": [ + "https://files.pythonhosted.org/packages/e1/67/921ec3024056483db83953ae8e48079ad62b92db7880013ca77632921dd0/readme_renderer-44.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_readme_renderer_sdist_8712034e": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "readme_renderer-44.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "readme-renderer==44.0", + "sha256": "8712034eabbfa6805cacf1402b4eeb2a73028f72d1166d6f5cb7f9c047c5d1e1", + "urls": [ + "https://files.pythonhosted.org/packages/5a/a9/104ec9234c8448c4379768221ea6df01260cd6c2ce13182d4eac531c8342/readme_renderer-44.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_requests_py3_none_any_70761cfe": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "requests-2.32.3-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "requests==2.32.3", + "sha256": "70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", + "urls": [ + "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_requests_sdist_55365417": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "requests-2.32.3.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "requests==2.32.3", + "sha256": "55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", + "urls": [ + "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_requests_toolbelt_py2_none_any_cccfdd66": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "requests_toolbelt-1.0.0-py2.py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "requests-toolbelt==1.0.0", + "sha256": "cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06", + "urls": [ + "https://files.pythonhosted.org/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_requests_toolbelt_sdist_7681a0a3": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "requests-toolbelt-1.0.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "requests-toolbelt==1.0.0", + "sha256": "7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6", + "urls": [ + "https://files.pythonhosted.org/packages/f3/61/d7545dafb7ac2230c70d38d31cbfe4cc64f7144dc41f6e4e4b78ecd9f5bb/requests-toolbelt-1.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_rfc3986_py2_none_any_50b1502b": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "rfc3986-2.0.0-py2.py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "rfc3986==2.0.0", + "sha256": "50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd", + "urls": [ + "https://files.pythonhosted.org/packages/ff/9a/9afaade874b2fa6c752c36f1548f718b5b83af81ed9b76628329dab81c1b/rfc3986-2.0.0-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_rfc3986_sdist_97aacf9d": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "rfc3986-2.0.0.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "rfc3986==2.0.0", + "sha256": "97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c", + "urls": [ + "https://files.pythonhosted.org/packages/85/40/1520d68bfa07ab5a6f065a186815fb6610c86fe957bc065754e47f7b0840/rfc3986-2.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_rich_py3_none_any_9836f509": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "rich-13.9.3-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "rich==13.9.3", + "sha256": "9836f5096eb2172c9e77df411c1b009bace4193d6a481d534fea75ebba758283", + "urls": [ + "https://files.pythonhosted.org/packages/9a/e2/10e9819cf4a20bd8ea2f5dabafc2e6bf4a78d6a0965daeb60a4b34d1c11f/rich-13.9.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_rich_sdist_bc1e01b8": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "rich-13.9.3.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "rich==13.9.3", + "sha256": "bc1e01b899537598cf02579d2b9f4a415104d3fc439313a7a2c165d76557a08e", + "urls": [ + "https://files.pythonhosted.org/packages/d9/e9/cf9ef5245d835065e6673781dbd4b8911d352fb770d56cf0879cf11b7ee1/rich-13.9.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_secretstorage_py3_none_any_f356e662": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "filename": "SecretStorage-3.3.3-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "secretstorage==3.3.3", + "sha256": "f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99", + "urls": [ + "https://files.pythonhosted.org/packages/54/24/b4293291fa1dd830f353d2cb163295742fa87f179fcc8a20a306a81978b7/SecretStorage-3.3.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_secretstorage_sdist_2403533e": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "SecretStorage-3.3.3.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "secretstorage==3.3.3", + "sha256": "2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77", + "urls": [ + "https://files.pythonhosted.org/packages/53/a4/f48c9d79cb507ed1373477dbceaba7401fd8a23af63b837fa61f1dcd3691/SecretStorage-3.3.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_twine_py3_none_any_215dbe7b": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "twine-5.1.1-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "twine==5.1.1", + "sha256": "215dbe7b4b94c2c50a7315c0275d2258399280fbb7d04182c7e55e24b5f93997", + "urls": [ + "https://files.pythonhosted.org/packages/5d/ec/00f9d5fd040ae29867355e559a94e9a8429225a0284a3f5f091a3878bfc0/twine-5.1.1-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_twine_sdist_9aa08251": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "twine-5.1.1.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "twine==5.1.1", + "sha256": "9aa0825139c02b3434d913545c7b847a21c835e11597f5255842d457da2322db", + "urls": [ + "https://files.pythonhosted.org/packages/77/68/bd982e5e949ef8334e6f7dcf76ae40922a8750aa2e347291ae1477a4782b/twine-5.1.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_urllib3_py3_none_any_ca899ca0": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "urllib3-2.2.3-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "urllib3==2.2.3", + "sha256": "ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac", + "urls": [ + "https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_urllib3_sdist_e7d814a8": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "urllib3-2.2.3.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "urllib3==2.2.3", + "sha256": "e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9", + "urls": [ + "https://files.pythonhosted.org/packages/ed/63/22ba4ebfe7430b76388e7cd448d5478814d3032121827c12a2cc287e2260/urllib3-2.2.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_zipp_py3_none_any_a817ac80": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "filename": "zipp-3.20.2-py3-none-any.whl", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "zipp==3.20.2", + "sha256": "a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350", + "urls": [ + "https://files.pythonhosted.org/packages/62/8b/5ba542fa83c90e09eac972fc9baca7a88e7e7ca4b221a89251954019308b/zipp-3.20.2-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_zipp_sdist_bc9eb26f": { + "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "cp311_linux_aarch64", + "cp311_linux_arm", + "cp311_linux_ppc", + "cp311_linux_s390x", + "cp311_linux_x86_64", + "cp311_osx_aarch64", + "cp311_osx_x86_64", + "cp311_windows_x86_64" + ], + "extra_pip_args": [ + "--index-url", + "https://pypi.org/simple" + ], + "filename": "zipp-3.20.2.tar.gz", + "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", + "repo": "rules_python_publish_deps_311", + "requirement": "zipp==3.20.2", + "sha256": "bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29", + "urls": [ + "https://files.pythonhosted.org/packages/54/bf/5c0000c44ebc80123ecbdddba1f5dcd94a5ada602a9c225d84b5aaa55e86/zipp-3.20.2.tar.gz" + ] + } + }, + "pip_deps": { + "repoRuleId": "@@rules_python+//python/private/pypi:hub_repository.bzl%hub_repository", + "attributes": { + "repo_name": "pip_deps", + "extra_hub_aliases": {}, + "whl_map": { + "numpy": "{\"pip_deps_310_numpy\":[{\"version\":\"3.10\"}],\"pip_deps_311_numpy\":[{\"version\":\"3.11\"}],\"pip_deps_312_numpy\":[{\"version\":\"3.12\"}],\"pip_deps_38_numpy\":[{\"version\":\"3.8\"}],\"pip_deps_39_numpy\":[{\"version\":\"3.9\"}]}", + "setuptools": "{\"pip_deps_310_setuptools\":[{\"version\":\"3.10\"}],\"pip_deps_311_setuptools\":[{\"version\":\"3.11\"}],\"pip_deps_312_setuptools\":[{\"version\":\"3.12\"}],\"pip_deps_38_setuptools\":[{\"version\":\"3.8\"}],\"pip_deps_39_setuptools\":[{\"version\":\"3.9\"}]}" + }, + "packages": [ + "numpy", + "setuptools" + ], + "groups": {} + } + }, + "rules_fuzzing_py_deps": { + "repoRuleId": "@@rules_python+//python/private/pypi:hub_repository.bzl%hub_repository", + "attributes": { + "repo_name": "rules_fuzzing_py_deps", + "extra_hub_aliases": {}, + "whl_map": { + "absl_py": "{\"rules_fuzzing_py_deps_310_absl_py\":[{\"version\":\"3.10\"}],\"rules_fuzzing_py_deps_311_absl_py\":[{\"version\":\"3.11\"}],\"rules_fuzzing_py_deps_312_absl_py\":[{\"version\":\"3.12\"}],\"rules_fuzzing_py_deps_38_absl_py\":[{\"version\":\"3.8\"}],\"rules_fuzzing_py_deps_39_absl_py\":[{\"version\":\"3.9\"}]}", + "six": "{\"rules_fuzzing_py_deps_310_six\":[{\"version\":\"3.10\"}],\"rules_fuzzing_py_deps_311_six\":[{\"version\":\"3.11\"}],\"rules_fuzzing_py_deps_312_six\":[{\"version\":\"3.12\"}],\"rules_fuzzing_py_deps_38_six\":[{\"version\":\"3.8\"}],\"rules_fuzzing_py_deps_39_six\":[{\"version\":\"3.9\"}]}" + }, + "packages": [ + "absl_py", + "six" + ], + "groups": {} + } + }, + "rules_python_publish_deps": { + "repoRuleId": "@@rules_python+//python/private/pypi:hub_repository.bzl%hub_repository", + "attributes": { + "repo_name": "rules_python_publish_deps", + "extra_hub_aliases": {}, + "whl_map": { + "backports_tarfile": "{\"rules_python_publish_deps_311_backports_tarfile_py3_none_any_77e284d7\":[{\"filename\":\"backports.tarfile-1.2.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_backports_tarfile_sdist_d75e02c2\":[{\"filename\":\"backports_tarfile-1.2.0.tar.gz\",\"version\":\"3.11\"}]}", + "certifi": "{\"rules_python_publish_deps_311_certifi_py3_none_any_922820b5\":[{\"filename\":\"certifi-2024.8.30-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_certifi_sdist_bec941d2\":[{\"filename\":\"certifi-2024.8.30.tar.gz\",\"version\":\"3.11\"}]}", + "cffi": "{\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_aarch64_a1ed2dd2\":[{\"filename\":\"cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_ppc64le_46bf4316\":[{\"filename\":\"cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_s390x_a24ed04c\":[{\"filename\":\"cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_x86_64_610faea7\":[{\"filename\":\"cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cffi_cp311_cp311_musllinux_1_1_aarch64_a9b15d49\":[{\"filename\":\"cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cffi_cp311_cp311_musllinux_1_1_x86_64_fc48c783\":[{\"filename\":\"cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cffi_sdist_1c39c601\":[{\"filename\":\"cffi-1.17.1.tar.gz\",\"version\":\"3.11\"}]}", + "charset_normalizer": "{\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_universal2_0d99dd8f\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_x86_64_c57516e5\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_11_0_arm64_6dba5d19\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_aarch64_bf4475b8\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_ppc64le_ce031db0\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_s390x_8ff4e7cd\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_x86_64_3710a975\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_aarch64_47334db7\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_ppc64le_f1a2f519\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_s390x_63bc5c4a\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_2_x86_64_bcb4f8ea\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_win_amd64_cee4373f\":[{\"filename\":\"charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_py3_none_any_fe9f97fe\":[{\"filename\":\"charset_normalizer-3.4.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_charset_normalizer_sdist_223217c3\":[{\"filename\":\"charset_normalizer-3.4.0.tar.gz\",\"version\":\"3.11\"}]}", + "cryptography": "{\"rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_17_aarch64_846da004\":[{\"filename\":\"cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_17_x86_64_0f996e72\":[{\"filename\":\"cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_28_aarch64_f7b178f1\":[{\"filename\":\"cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cryptography_cp39_abi3_manylinux_2_28_x86_64_c2e6fc39\":[{\"filename\":\"cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cryptography_cp39_abi3_musllinux_1_2_aarch64_e1be4655\":[{\"filename\":\"cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cryptography_cp39_abi3_musllinux_1_2_x86_64_df6b6c6d\":[{\"filename\":\"cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_cryptography_sdist_315b9001\":[{\"filename\":\"cryptography-43.0.3.tar.gz\",\"version\":\"3.11\"}]}", + "docutils": "{\"rules_python_publish_deps_311_docutils_py3_none_any_dafca5b9\":[{\"filename\":\"docutils-0.21.2-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_docutils_sdist_3a6b1873\":[{\"filename\":\"docutils-0.21.2.tar.gz\",\"version\":\"3.11\"}]}", + "idna": "{\"rules_python_publish_deps_311_idna_py3_none_any_946d195a\":[{\"filename\":\"idna-3.10-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_idna_sdist_12f65c9b\":[{\"filename\":\"idna-3.10.tar.gz\",\"version\":\"3.11\"}]}", + "importlib_metadata": "{\"rules_python_publish_deps_311_importlib_metadata_py3_none_any_45e54197\":[{\"filename\":\"importlib_metadata-8.5.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_importlib_metadata_sdist_71522656\":[{\"filename\":\"importlib_metadata-8.5.0.tar.gz\",\"version\":\"3.11\"}]}", + "jaraco_classes": "{\"rules_python_publish_deps_311_jaraco_classes_py3_none_any_f662826b\":[{\"filename\":\"jaraco.classes-3.4.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_jaraco_classes_sdist_47a024b5\":[{\"filename\":\"jaraco.classes-3.4.0.tar.gz\",\"version\":\"3.11\"}]}", + "jaraco_context": "{\"rules_python_publish_deps_311_jaraco_context_py3_none_any_f797fc48\":[{\"filename\":\"jaraco.context-6.0.1-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_jaraco_context_sdist_9bae4ea5\":[{\"filename\":\"jaraco_context-6.0.1.tar.gz\",\"version\":\"3.11\"}]}", + "jaraco_functools": "{\"rules_python_publish_deps_311_jaraco_functools_py3_none_any_ad159f13\":[{\"filename\":\"jaraco.functools-4.1.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_jaraco_functools_sdist_70f7e0e2\":[{\"filename\":\"jaraco_functools-4.1.0.tar.gz\",\"version\":\"3.11\"}]}", + "jeepney": "{\"rules_python_publish_deps_311_jeepney_py3_none_any_c0a454ad\":[{\"filename\":\"jeepney-0.8.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_jeepney_sdist_5efe48d2\":[{\"filename\":\"jeepney-0.8.0.tar.gz\",\"version\":\"3.11\"}]}", + "keyring": "{\"rules_python_publish_deps_311_keyring_py3_none_any_5426f817\":[{\"filename\":\"keyring-25.4.1-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_keyring_sdist_b07ebc55\":[{\"filename\":\"keyring-25.4.1.tar.gz\",\"version\":\"3.11\"}]}", + "markdown_it_py": "{\"rules_python_publish_deps_311_markdown_it_py_py3_none_any_35521684\":[{\"filename\":\"markdown_it_py-3.0.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_markdown_it_py_sdist_e3f60a94\":[{\"filename\":\"markdown-it-py-3.0.0.tar.gz\",\"version\":\"3.11\"}]}", + "mdurl": "{\"rules_python_publish_deps_311_mdurl_py3_none_any_84008a41\":[{\"filename\":\"mdurl-0.1.2-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_mdurl_sdist_bb413d29\":[{\"filename\":\"mdurl-0.1.2.tar.gz\",\"version\":\"3.11\"}]}", + "more_itertools": "{\"rules_python_publish_deps_311_more_itertools_py3_none_any_037b0d32\":[{\"filename\":\"more_itertools-10.5.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_more_itertools_sdist_5482bfef\":[{\"filename\":\"more-itertools-10.5.0.tar.gz\",\"version\":\"3.11\"}]}", + "nh3": "{\"rules_python_publish_deps_311_nh3_cp37_abi3_macosx_10_12_x86_64_14c5a72e\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_macosx_10_12_x86_64_7b7c2a3c\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_aarch64_42c64511\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_armv7l_0411beb0\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_ppc64_5f36b271\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_ppc64le_34c03fa7\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_s390x_19aaba96\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_manylinux_2_17_x86_64_de3ceed6\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_musllinux_1_2_aarch64_f0eca9ca\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-musllinux_1_2_aarch64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_musllinux_1_2_armv7l_3a157ab1\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-musllinux_1_2_armv7l.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_musllinux_1_2_x86_64_36c95d4b\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-musllinux_1_2_x86_64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_cp37_abi3_win_amd64_8ce0f819\":[{\"filename\":\"nh3-0.2.18-cp37-abi3-win_amd64.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_nh3_sdist_94a16692\":[{\"filename\":\"nh3-0.2.18.tar.gz\",\"version\":\"3.11\"}]}", + "pkginfo": "{\"rules_python_publish_deps_311_pkginfo_py3_none_any_889a6da2\":[{\"filename\":\"pkginfo-1.10.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_pkginfo_sdist_5df73835\":[{\"filename\":\"pkginfo-1.10.0.tar.gz\",\"version\":\"3.11\"}]}", + "pycparser": "{\"rules_python_publish_deps_311_pycparser_py3_none_any_c3702b6d\":[{\"filename\":\"pycparser-2.22-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_pycparser_sdist_491c8be9\":[{\"filename\":\"pycparser-2.22.tar.gz\",\"version\":\"3.11\"}]}", + "pygments": "{\"rules_python_publish_deps_311_pygments_py3_none_any_b8e6aca0\":[{\"filename\":\"pygments-2.18.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_pygments_sdist_786ff802\":[{\"filename\":\"pygments-2.18.0.tar.gz\",\"version\":\"3.11\"}]}", + "pywin32_ctypes": "{\"rules_python_publish_deps_311_pywin32_ctypes_py3_none_any_8a151337\":[{\"filename\":\"pywin32_ctypes-0.2.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_pywin32_ctypes_sdist_d162dc04\":[{\"filename\":\"pywin32-ctypes-0.2.3.tar.gz\",\"version\":\"3.11\"}]}", + "readme_renderer": "{\"rules_python_publish_deps_311_readme_renderer_py3_none_any_2fbca89b\":[{\"filename\":\"readme_renderer-44.0-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_readme_renderer_sdist_8712034e\":[{\"filename\":\"readme_renderer-44.0.tar.gz\",\"version\":\"3.11\"}]}", + "requests": "{\"rules_python_publish_deps_311_requests_py3_none_any_70761cfe\":[{\"filename\":\"requests-2.32.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_requests_sdist_55365417\":[{\"filename\":\"requests-2.32.3.tar.gz\",\"version\":\"3.11\"}]}", + "requests_toolbelt": "{\"rules_python_publish_deps_311_requests_toolbelt_py2_none_any_cccfdd66\":[{\"filename\":\"requests_toolbelt-1.0.0-py2.py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_requests_toolbelt_sdist_7681a0a3\":[{\"filename\":\"requests-toolbelt-1.0.0.tar.gz\",\"version\":\"3.11\"}]}", + "rfc3986": "{\"rules_python_publish_deps_311_rfc3986_py2_none_any_50b1502b\":[{\"filename\":\"rfc3986-2.0.0-py2.py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_rfc3986_sdist_97aacf9d\":[{\"filename\":\"rfc3986-2.0.0.tar.gz\",\"version\":\"3.11\"}]}", + "rich": "{\"rules_python_publish_deps_311_rich_py3_none_any_9836f509\":[{\"filename\":\"rich-13.9.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_rich_sdist_bc1e01b8\":[{\"filename\":\"rich-13.9.3.tar.gz\",\"version\":\"3.11\"}]}", + "secretstorage": "{\"rules_python_publish_deps_311_secretstorage_py3_none_any_f356e662\":[{\"filename\":\"SecretStorage-3.3.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_secretstorage_sdist_2403533e\":[{\"filename\":\"SecretStorage-3.3.3.tar.gz\",\"version\":\"3.11\"}]}", + "twine": "{\"rules_python_publish_deps_311_twine_py3_none_any_215dbe7b\":[{\"filename\":\"twine-5.1.1-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_twine_sdist_9aa08251\":[{\"filename\":\"twine-5.1.1.tar.gz\",\"version\":\"3.11\"}]}", + "urllib3": "{\"rules_python_publish_deps_311_urllib3_py3_none_any_ca899ca0\":[{\"filename\":\"urllib3-2.2.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_urllib3_sdist_e7d814a8\":[{\"filename\":\"urllib3-2.2.3.tar.gz\",\"version\":\"3.11\"}]}", + "zipp": "{\"rules_python_publish_deps_311_zipp_py3_none_any_a817ac80\":[{\"filename\":\"zipp-3.20.2-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_zipp_sdist_bc9eb26f\":[{\"filename\":\"zipp-3.20.2.tar.gz\",\"version\":\"3.11\"}]}" + }, + "packages": [ + "backports_tarfile", + "certifi", + "charset_normalizer", + "docutils", + "idna", + "importlib_metadata", + "jaraco_classes", + "jaraco_context", + "jaraco_functools", + "keyring", + "markdown_it_py", + "mdurl", + "more_itertools", + "nh3", + "pkginfo", + "pygments", + "readme_renderer", + "requests", + "requests_toolbelt", + "rfc3986", + "rich", + "twine", + "urllib3", + "zipp" + ], + "groups": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features+", + "bazel_features_globals", + "bazel_features++version_extension+bazel_features_globals" + ], + [ + "bazel_features+", + "bazel_features_version", + "bazel_features++version_extension+bazel_features_version" + ], + [ + "rules_python+", + "bazel_features", + "bazel_features+" + ], + [ + "rules_python+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "rules_python+", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python+", + "pypi__build", + "rules_python++internal_deps+pypi__build" + ], + [ + "rules_python+", + "pypi__click", + "rules_python++internal_deps+pypi__click" + ], + [ + "rules_python+", + "pypi__colorama", + "rules_python++internal_deps+pypi__colorama" + ], + [ + "rules_python+", + "pypi__importlib_metadata", + "rules_python++internal_deps+pypi__importlib_metadata" + ], + [ + "rules_python+", + "pypi__installer", + "rules_python++internal_deps+pypi__installer" + ], + [ + "rules_python+", + "pypi__more_itertools", + "rules_python++internal_deps+pypi__more_itertools" + ], + [ + "rules_python+", + "pypi__packaging", + "rules_python++internal_deps+pypi__packaging" + ], + [ + "rules_python+", + "pypi__pep517", + "rules_python++internal_deps+pypi__pep517" + ], + [ + "rules_python+", + "pypi__pip", + "rules_python++internal_deps+pypi__pip" + ], + [ + "rules_python+", + "pypi__pip_tools", + "rules_python++internal_deps+pypi__pip_tools" + ], + [ + "rules_python+", + "pypi__pyproject_hooks", + "rules_python++internal_deps+pypi__pyproject_hooks" + ], + [ + "rules_python+", + "pypi__setuptools", + "rules_python++internal_deps+pypi__setuptools" + ], + [ + "rules_python+", + "pypi__tomli", + "rules_python++internal_deps+pypi__tomli" + ], + [ + "rules_python+", + "pypi__wheel", + "rules_python++internal_deps+pypi__wheel" + ], + [ + "rules_python+", + "pypi__zipp", + "rules_python++internal_deps+pypi__zipp" + ], + [ + "rules_python+", + "pythons_hub", + "rules_python++python+pythons_hub" + ], + [ + "rules_python++python+pythons_hub", + "python_3_10_host", + "rules_python++python+python_3_10_host" + ], + [ + "rules_python++python+pythons_hub", + "python_3_11_host", + "rules_python++python+python_3_11_host" + ], + [ + "rules_python++python+pythons_hub", + "python_3_12_host", + "rules_python++python+python_3_12_host" + ], + [ + "rules_python++python+pythons_hub", + "python_3_8_host", + "rules_python++python+python_3_8_host" + ], + [ + "rules_python++python+pythons_hub", + "python_3_9_host", + "rules_python++python+python_3_9_host" + ] + ] + } + }, + "@@rules_sass+//src/toolchain:extensions.bzl%sass": { + "general": { + "bzlTransitiveDigest": "RA58Nyrsn03Z5YmQnpmBw3mqlVck++XIrx34amsqU/E=", + "usagesDigest": "R0KshhzIouLWuexMUCrl4HY+FUDwlVVgF9Z7UnwyUWA=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "linux_amd64_sass": { + "repoRuleId": "@@rules_sass+//src/toolchain:configure_sass.bzl%configure_sass", + "attributes": { + "file": "@rules_sass//src/compiler/built:sass_linux_x64", + "sha256": "", + "constraints": [ + "@@platforms//os:linux", + "@@platforms//cpu:x86_64" + ] + } + }, + "linux_arm64_sass": { + "repoRuleId": "@@rules_sass+//src/toolchain:configure_sass.bzl%configure_sass", + "attributes": { + "file": "@rules_sass//src/compiler/built:sass_linux_arm", + "sha256": "", + "constraints": [ + "@@platforms//os:linux", + "@@platforms//cpu:arm64" + ] + } + }, + "darwin_amd64_sass": { + "repoRuleId": "@@rules_sass+//src/toolchain:configure_sass.bzl%configure_sass", + "attributes": { + "file": "@rules_sass//src/compiler/built:sass_mac_x64", + "sha256": "", + "constraints": [ + "@@platforms//os:macos", + "@@platforms//cpu:x86_64" + ] + } + }, + "darwin_arm64_sass": { + "repoRuleId": "@@rules_sass+//src/toolchain:configure_sass.bzl%configure_sass", + "attributes": { + "file": "@rules_sass//src/compiler/built:sass_mac_arm", + "sha256": "", + "constraints": [ + "@@platforms//os:macos", + "@@platforms//cpu:arm64" + ] + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@yq.bzl+//yq:extensions.bzl%yq": { + "general": { + "bzlTransitiveDigest": "61Uz+o5PnlY0jJfPZEUNqsKxnM/UCLeWsn5VVCc8u5Y=", + "usagesDigest": "iZPDKVC6SAQMLLGWulzoS8hhxbx9Eh5DsJBUjn69u2Q=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "yq_darwin_amd64": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "darwin_amd64", + "version": "4.45.1" + } + }, + "yq_darwin_arm64": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "darwin_arm64", + "version": "4.45.1" + } + }, + "yq_linux_amd64": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "linux_amd64", + "version": "4.45.1" + } + }, + "yq_linux_arm64": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "linux_arm64", + "version": "4.45.1" + } + }, + "yq_linux_s390x": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "linux_s390x", + "version": "4.45.1" + } + }, + "yq_linux_riscv64": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "linux_riscv64", + "version": "4.45.1" + } + }, + "yq_linux_ppc64le": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "linux_ppc64le", + "version": "4.45.1" + } + }, + "yq_windows_amd64": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:platforms.bzl%yq_platform_repo", + "attributes": { + "platform": "windows_amd64", + "version": "4.45.1" + } + }, + "yq_toolchains": { + "repoRuleId": "@@yq.bzl+//yq/toolchain:toolchain.bzl%yq_toolchains_repo", + "attributes": { + "user_repository_name": "yq" + } } }, "recordedRepoMappingEntries": [] } } - } + }, + "facts": {} } diff --git a/REPO.bazel b/REPO.bazel new file mode 100644 index 000000000000..9eb8128879bd --- /dev/null +++ b/REPO.bazel @@ -0,0 +1,5 @@ +ignore_directories([ + ".git", + "dist", + "**/node_modules/**", +]) diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 0d385fd1b153..000000000000 --- a/WORKSPACE +++ /dev/null @@ -1,303 +0,0 @@ -workspace(name = "angular_cli") - -DEFAULT_NODE_VERSION = "20.11.1" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") - -http_archive( - name = "bazel_skylib", - sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", - ], -) - -http_archive( - name = "io_bazel_rules_webtesting", - sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a", - urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz"], -) - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "5dd1e5dea1322174c57d3ca7b899da381d516220793d0adef3ba03b9d23baa8e", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.3/rules_nodejs-5.8.3.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") - -build_bazel_rules_nodejs_dependencies() - -http_archive( - name = "aspect_rules_js", - sha256 = "83e5af4d17385d1c3268c31ae217dbfc8525aa7bcf52508dc6864baffc8b9501", - strip_prefix = "rules_js-2.3.7", - url = "https://github.com/aspect-build/rules_js/releases/download/v2.3.7/rules_js-v2.3.7.tar.gz", -) - -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") - -rules_js_dependencies() - -http_archive( - name = "rules_pkg", - sha256 = "8c20f74bca25d2d442b327ae26768c02cf3c99e93fad0381f32be9aab1967675", - urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.8.1/rules_pkg-0.8.1.tar.gz"], -) - -load("@bazel_tools//tools/sh:sh_configure.bzl", "sh_configure") - -sh_configure() - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -# Setup the Node.js toolchain -load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") - -NODE_20_REPO = { - "20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"), - "20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"), - "20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"), - "20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"), - "20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"), - "20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"), - "20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"), -} - -# Set the default nodejs toolchain to the latest supported major version -nodejs_register_toolchains( - name = "nodejs", - # The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701 - node_repositories = NODE_20_REPO, - node_version = DEFAULT_NODE_VERSION, -) - -nodejs_register_toolchains( - name = "node20", - # The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701 - node_repositories = NODE_20_REPO, - node_version = "20.11.1", -) - -nodejs_register_toolchains( - name = "node22", - # The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701 - node_repositories = { - "22.11.0-darwin_arm64": ("node-v22.11.0-darwin-arm64.tar.gz", "node-v22.11.0-darwin-arm64", "2e89afe6f4e3aa6c7e21c560d8a0453d84807e97850bbb819b998531a22bdfde"), - "22.11.0-darwin_amd64": ("node-v22.11.0-darwin-x64.tar.gz", "node-v22.11.0-darwin-x64", "668d30b9512137b5f5baeef6c1bb4c46efff9a761ba990a034fb6b28b9da2465"), - "22.11.0-linux_arm64": ("node-v22.11.0-linux-arm64.tar.xz", "node-v22.11.0-linux-arm64", "6031d04b98f59ff0f7cb98566f65b115ecd893d3b7870821171708cdbaf7ae6e"), - "22.11.0-linux_ppc64le": ("node-v22.11.0-linux-ppc64le.tar.xz", "node-v22.11.0-linux-ppc64le", "d1d49d7d611b104b6d616e18ac439479d8296aa20e3741432de0e85f4735a81e"), - "22.11.0-linux_s390x": ("node-v22.11.0-linux-s390x.tar.xz", "node-v22.11.0-linux-s390x", "f474ed77d6b13d66d07589aee1c2b9175be4c1b165483e608ac1674643064a99"), - "22.11.0-linux_amd64": ("node-v22.11.0-linux-x64.tar.xz", "node-v22.11.0-linux-x64", "83bf07dd343002a26211cf1fcd46a9d9534219aad42ee02847816940bf610a72"), - "22.11.0-windows_amd64": ("node-v22.11.0-win-x64.zip", "node-v22.11.0-win-x64", "905373a059aecaf7f48c1ce10ffbd5334457ca00f678747f19db5ea7d256c236"), - }, - node_version = "22.11.0", -) - -nodejs_register_toolchains( - name = "node24", - node_repositories = { - "24.0.0-darwin_arm64": ("node-v24.0.0-darwin-arm64.tar.gz", "node-v24.0.0-darwin-arm64", "194e2f3dd3ec8c2adcaa713ed40f44c5ca38467880e160974ceac1659be60121"), - "24.0.0-darwin_amd64": ("node-v24.0.0-darwin-x64.tar.gz", "node-v24.0.0-darwin-x64", "f716b3ce14a7e37a6cbf97c9de10d444d7da07ef833cd8da81dd944d111e6a4a"), - "24.0.0-linux_arm64": ("node-v24.0.0-linux-arm64.tar.xz", "node-v24.0.0-linux-arm64", "d40ec7ffe0b82b02dce94208c84351424099bd70fa3a42b65c46d95322305040"), - "24.0.0-linux_ppc64le": ("node-v24.0.0-linux-ppc64le.tar.xz", "node-v24.0.0-linux-ppc64le", "cfa0e8d51a2f9a446f1bfb81cdf4c7e95336ad622e2aa230e3fa1d093c63d77d"), - "24.0.0-linux_s390x": ("node-v24.0.0-linux-s390x.tar.xz", "node-v24.0.0-linux-s390x", "e37a04c7ee05416ec1234fd3255e05b6b81287eb0424a57441c8b69f0a155021"), - "24.0.0-linux_amd64": ("node-v24.0.0-linux-x64.tar.xz", "node-v24.0.0-linux-x64", "59b8af617dccd7f9f68cc8451b2aee1e86d6bd5cb92cd51dd6216a31b707efd7"), - "24.0.0-windows_amd64": ("node-v24.0.0-win-x64.zip", "node-v24.0.0-win-x64", "3d0fff80c87bb9a8d7f49f2f27832aa34a1477d137af46f5b14df5498be81304"), - }, - node_version = "24.0.0", -) - -load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains") - -rules_js_register_toolchains( - node_repositories = NODE_20_REPO, - node_version = DEFAULT_NODE_VERSION, -) - -http_archive( - name = "aspect_bazel_lib", - sha256 = "fc8fe1be58ae39f84a8613d554534760c7f0819d407afcc98bbcbd990523bfed", - strip_prefix = "bazel-lib-2.16.0", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.16.0/bazel-lib-v2.16.0.tar.gz", -) - -load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "aspect_bazel_lib_register_toolchains") - -aspect_bazel_lib_dependencies() - -aspect_bazel_lib_register_toolchains() - -load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories") - -esbuild_repositories( - npm_repository = "npm", -) - -load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock") - -npm_translate_lock( - name = "npm", - custom_postinstalls = { - # TODO: Standardize browser management for `rules_js` - "webdriver-manager": "node ./bin/webdriver-manager update --standalone false --gecko false --versions.chrome 106.0.5249.21", - }, - data = [ - "//:package.json", - "//:pnpm-workspace.yaml", - "//modules/testing/builder:package.json", - "//packages/angular/build:package.json", - "//packages/angular/cli:package.json", - "//packages/angular/pwa:package.json", - "//packages/angular/ssr:package.json", - "//packages/angular_devkit/architect:package.json", - "//packages/angular_devkit/architect_cli:package.json", - "//packages/angular_devkit/build_angular:package.json", - "//packages/angular_devkit/build_webpack:package.json", - "//packages/angular_devkit/core:package.json", - "//packages/angular_devkit/schematics:package.json", - "//packages/angular_devkit/schematics_cli:package.json", - "//packages/ngtools/webpack:package.json", - "//packages/schematics/angular:package.json", - "//tests:package.json", - "//tools/baseline_browserslist:package.json", - ], - lifecycle_hooks_envs = { - # TODO: Standardize browser management for `rules_js` - "puppeteer": ["PUPPETEER_DOWNLOAD_PATH=./downloads"], - }, - lifecycle_hooks_execution_requirements = { - # Needed for downloading chromedriver. - # Also `update-config` of webdriver manager would store an absolute path; - # which would then break execution. - "webdriver-manager": ["local"], - }, - npmrc = "//:.npmrc", - patches = { - # Note: Patches not needed as the existing patches are only - # for `rules_nodejs` dependencies :) - }, - pnpm_lock = "//:pnpm-lock.yaml", - public_hoist_packages = { - # TODO: Remove when https://github.com/verdaccio/verdaccio/commit/bf0e09a509e8e0a74167b0307d129202bc3f40d2 is available. - "@verdaccio/config": [""], - }, - verify_node_modules_ignored = "//:.bazelignore", -) - -load("@npm//:repositories.bzl", "npm_repositories") - -npm_repositories() - -http_archive( - name = "aspect_rules_ts", - sha256 = "56858e1e4380948e2d5aca5ab2e96fc5ed788652a4a3b7036e8e4b6f019e63bd", - strip_prefix = "rules_ts-3.5.3", - url = "https://github.com/aspect-build/rules_ts/releases/download/v3.5.3/rules_ts-v3.5.3.tar.gz", -) - -load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies") - -rules_ts_dependencies( - # ts_version_from = "//:package.json", - # Obtained by: curl --silent https://registry.npmjs.org/typescript/5.7.2 | jq -r '.dist.integrity' - ts_integrity = "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", - ts_version = "5.7.2", -) - -http_file( - name = "tsc_worker", - sha256 = "5a5c46846ecda83e05b9da26f1672ad51c59bce08fed88419850d0e29c993b30", - urls = ["https://raw.githubusercontent.com/devversion/rules_angular/4b7532ba2b29078d005899cd15b415593d03cceb/dist/worker.mjs"], -) - -http_archive( - name = "aspect_rules_jasmine", - sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529", - strip_prefix = "rules_jasmine-2.0.0", - url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz", -) - -load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies") - -rules_jasmine_dependencies() - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "devinfra", - commit = "a4538b2474d3c551f0217c3d1f5f3a99cf4f8eb7", - remote = "https://github.com/angular/dev-infra.git", -) - -load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1") - -setup_dependencies_1() - -load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2") - -setup_dependencies_2() - -load("@devinfra//bazel/browsers:browser_repositories.bzl", "browser_repositories") - -browser_repositories() - -register_toolchains( - "@devinfra//bazel/git-toolchain:git_linux_toolchain", - "@devinfra//bazel/git-toolchain:git_macos_x86_toolchain", - "@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain", - "@devinfra//bazel/git-toolchain:git_windows_toolchain", -) - -http_archive( - name = "aspect_rules_esbuild", - sha256 = "530adfeae30bbbd097e8af845a44a04b641b680c5703b3bf885cbd384ffec779", - strip_prefix = "rules_esbuild-0.22.1", - url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.22.1/rules_esbuild-v0.22.1.tar.gz", -) - -load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependencies") - -rules_esbuild_dependencies() - -load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains") - -esbuild_register_toolchains( - name = "esbuild", - esbuild_version = LATEST_ESBUILD_VERSION, -) - -git_repository( - name = "rules_angular", - commit = "42d4791c1c2cd8b21deaf960443dd883033fdedf", - remote = "https://github.com/devversion/rules_angular.git", -) - -load("@rules_angular//setup:step_1.bzl", "rules_angular_step1") - -rules_angular_step1() - -load("@rules_angular//setup:step_2.bzl", "rules_angular_step2") - -rules_angular_step2() - -load("@rules_angular//setup:step_3.bzl", "rules_angular_step3") - -rules_angular_step3( - angular_compiler_cli = "//:node_modules/@angular/compiler-cli", - typescript = "//:node_modules/typescript", -) - -http_archive( - name = "aspect_rules_rollup", - sha256 = "0b8ac7d97cd660eb9a275600227e9c4268f5904cba962939d1a6ce9a0a059d2e", - strip_prefix = "rules_rollup-2.0.1", - url = "https://github.com/aspect-build/rules_rollup/releases/download/v2.0.1/rules_rollup-v2.0.1.tar.gz", -) diff --git a/constants.bzl b/constants.bzl index cb33e793ed8c..e2224aa24c39 100644 --- a/constants.bzl +++ b/constants.bzl @@ -1,19 +1,19 @@ # Engine versions to stamp in a release package.json -RELEASE_ENGINES_NODE = "^20.11.1 || ^22.11.0 || >=24.0.0" +RELEASE_ENGINES_NODE = "^20.19.0 || ^22.12.0 || >=24.0.0" RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0" RELEASE_ENGINES_YARN = ">= 1.13.0" -NG_PACKAGR_VERSION = "^20.0.0-next.0" -ANGULAR_FW_VERSION = "^20.0.0-next.0" -ANGULAR_FW_PEER_DEP = "^20.0.0 || ^20.0.0-next.0" -NG_PACKAGR_PEER_DEP = "^20.0.0 || ^20.0.0-next.0" +NG_PACKAGR_VERSION = "^21.1.0-next.0" +ANGULAR_FW_VERSION = "^21.1.0-next.0" +ANGULAR_FW_PEER_DEP = "^21.0.0 || ^21.1.0-next.0" +NG_PACKAGR_PEER_DEP = "^21.0.0 || ^21.1.0-next.0" # Baseline widely-available date in `YYYY-MM-DD` format which defines Angular's # browser support. This date serves as the source of truth for the Angular CLI's # default browser set used to determine what downleveling is necessary. # # See: https://web.dev/baseline -BASELINE_DATE = "2025-04-30" +BASELINE_DATE = "2025-10-20" SNAPSHOT_REPOS = { "@angular/cli": "angular/cli-builds", diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md index 640e83447ae8..8204bd7dcbce 100644 --- a/docs/DEVELOPER.md +++ b/docs/DEVELOPER.md @@ -7,7 +7,7 @@ To get started locally, follow these instructions: 1. If you haven't done it already, [make a fork of this repo](https://github.com/angular/angular-cli/fork). 2. If you are on Windows, see [the extra steps needed for contributing on Windows](#windows) 3. Clone to your local computer using `git`. -4. Make sure that you have Node `v20.18.1` or higher installed. See instructions [here](https://nodejs.org/en/download/). +4. Make sure that you have Node `v20.19.0` or higher installed. See instructions [here](https://nodejs.org/en/download/). 5. Install `pnpm`. - You can install pnpm by running `npm i -g pnpm@9`. - See detailed instructions [here](https://pnpm.io/installation). @@ -89,8 +89,8 @@ You can find more info about debugging [tests with Bazel in the docs.](https://g ### End to end tests - For a complete list of test targets use the following Bazel query: `pnpm bazel query "tests(//tests/...)"` -- Run a subset of the tests: `pnpm bazel test //tests/legacy-cli:e2e_node22 --config=e2e --test_filter="tests/i18n/ivy-localize-*"` -- Use `bazel run` to debug failing tests debugging: `pnpm bazel run //tests/legacy-cli:e2e_node22 --config=e2e --test_arg="--glob=tests/basic/aot.ts"` +- Run a subset of the tests: `pnpm bazel test //tests:e2e_node22 --config=e2e --test_filter="tests/i18n/ivy-localize-*"` +- Use `bazel run` to debug failing tests debugging: `pnpm bazel run //tests:e2e_node22 --config=e2e --test_arg="--glob=tests/basic/aot.ts"` - Provide additional `e2e_runner` options using `--test_arg`: `--test_arg="--package-manager=yarn"` When running the debug commands, Node will stop and wait for a debugger to attach. diff --git a/docs/process/release.md b/docs/process/release.md index e8867c909ce3..5490e48e8279 100644 --- a/docs/process/release.md +++ b/docs/process/release.md @@ -69,10 +69,15 @@ Releasing is performed using Angular's unified release tooling. Each week, two r Once FW releases the actual minor/major release (for example: `13.0.0` or `13.1.0`), update dependencies with the following: -1. Update [`constants.bzl`](../../constants.bzl) so `@angular/core` and `ng-packagr` are using the release version (drop `-next.0`). +1. Update [`constants.bzl`](../../constants.bzl) so `@angular/core` and `ng-packagr` are using the release version (drop `-rc.*`). +2. Update all `package.json` dependencies on framework packages to to the release version (drop `-rc.*`). + - Components packages release _after_ CLI, so those should be left as `-rc.*`. +3. `pnpm install` to update the `pnpm-lock.yaml` file. -Merge the above change in a separate PR which lands _after_ FW releases (or else CI will fail) but _before_ the CLI -release PR. Releases are built before the PR is sent for review, so any changes after that point won't be included in the release. +Create a PR with the above changes ([example](https://github.com/angular/angular-cli/pull/31872)) and merge it directly to the RC +branch. This PR must land _after_ FW releases (or else CI will fail) but _before_ the CLI release PR. Releases are built before +the PR is sent for review, so any changes after that point won't be included in the release and this cannot be combined with the +release PR. **AFTER a minor OR major CLI release:** @@ -123,12 +128,15 @@ will block the next weekly release. pnpm ng-dev release build ``` 1. Log in to NPM as `angular`. + ```shell npm login ``` + - See these two Valentine entries for authentication details: - https://valentine.corp.google.com/#/show/1460636514618735 - https://valentine.corp.google.com/#/show/1531867371192103 + 1. Publish the release. ```shell (cd dist/releases/my-scope/my-pkg/ && npm publish --access public) @@ -161,17 +169,10 @@ A few weeks before a major (around feature freeze): - Picking a date at the end of a month makes it easier to cross-reference Angular's support with other tools (like MDN) which state Baseline support using month specificity. - - You can view the generated `browserlist` configuration with: - ```shell - bazel build //packages/angular/build:angular_browserslist - cat dist/bin/packages/angular/build/.browserslistrc - ``` - Commit and merge the change, no other alterations or automation is necessary in the CLI repo. -2. Update - [`/.browserslistrc`](https://github.com/ng-packagr/ng-packagr/tree/main/.browserslistrc) - in the `ng-packagr` repo. - - Use the generated configuration from above. +2. Update the date in the `ng-packagr` repo. + [`/.stylesheet-processor.ts`](https://github.com/ng-packagr/ng-packagr/blob/main/src/lib/styles/stylesheet-processor.ts#L25). 3. Update [`angular.dev` documentation](https://github.com/angular/angular/tree/main/adev/src/content/reference/versions.md#browser-support) to specify the date used and link to [browsersl.ist](https://browsersl.ist) diff --git a/eslint.config.mjs b/eslint.config.mjs index eeb7f6c60cd2..192ba19f2007 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,19 +1,23 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; import stylistic from '@stylistic/eslint-plugin'; import typescriptEslint from '@typescript-eslint/eslint-plugin'; -import _import from 'eslint-plugin-import'; +import tsParser from '@typescript-eslint/parser'; import header from 'eslint-plugin-header'; +import _import from 'eslint-plugin-import'; import globals from 'globals'; -import tsParser from '@typescript-eslint/parser'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import js from '@eslint/js'; -import { FlatCompat } from '@eslint/eslintrc'; -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); const compat = new FlatCompat({ - baseDirectory: __dirname, + baseDirectory: import.meta.dirname, recommendedConfig: js.configs.recommended, allConfig: js.configs.all, }); @@ -185,9 +189,8 @@ export default [ }, ], - '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/no-implied-eval': 'off', - '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-unsafe-call': 'off', diff --git a/goldens/public-api/angular/build/index.api.md b/goldens/public-api/angular/build/index.api.md index 31576f664e36..a51449319e47 100644 --- a/goldens/public-api/angular/build/index.api.md +++ b/goldens/public-api/angular/build/index.api.md @@ -6,6 +6,7 @@ import { BuilderContext } from '@angular-devkit/architect'; import { BuilderOutput } from '@angular-devkit/architect'; +import type { ConfigOptions } from 'karma'; import type http from 'node:http'; import { OutputFile } from 'esbuild'; import type { Plugin as Plugin_2 } from 'esbuild'; @@ -111,6 +112,9 @@ export enum BuildOutputFileType { export type DevServerBuilderOptions = { allowedHosts?: AllowedHosts; buildTarget: string; + define?: { + [key: string]: string; + }; headers?: { [key: string]: string; }; @@ -151,18 +155,59 @@ export function executeDevServerBuilder(options: DevServerBuilderOptions, contex // @public export function executeExtractI18nBuilder(options: ExtractI18nBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): Promise; +// @public +export function executeKarmaBuilder(options: KarmaBuilderOptions, context: BuilderContext, transforms?: KarmaBuilderTransformsOptions): AsyncIterable; + // @public export function executeNgPackagrBuilder(options: NgPackagrBuilderOptions, context: BuilderContext): AsyncIterableIterator; +// @public +export function executeUnitTestBuilder(options: UnitTestBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): AsyncIterable; + // @public export type ExtractI18nBuilderOptions = { buildTarget?: string; format?: Format; + i18nDuplicateTranslation?: I18NDuplicateTranslation; outFile?: string; outputPath?: string; progress?: boolean; }; +// @public +export type KarmaBuilderOptions = { + aot?: boolean; + assets?: AssetPattern_2[]; + browsers?: Browsers; + codeCoverage?: boolean; + codeCoverageExclude?: string[]; + define?: { + [key: string]: string; + }; + exclude?: string[]; + externalDependencies?: string[]; + fileReplacements?: FileReplacement_2[]; + include?: string[]; + inlineStyleLanguage?: InlineStyleLanguage_2; + karmaConfig?: string; + loader?: { + [key: string]: any; + }; + main?: string; + poll?: number; + polyfills?: string[]; + preserveSymlinks?: boolean; + progress?: boolean; + reporters?: string[]; + scripts?: ScriptElement_2[]; + sourceMap?: SourceMapUnion_2; + stylePreprocessorOptions?: StylePreprocessorOptions_2; + styles?: StyleElement_2[]; + tsConfig: string; + watch?: boolean; + webWorkerTsConfig?: string; +}; + // @public export type NgPackagrBuilderOptions = { poll?: number; @@ -171,6 +216,35 @@ export type NgPackagrBuilderOptions = { watch?: boolean; }; +// @public +export type UnitTestBuilderOptions = { + browserViewport?: string; + browsers?: string[]; + buildTarget?: string; + coverage?: boolean; + coverageExclude?: string[]; + coverageInclude?: string[]; + coverageReporters?: SchemaCoverageReporter[]; + coverageThresholds?: CoverageThresholds; + coverageWatermarks?: CoverageWatermarks; + debug?: boolean; + dumpVirtualFiles?: boolean; + exclude?: string[]; + filter?: string; + include?: string[]; + listTests?: boolean; + outputFile?: string; + progress?: boolean; + providersFile?: string; + reporters?: SchemaReporter[]; + runner?: Runner; + runnerConfig?: RunnerConfig; + setupFiles?: string[]; + tsConfig?: string; + ui?: boolean; + watch?: boolean; +}; + // (No @packageDocumentation comment for this package) ``` diff --git a/goldens/public-api/angular/ssr/node/index.api.md b/goldens/public-api/angular/ssr/node/index.api.md index 0f30fa7e99c5..eccb6396938e 100644 --- a/goldens/public-api/angular/ssr/node/index.api.md +++ b/goldens/public-api/angular/ssr/node/index.api.md @@ -5,6 +5,7 @@ ```ts import { ApplicationRef } from '@angular/core'; +import { BootstrapContext } from '@angular/platform-browser'; import { Http2ServerRequest } from 'node:http2'; import { Http2ServerResponse } from 'node:http2'; import { IncomingMessage } from 'node:http'; @@ -26,14 +27,14 @@ export class CommonEngine { // @public (undocumented) export interface CommonEngineOptions { - bootstrap?: Type<{}> | (() => Promise); + bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise); enablePerformanceProfiler?: boolean; providers?: StaticProvider[]; } // @public (undocumented) export interface CommonEngineRenderOptions { - bootstrap?: Type<{}> | (() => Promise); + bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise); // (undocumented) document?: string; // (undocumented) diff --git a/goldens/public-api/angular_devkit/build_angular/index.api.md b/goldens/public-api/angular_devkit/build_angular/index.api.md index 9208d1ad56a1..cb46b4458351 100644 --- a/goldens/public-api/angular_devkit/build_angular/index.api.md +++ b/goldens/public-api/angular_devkit/build_angular/index.api.md @@ -191,6 +191,7 @@ export type ExecutionTransformer = (input: T) => T | Promise; export type ExtractI18nBuilderOptions = { buildTarget?: string; format?: Format; + i18nDuplicateTranslation?: I18NDuplicateTranslation; outFile?: string; outputPath?: string; progress?: boolean; diff --git a/goldens/public-api/angular_devkit/build_webpack/index.api.md b/goldens/public-api/angular_devkit/build_webpack/index.api.md index 8a3fe489f1c1..0d60187627d5 100644 --- a/goldens/public-api/angular_devkit/build_webpack/index.api.md +++ b/goldens/public-api/angular_devkit/build_webpack/index.api.md @@ -7,8 +7,8 @@ import { BuilderContext } from '@angular-devkit/architect'; import { BuilderOutput } from '@angular-devkit/architect'; import { Observable } from 'rxjs'; -import webpack from 'webpack'; -import WebpackDevServer from 'webpack-dev-server'; +import type webpack from 'webpack'; +import type WebpackDevServer from 'webpack-dev-server'; // @public (undocumented) export type BuildResult = BuilderOutput & { @@ -65,7 +65,7 @@ export type WebpackDevServerFactory = typeof WebpackDevServer; // @public (undocumented) export interface WebpackFactory { // (undocumented) - (config: webpack.Configuration): Observable | webpack.Compiler; + (config: webpack.Configuration): Observable | webpack.Compiler | null; } // @public (undocumented) diff --git a/goldens/public-api/angular_devkit/schematics/index.api.md b/goldens/public-api/angular_devkit/schematics/index.api.md index add7132d138f..505bd2c39920 100644 --- a/goldens/public-api/angular_devkit/schematics/index.api.md +++ b/goldens/public-api/angular_devkit/schematics/index.api.md @@ -170,9 +170,9 @@ export type CollectionDescription = Collecti // @public (undocumented) export class CollectionImpl implements Collection { - constructor(_description: CollectionDescription, _engine: SchematicEngine, baseDescriptions?: Array> | undefined); + constructor(_description: CollectionDescription, _engine: SchematicEngine, baseDescriptions?: CollectionDescription[] | undefined); // (undocumented) - readonly baseDescriptions?: Array> | undefined; + readonly baseDescriptions?: CollectionDescription[] | undefined; // (undocumented) createSchematic(name: string, allowPrivate?: boolean): Schematic; // (undocumented) @@ -274,7 +274,7 @@ export interface DirEntry { // @public (undocumented) export interface DryRunCreateEvent { // (undocumented) - content: Buffer; + content: ArrayBufferLike; // (undocumented) kind: 'create'; // (undocumented) @@ -334,7 +334,7 @@ export class DryRunSink extends HostSink { // @public (undocumented) export interface DryRunUpdateEvent { // (undocumented) - content: Buffer; + content: ArrayBufferLike; // (undocumented) kind: 'update'; // (undocumented) @@ -495,13 +495,13 @@ export class HostSink extends SimpleSinkBase { // (undocumented) _done(): Observable; // (undocumented) - protected _filesToCreate: Map>; + protected _filesToCreate: Map; // (undocumented) protected _filesToDelete: Set; // (undocumented) protected _filesToRename: Set<[Path, Path]>; // (undocumented) - protected _filesToUpdate: Map>; + protected _filesToUpdate: Map; // (undocumented) protected _force: boolean; // (undocumented) @@ -637,7 +637,10 @@ export enum MergeStrategy { export function mergeWith(source: Source, strategy?: MergeStrategy): Rule; // @public (undocumented) -export function move(from: string, to?: string): Rule; +export function move(from: string, to: string): Rule; + +// @public (undocumented) +export function move(to: string): Rule; // @public (undocumented) export function noop(): Rule; diff --git a/goldens/public-api/angular_devkit/schematics/tools/index.api.md b/goldens/public-api/angular_devkit/schematics/tools/index.api.md index 6a32d88e9ec0..c93e3ec27762 100644 --- a/goldens/public-api/angular_devkit/schematics/tools/index.api.md +++ b/goldens/public-api/angular_devkit/schematics/tools/index.api.md @@ -203,7 +203,7 @@ export class NodeModulesTestEngineHost extends NodeModulesEngineHost { // (undocumented) protected _resolveCollectionPath(name: string, requester?: string): string; // (undocumented) - get tasks(): TaskConfiguration<{}>[]; + get tasks(): TaskConfiguration[]; // (undocumented) transformContext(context: FileSystemSchematicContext): FileSystemSchematicContext; } diff --git a/goldens/public-api/manage.js b/goldens/public-api/manage.js deleted file mode 100644 index 569f2a6bd1e3..000000000000 --- a/goldens/public-api/manage.js +++ /dev/null @@ -1,54 +0,0 @@ -const {exec} = require('shelljs'); -const {Parser: parser} = require('yargs/helpers'); - -// Remove all command line flags from the arguments. -const argv = parser(process.argv.slice(2)); -// The command the user would like to run, either 'accept' or 'test' -const USER_COMMAND = argv._[0]; -// The shell command to query for all Public API guard tests. -const BAZEL_PUBLIC_API_TARGET_QUERY_CMD = - `pnpm -s bazel query --output label 'kind(nodejs_test, ...) intersect attr("tags", "api_guard", ...)'` -// Bazel targets for testing Public API goldens -process.stdout.write('Gathering all Public API targets'); -const ALL_PUBLIC_API_TESTS = exec(BAZEL_PUBLIC_API_TARGET_QUERY_CMD, {silent: true}) - .trim() - .split('\n') - .map(test => test.trim()); -process.stdout.clearLine(); -process.stdout.cursorTo(0); -// Bazel targets for generating Public API goldens -const ALL_PUBLIC_API_ACCEPTS = ALL_PUBLIC_API_TESTS.map(test => `${test}.accept`); - -/** - * Run the provided bazel commands on each provided target individually. - */ -function runBazelCommandOnTargets(command, targets, present) { - for (const target of targets) { - process.stdout.write(`${present}: ${target}`); - const commandResult = exec(`pnpm -s bazel ${command} ${target}`, {silent: true}); - process.stdout.clearLine(); - process.stdout.cursorTo(0); - if (commandResult.code) { - console.error(`Failed ${command}: ${target}`); - console.group(); - console.error(commandResult.stdout || commandResult.stderr); - console.groupEnd(); - } else { - console.log(`Successful ${command}: ${target}`); - } - } -} - -switch (USER_COMMAND) { - case 'accept': - runBazelCommandOnTargets('run', ALL_PUBLIC_API_ACCEPTS, 'Running'); - break; - case 'test': - runBazelCommandOnTargets('test', ALL_PUBLIC_API_TESTS, 'Testing'); - break; - default: - console.warn('Invalid command provided.'); - console.warn(); - console.warn(`Run this script with either "accept" and "test"`); - break; -} diff --git a/modules/testing/builder/BUILD.bazel b/modules/testing/builder/BUILD.bazel index 9814ad27811d..7f542efb0138 100644 --- a/modules/testing/builder/BUILD.bazel +++ b/modules/testing/builder/BUILD.bazel @@ -20,7 +20,10 @@ ts_project( # Needed at runtime by some builder tests relying on SSR being # resolvable in the test project. ":node_modules/@angular/ssr", + ":node_modules/browser-sync", + ":node_modules/jsdom", ":node_modules/vitest", + ":node_modules/@vitest/coverage-v8", ] + glob(["projects/**/*"]), deps = [ ":node_modules/@angular-devkit/architect", @@ -45,6 +48,6 @@ ts_project( ) jasmine_test( - name = "unit_test", + name = "test", data = [":unit_test_lib"], ) diff --git a/modules/testing/builder/package.json b/modules/testing/builder/package.json index b76d212f1296..fe92f53c0725 100644 --- a/modules/testing/builder/package.json +++ b/modules/testing/builder/package.json @@ -4,7 +4,10 @@ "@angular-devkit/architect": "workspace:*", "@angular/ssr": "workspace:*", "@angular-devkit/build-angular": "workspace:*", + "browser-sync": "3.0.4", + "@vitest/coverage-v8": "4.0.15", + "jsdom": "27.3.0", "rxjs": "7.8.2", - "vitest": "3.1.3" + "vitest": "4.0.15" } } diff --git a/modules/testing/builder/projects/hello-world-app/karma.conf.js b/modules/testing/builder/projects/hello-world-app/karma.conf.js index 7ad5e58e8efc..7d5f7c8d98f5 100644 --- a/modules/testing/builder/projects/hello-world-app/karma.conf.js +++ b/modules/testing/builder/projects/hello-world-app/karma.conf.js @@ -23,9 +23,6 @@ module.exports = function(config) { require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma'), ], - client: { - clearContext: false, // leave Jasmine Spec Runner output visible in browser - }, jasmineHtmlReporter: { suppressAll: true // removes the duplicated traces }, @@ -47,7 +44,7 @@ module.exports = function(config) { base: 'ChromeHeadless', flags: [ '--disable-gpu', - ...(process.env.CHROME_NO_SANDBOX === '1' ? ['--no-sandbox'] : []), + '--no-sandbox' ], }, }, diff --git a/modules/testing/builder/projects/hello-world-app/tsconfig.json b/modules/testing/builder/projects/hello-world-app/tsconfig.json index 8019279a7006..8f8859a21d4f 100644 --- a/modules/testing/builder/projects/hello-world-app/tsconfig.json +++ b/modules/testing/builder/projects/hello-world-app/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, - "moduleResolution": "node", + "moduleResolution": "bundler", "emitDecoratorMetadata": true, "experimentalDecorators": true, "skipLibCheck": true, diff --git a/modules/testing/builder/src/builder-harness.ts b/modules/testing/builder/src/builder-harness.ts index ecee882739d8..67b5f760d148 100644 --- a/modules/testing/builder/src/builder-harness.ts +++ b/modules/testing/builder/src/builder-harness.ts @@ -115,6 +115,10 @@ export class BuilderHarness { return join(getSystemPath(this.host.root()), path); } + resetProjectMetadata(): void { + this.projectMetadata = DEFAULT_PROJECT_METADATA; + } + useProject(name: string, metadata: Record = {}): this { if (!name) { throw new Error('Project name cannot be an empty string.'); @@ -158,6 +162,24 @@ export class BuilderHarness { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + modifyTarget( + targetName: string, + modifier: (options: O) => O | void, + ): this { + const target = this.builderTargets.get(targetName); + if (!target) { + throw new Error(`Target "${targetName}" not found.`); + } + + const newOptions = modifier(target.options as O); + if (newOptions) { + target.options = newOptions as json.JsonObject; + } + + return this; + } + execute( options: Partial = {}, ): Observable { @@ -259,7 +281,7 @@ export class BuilderHarness { } const logs: logging.LogEntry[] = []; - context.logger.subscribe((e) => logs.push(e)); + const logger$ = context.logger.subscribe((e) => logs.push(e)); return observableFrom(this.schemaRegistry.compile(this.builderInfo.optionSchema)).pipe( mergeMap((validator) => validator(targetOptions)), @@ -298,6 +320,7 @@ export class BuilderHarness { }), finalize(() => { this.watcherNotifier = undefined; + logger$.unsubscribe(); for (const teardown of context.teardowns) { // eslint-disable-next-line @typescript-eslint/no-floating-promises diff --git a/modules/testing/builder/src/index.ts b/modules/testing/builder/src/index.ts index 8f4687f9fdca..3ee4220781d9 100644 --- a/modules/testing/builder/src/index.ts +++ b/modules/testing/builder/src/index.ts @@ -15,5 +15,7 @@ export { type HarnessFileMatchers, JasmineBuilderHarness, describeBuilder, + expectLog, + expectNoLog, } from './jasmine-helpers'; export * from './test-utils'; diff --git a/modules/testing/builder/src/jasmine-helpers.ts b/modules/testing/builder/src/jasmine-helpers.ts index b204d507bab8..b31f2e273333 100644 --- a/modules/testing/builder/src/jasmine-helpers.ts +++ b/modules/testing/builder/src/jasmine-helpers.ts @@ -7,17 +7,21 @@ */ import { BuilderHandlerFn } from '@angular-devkit/architect'; -import { json } from '@angular-devkit/core'; +import { json, logging } from '@angular-devkit/core'; import { readFileSync } from 'node:fs'; -import { concatMap, count, firstValueFrom, take, timeout } from 'rxjs'; -import { BuilderHarness, BuilderHarnessExecutionResult } from './builder-harness'; +import { concatMap, count, debounceTime, firstValueFrom, take, timeout } from 'rxjs'; +import { + BuilderHarness, + BuilderHarnessExecutionOptions, + BuilderHarnessExecutionResult, +} from './builder-harness'; import { host } from './test-utils'; /** * Maximum time for single build/rebuild * This accounts for CI variability. */ -export const BUILD_TIMEOUT = 25_000; +export const BUILD_TIMEOUT = 30_000; const optionSchemaCache = new Map(); @@ -37,7 +41,11 @@ export function describeBuilder( }); describe(options.name || builderHandler.name, () => { - beforeEach(() => host.initialize().toPromise()); + beforeEach(async () => { + harness.resetProjectMetadata(); + + await host.initialize().toPromise(); + }); afterEach(() => host.restore().toPromise()); @@ -58,10 +66,12 @@ export class JasmineBuilderHarness extends BuilderHarness { executionResult: BuilderHarnessExecutionResult, index: number, ) => void | Promise)[], + options?: Partial & { timeout?: number }, ): Promise { const executionCount = await firstValueFrom( - this.execute().pipe( - timeout(BUILD_TIMEOUT), + this.execute(options).pipe( + timeout(options?.timeout ?? BUILD_TIMEOUT), + debounceTime(100), // This is needed as sometimes 2 events for the same change fire with webpack. concatMap(async (result, index) => await cases[index](result, index)), take(cases.length), count(), @@ -114,13 +124,17 @@ export function expectFile(path: string, harness: BuilderHarness): Harness return { toExist() { const exists = harness.hasFile(path); - expect(exists).toBe(true, 'Expected file to exist: ' + path); + expect(exists) + .withContext('Expected file to exist: ' + path) + .toBeTrue(); return exists; }, toNotExist() { const exists = harness.hasFile(path); - expect(exists).toBe(false, 'Expected file to not exist: ' + path); + expect(exists) + .withContext('Expected file to exist: ' + path) + .toBeFalse(); return !exists; }, @@ -166,15 +180,41 @@ export function expectDirectory( return { toExist() { const exists = harness.hasDirectory(path); - expect(exists).toBe(true, 'Expected directory to exist: ' + path); + expect(exists) + .withContext('Expected directory to exist: ' + path) + .toBeTrue(); return exists; }, toNotExist() { const exists = harness.hasDirectory(path); - expect(exists).toBe(false, 'Expected directory to not exist: ' + path); + expect(exists) + .withContext('Expected directory to not exist: ' + path) + .toBeFalse(); return !exists; }, }; } + +export function expectLog(logs: readonly logging.LogEntry[], message: string | RegExp) { + expect(logs).toContain( + jasmine.objectContaining({ + message: jasmine.stringMatching(message), + }), + ); +} + +export function expectNoLog( + logs: readonly logging.LogEntry[], + message: string | RegExp, + failureMessage?: string, +) { + expect(logs) + .withContext(failureMessage ?? '') + .not.toContain( + jasmine.objectContaining({ + message: jasmine.stringMatching(message), + }), + ); +} diff --git a/modules/testing/builder/src/test-utils.ts b/modules/testing/builder/src/test-utils.ts index 126af073b726..f41cb42d1ea6 100644 --- a/modules/testing/builder/src/test-utils.ts +++ b/modules/testing/builder/src/test-utils.ts @@ -24,8 +24,8 @@ import { import path from 'node:path'; import { firstValueFrom } from 'rxjs'; -// Default timeout for large specs is 2.5 minutes. -jasmine.DEFAULT_TIMEOUT_INTERVAL = 150000; +// Default timeout for large specs is 60s. +jasmine.DEFAULT_TIMEOUT_INTERVAL = 60_000; export const workspaceRoot = join(normalize(__dirname), `../projects/hello-world-app/`); export const host = new TestProjectHost(workspaceRoot); diff --git a/package.json b/package.json index 20e0bcf6e94c..5f862d813789 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/devkit-repo", - "version": "20.1.0-next.0", + "version": "21.1.0-next.3", "private": true, "description": "Software Development Kit for Angular", "keywords": [ @@ -11,33 +11,29 @@ "Angular DevKit" ], "scripts": { - "admin": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/devkit-admin.mjs", + "admin": "node --no-warnings=ExperimentalWarning --experimental-transform-types ./scripts/devkit-admin.mts", "bazel": "bazelisk", "test": "bazel test //packages/...", "build": "pnpm -s admin build", + "build-schema": "bazel build //... --build_tag_filters schema --symlink_prefix dist-schema/", "lint": "eslint --cache --max-warnings=0 \"**/*.@(ts|mts|cts)\"", "templates": "pnpm -s admin templates", "validate": "pnpm -s admin validate", - "postinstall": "pnpm -s webdriver-update && husky", - "//webdriver-update-README": "ChromeDriver version must match Puppeteer Chromium version, see https://github.com/GoogleChrome/puppeteer/releases http://chromedriver.chromium.org/downloads", - "webdriver-update": "webdriver-manager update --standalone false --gecko false --versions.chrome 106.0.5249.21", - "public-api:check": "node goldens/public-api/manage.js test", - "ng-dev": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs", - "public-api:update": "node goldens/public-api/manage.js accept", - "ts-circular-deps": "pnpm -s ng-dev ts-circular-deps --config ./scripts/circular-deps-test.conf.mjs", + "postinstall": "husky", + "ts-circular-deps": "ng-dev ts-circular-deps --config ./scripts/circular-deps-test.conf.mjs", "check-tooling-setup": "tsc --project .ng-dev/tsconfig.json", - "diff-release-package": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/diff-release-package.mts" + "diff-release-package": "node scripts/diff-release-package.mts" }, "repository": { "type": "git", "url": "https://github.com/angular/angular-cli.git" }, - "packageManager": "pnpm@9.15.6", + "packageManager": "pnpm@10.26.1", "engines": { - "node": "^20.11.1 || >=22.11.0", + "node": "^20.19.0 || ^22.12.0 || >=24.0.0", "npm": "Please use pnpm instead of NPM to install dependencies", "yarn": "Please use pnpm instead of Yarn to install dependencies", - "pnpm": "^9.15.6" + "pnpm": "10.26.1" }, "author": "Angular Authors", "license": "MIT", @@ -46,30 +42,31 @@ }, "homepage": "https://github.com/angular/angular-cli", "devDependencies": { - "@angular/animations": "20.0.0-next.9", - "@angular/cdk": "20.0.0-next.10", - "@angular/common": "20.0.0-next.9", - "@angular/compiler": "20.0.0-next.9", - "@angular/compiler-cli": "20.0.0-next.9", - "@angular/core": "20.0.0-next.9", - "@angular/forms": "20.0.0-next.9", - "@angular/localize": "20.0.0-next.9", - "@angular/material": "20.0.0-next.10", - "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#1125d8dbec5e787d9579e5b218b60a3be64c50fa", - "@angular/platform-browser": "20.0.0-next.9", - "@angular/platform-server": "20.0.0-next.9", - "@angular/router": "20.0.0-next.9", - "@angular/service-worker": "20.0.0-next.9", + "@angular/animations": "21.1.0-next.4", + "@angular/cdk": "21.1.0-next.3", + "@angular/common": "21.1.0-next.4", + "@angular/compiler": "21.1.0-next.4", + "@angular/compiler-cli": "21.1.0-next.4", + "@angular/core": "21.1.0-next.4", + "@angular/forms": "21.1.0-next.4", + "@angular/localize": "21.1.0-next.4", + "@angular/material": "21.1.0-next.3", + "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#ddc3809c1993612732eaae62d28e828b2ed789e5", + "@angular/platform-browser": "21.1.0-next.4", + "@angular/platform-server": "21.1.0-next.4", + "@angular/router": "21.1.0-next.4", + "@angular/service-worker": "21.1.0-next.4", + "@babel/core": "7.28.5", "@bazel/bazelisk": "1.26.0", - "@bazel/buildifier": "8.2.0", - "@eslint/compat": "1.2.9", - "@eslint/eslintrc": "3.3.1", - "@eslint/js": "9.26.0", - "@rollup/plugin-alias": "^5.1.1", - "@rollup/plugin-commonjs": "^28.0.0", + "@bazel/buildifier": "8.2.1", + "@eslint/compat": "2.0.0", + "@eslint/eslintrc": "3.3.3", + "@eslint/js": "9.39.2", + "@rollup/plugin-alias": "^6.0.0", + "@rollup/plugin-commonjs": "^29.0.0", "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "16.0.1", - "@stylistic/eslint-plugin": "^4.0.0", + "@rollup/plugin-node-resolve": "16.0.3", + "@stylistic/eslint-plugin": "^5.0.0", "@types/babel__core": "7.20.5", "@types/babel__generator": "^7.6.8", "@types/browser-sync": "^2.27.0", @@ -80,40 +77,37 @@ "@types/jasmine-reporters": "^2", "@types/karma": "^6.3.0", "@types/less": "^3.0.3", - "@types/loader-utils": "^2.0.0", + "@types/loader-utils": "^3.0.0", "@types/lodash": "^4.17.0", - "@types/node": "^20.17.19", + "@types/node": "^22.12.0", "@types/npm-package-arg": "^6.1.0", "@types/pacote": "^11.1.3", "@types/picomatch": "^4.0.0", "@types/progress": "^2.0.3", "@types/resolve": "^1.17.1", "@types/semver": "^7.3.12", - "@types/shelljs": "^0.8.11", "@types/watchpack": "^2.4.4", "@types/yargs": "^17.0.20", "@types/yargs-parser": "^21.0.0", "@types/yarnpkg__lockfile": "^1.1.5", - "@typescript-eslint/eslint-plugin": "8.32.0", - "@typescript-eslint/parser": "8.32.0", + "@typescript-eslint/eslint-plugin": "8.50.0", + "@typescript-eslint/parser": "8.50.0", "ajv": "8.17.1", - "ansi-colors": "4.1.3", - "beasties": "0.3.3", "buffer": "6.0.3", - "esbuild": "0.25.4", - "esbuild-wasm": "0.25.4", - "eslint": "9.26.0", - "eslint-config-prettier": "10.1.2", + "esbuild": "0.27.1", + "esbuild-wasm": "0.27.1", + "eslint": "9.39.2", + "eslint-config-prettier": "10.1.8", "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.31.0", - "express": "5.1.0", + "eslint-plugin-import": "2.32.0", + "express": "5.2.1", "fast-glob": "3.3.3", - "globals": "16.0.0", + "globals": "16.5.0", "http-proxy": "^1.18.1", "http-proxy-middleware": "3.0.5", "husky": "9.1.7", - "jasmine": "~5.7.0", - "jasmine-core": "~5.7.0", + "jasmine": "~5.13.0", + "jasmine-core": "~5.13.0", "jasmine-reporters": "^2.5.2", "jasmine-spec-reporter": "~7.0.0", "karma": "~6.4.0", @@ -122,31 +116,26 @@ "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "karma-source-map-support": "1.4.0", - "listr2": "8.3.3", "lodash": "^4.17.21", - "npm": "^11.0.0", - "magic-string": "0.30.17", - "rollup-plugin-dts": "6.2.1", - "rollup-plugin-sourcemaps2": "0.5.1", + "magic-string": "0.30.21", "prettier": "^3.0.0", "protractor": "~7.0.0", "puppeteer": "18.2.1", - "quicktype-core": "23.1.3", - "rollup": "4.40.2", - "rollup-license-plugin": "~3.0.1", - "semver": "7.7.1", - "shelljs": "^0.9.0", + "quicktype-core": "23.2.6", + "rollup": "4.53.5", + "rollup-license-plugin": "~3.1.0", + "rollup-plugin-dts": "6.3.0", + "rollup-plugin-sourcemaps2": "0.5.4", + "semver": "7.7.3", "source-map-support": "0.5.21", - "tar": "^7.0.0", "ts-node": "^10.9.1", "tslib": "2.8.1", - "typescript": "5.8.3", - "undici": "7.8.0", + "typescript": "5.9.3", + "undici": "7.16.0", "unenv": "^1.10.0", - "verdaccio": "6.1.2", + "verdaccio": "6.2.4", "verdaccio-auth-memory": "^10.0.0", - "yargs-parser": "21.1.1", - "zone.js": "^0.15.0" + "zone.js": "^0.16.0" }, "dependenciesMeta": { "esbuild": { @@ -173,6 +162,6 @@ } }, "resolutions": { - "typescript": "5.8.3" + "undici-types": "^7.16.0" } } diff --git a/packages/angular/build/BUILD.bazel b/packages/angular/build/BUILD.bazel index de157d169bbb..2f74117ff850 100644 --- a/packages/angular/build/BUILD.bazel +++ b/packages/angular/build/BUILD.bazel @@ -1,9 +1,7 @@ -load("@devinfra//bazel/api-golden:index_rjs.bzl", "api_golden_test_npm_package") +load("@devinfra//bazel/api-golden:index.bzl", "api_golden_test_npm_package") load("@npm//:defs.bzl", "npm_link_all_packages") -load("//:constants.bzl", "BASELINE_DATE") load("//tools:defaults.bzl", "copy_to_bin", "jasmine_test", "npm_package", "ts_project") load("//tools:ts_json_schema.bzl", "ts_json_schema") -load("//tools/baseline_browserslist:baseline_browserslist.bzl", "baseline_browserslist") licenses(["notice"]) @@ -46,23 +44,14 @@ copy_to_bin( srcs = glob(["**/schema.json"]), ) -baseline_browserslist( - name = "angular_browserslist", - out = ".browserslistrc", - baseline = BASELINE_DATE, -) - RUNTIME_ASSETS = glob( include = [ "src/**/schema.json", "src/**/*.js", - "src/**/*.mjs", - "src/**/*.html", ], ) + [ "builders.json", "package.json", - ":angular_browserslist", ] ts_project( @@ -97,6 +86,7 @@ ts_project( ":node_modules/@babel/helper-split-export-declaration", ":node_modules/@inquirer/confirm", ":node_modules/@vitejs/plugin-basic-ssl", + ":node_modules/beasties", ":node_modules/browserslist", ":node_modules/https-proxy-agent", ":node_modules/istanbul-lib-instrument", @@ -111,9 +101,11 @@ ts_project( ":node_modules/picomatch", ":node_modules/piscina", ":node_modules/postcss", + ":node_modules/rolldown", ":node_modules/sass", ":node_modules/source-map-support", ":node_modules/tinyglobby", + ":node_modules/undici", ":node_modules/vite", ":node_modules/vitest", ":node_modules/watchpack", @@ -122,6 +114,7 @@ ts_project( "//:node_modules/@angular/compiler-cli", "//:node_modules/@angular/core", "//:node_modules/@angular/localize", + "//:node_modules/@angular/platform-browser", "//:node_modules/@angular/platform-server", "//:node_modules/@angular/service-worker", "//:node_modules/@types/babel__core", @@ -131,11 +124,9 @@ ts_project( "//:node_modules/@types/picomatch", "//:node_modules/@types/semver", "//:node_modules/@types/watchpack", - "//:node_modules/beasties", "//:node_modules/esbuild", "//:node_modules/esbuild-wasm", "//:node_modules/karma", - "//:node_modules/rollup", "//:node_modules/semver", "//:node_modules/tslib", "//:node_modules/typescript", @@ -162,7 +153,7 @@ ts_project( ) jasmine_test( - name = "unit_tests", + name = "test", data = [":unit_test_lib"], ) @@ -291,23 +282,27 @@ ts_project( jasmine_test( name = "application_integration_tests", - size = "large", + size = "medium", data = [":application_integration_test_lib"], flaky = True, - shard_count = 10, + shard_count = 25, ) jasmine_test( name = "dev-server_integration_tests", - size = "large", + size = "medium", data = [":dev-server_integration_test_lib"], + env = { + # Force IPv4 to resolve RBE resolution issues + "NODE_OPTIONS": "--dns-result-order=ipv4first", + }, flaky = True, shard_count = 10, ) jasmine_test( name = "karma_integration_tests", - size = "large", + size = "medium", data = [":karma_integration_test_lib"], env = { # TODO: Replace Puppeteer downloaded browsers with Bazel-managed browsers, @@ -320,9 +315,10 @@ jasmine_test( jasmine_test( name = "unit-test_integration_tests", - size = "large", + size = "medium", data = [":unit-test_integration_test_lib"], - shard_count = 10, + flaky = True, + shard_count = 5, ) genrule( @@ -341,6 +337,7 @@ npm_package( "src/utils/version.js", "src/tools/esbuild/utils.js", "src/utils/normalize-cache.js", + "src/utils/supported-browsers.js", ], tags = ["release-package"], deps = RUNTIME_ASSETS + [ diff --git a/packages/angular/build/package.json b/packages/angular/build/package.json index d1064d8000ed..22e5e6b4b1be 100644 --- a/packages/angular/build/package.json +++ b/packages/angular/build/package.json @@ -20,48 +20,49 @@ "dependencies": { "@ampproject/remapping": "2.3.0", "@angular-devkit/architect": "workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER", - "@babel/core": "7.27.1", - "@babel/helper-annotate-as-pure": "7.27.1", + "@babel/core": "7.28.5", + "@babel/helper-annotate-as-pure": "7.27.3", "@babel/helper-split-export-declaration": "7.24.7", - "@inquirer/confirm": "5.1.9", - "@vitejs/plugin-basic-ssl": "2.0.0", - "beasties": "0.3.3", - "browserslist": "^4.23.0", - "esbuild": "0.25.4", + "@inquirer/confirm": "5.1.21", + "@vitejs/plugin-basic-ssl": "2.1.0", + "beasties": "0.3.5", + "browserslist": "^4.26.0", + "esbuild": "0.27.1", "https-proxy-agent": "7.0.6", "istanbul-lib-instrument": "6.0.3", "jsonc-parser": "3.3.1", - "listr2": "8.3.3", - "magic-string": "0.30.17", + "listr2": "9.0.5", + "magic-string": "0.30.21", "mrmime": "2.0.1", - "parse5-html-rewriting-stream": "7.1.0", - "picomatch": "4.0.2", - "piscina": "5.0.0", - "rollup": "4.40.2", - "sass": "1.87.0", - "semver": "7.7.1", + "parse5-html-rewriting-stream": "8.0.0", + "picomatch": "4.0.3", + "piscina": "5.1.4", + "rolldown": "1.0.0-beta.54", + "sass": "1.97.0", + "semver": "7.7.3", "source-map-support": "0.5.21", - "tinyglobby": "0.2.13", - "vite": "6.3.5", - "watchpack": "2.4.2" + "tinyglobby": "0.2.15", + "undici": "7.16.0", + "vite": "7.3.0", + "watchpack": "2.4.4" }, "optionalDependencies": { - "lmdb": "3.3.0" + "lmdb": "3.4.4" }, "devDependencies": { - "@angular/ssr": "workspace:*", "@angular-devkit/core": "workspace:*", - "jsdom": "26.1.0", - "less": "4.3.0", - "ng-packagr": "20.0.0-rc.0", - "postcss": "8.5.3", + "@angular/ssr": "workspace:*", + "jsdom": "27.3.0", + "less": "4.4.2", + "ng-packagr": "21.1.0-next.0", + "postcss": "8.5.6", "rxjs": "7.8.2", - "vitest": "3.1.3" + "vitest": "4.0.15" }, "peerDependencies": { - "@angular/core": "0.0.0-ANGULAR-FW-PEER-DEP", "@angular/compiler": "0.0.0-ANGULAR-FW-PEER-DEP", "@angular/compiler-cli": "0.0.0-ANGULAR-FW-PEER-DEP", + "@angular/core": "0.0.0-ANGULAR-FW-PEER-DEP", "@angular/localize": "0.0.0-ANGULAR-FW-PEER-DEP", "@angular/platform-browser": "0.0.0-ANGULAR-FW-PEER-DEP", "@angular/platform-server": "0.0.0-ANGULAR-FW-PEER-DEP", @@ -73,8 +74,8 @@ "postcss": "^8.4.0", "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0", "tslib": "^2.3.0", - "typescript": ">=5.8 <5.9", - "vitest": "^3.1.1" + "typescript": ">=5.9 <6.0", + "vitest": "^4.0.8" }, "peerDependenciesMeta": { "@angular/core": { diff --git a/packages/angular/build/src/builders/application/build-action.ts b/packages/angular/build/src/builders/application/build-action.ts index c59863f0ebf5..afc59785be7d 100644 --- a/packages/angular/build/src/builders/application/build-action.ts +++ b/packages/angular/build/src/builders/application/build-action.ts @@ -16,6 +16,7 @@ import { logMessages, withNoProgress, withSpinner } from '../../tools/esbuild/ut import { ChangedFiles } from '../../tools/esbuild/watcher'; import { shouldWatchRoot } from '../../utils/environment-options'; import { NormalizedCachedOptions } from '../../utils/normalize-cache'; +import { toPosixPath } from '../../utils/path'; import { NormalizedApplicationBuildOptions, NormalizedOutputOptions } from './options'; import { ComponentUpdateResult, @@ -105,7 +106,7 @@ export async function* runEsBuildBuildAction( // Ignore the output and cache paths to avoid infinite rebuild cycles outputOptions.base, cacheOptions.basePath, - `${workspaceRoot.replace(/\\/g, '/')}/**/.*/**`, + `${toPosixPath(workspaceRoot)}/**/.*/**`, ]; // Setup a watcher diff --git a/packages/angular/build/src/builders/application/chunk-optimizer.ts b/packages/angular/build/src/builders/application/chunk-optimizer.ts index a0ffa657b5c3..e6827479b784 100644 --- a/packages/angular/build/src/builders/application/chunk-optimizer.ts +++ b/packages/angular/build/src/builders/application/chunk-optimizer.ts @@ -6,8 +6,20 @@ * found in the LICENSE file at https://angular.dev/license */ +/** + * @fileoverview This file provides a function to optimize JavaScript chunks using rolldown. + * It is designed to be used after an esbuild build to further optimize the output. + * The main function, `optimizeChunks`, takes the result of an esbuild build, + * identifies the main browser entry point, and then uses rolldown to rebundle + * and optimize the chunks. This process can result in smaller and more efficient + * code by combining and restructuring the original chunks. The file also includes + * helper functions to convert rolldown's output into an esbuild-compatible + * metafile, allowing for consistent analysis and reporting of the build output. + */ + +import type { Message, Metafile } from 'esbuild'; import assert from 'node:assert'; -import { rollup } from 'rollup'; +import { type OutputAsset, type OutputChunk, rolldown } from 'rolldown'; import { BuildOutputFile, BuildOutputFileType, @@ -17,6 +29,145 @@ import { import { createOutputFile } from '../../tools/esbuild/utils'; import { assertIsError } from '../../utils/error'; +/** + * Converts the output of a rolldown build into an esbuild-compatible metafile. + * @param rolldownOutput The output of a rolldown build. + * @param originalMetafile The original esbuild metafile from the build. + * @returns An esbuild-compatible metafile. + */ +function rolldownToEsbuildMetafile( + rolldownOutput: (OutputChunk | OutputAsset)[], + originalMetafile: Metafile, +): Metafile { + const newMetafile: Metafile = { + inputs: originalMetafile.inputs, + outputs: {}, + }; + + const intermediateChunkSizes: Record = {}; + for (const [path, output] of Object.entries(originalMetafile.outputs)) { + intermediateChunkSizes[path] = Object.values(output.inputs).reduce( + (s, i) => s + i.bytesInOutput, + 0, + ); + } + + for (const chunk of rolldownOutput) { + if (chunk.type === 'asset') { + newMetafile.outputs[chunk.fileName] = { + bytes: + typeof chunk.source === 'string' + ? Buffer.byteLength(chunk.source, 'utf8') + : chunk.source.length, + inputs: {}, + imports: [], + exports: [], + }; + continue; + } + + const newOutputInputs: Record = {}; + if (chunk.modules) { + for (const [moduleId, renderedModule] of Object.entries(chunk.modules)) { + const originalOutputEntry = originalMetafile.outputs[moduleId]; + if (!originalOutputEntry?.inputs) { + continue; + } + + const totalOriginalBytesInModule = intermediateChunkSizes[moduleId]; + if (totalOriginalBytesInModule === 0) { + continue; + } + + for (const [originalInputPath, originalInputInfo] of Object.entries( + originalOutputEntry.inputs, + )) { + const proportion = originalInputInfo.bytesInOutput / totalOriginalBytesInModule; + const newBytesInOutput = Math.floor(renderedModule.renderedLength * proportion); + + const existing = newOutputInputs[originalInputPath]; + if (existing) { + existing.bytesInOutput += newBytesInOutput; + } else { + newOutputInputs[originalInputPath] = { bytesInOutput: newBytesInOutput }; + } + + if (!newMetafile.inputs[originalInputPath]) { + newMetafile.inputs[originalInputPath] = originalMetafile.inputs[originalInputPath]; + } + } + } + } + + const imports = [ + ...chunk.imports.map((path) => ({ path, kind: 'import-statement' as const })), + ...(chunk.dynamicImports?.map((path) => ({ path, kind: 'dynamic-import' as const })) ?? []), + ]; + + newMetafile.outputs[chunk.fileName] = { + bytes: Buffer.byteLength(chunk.code, 'utf8'), + inputs: newOutputInputs, + imports, + exports: chunk.exports ?? [], + entryPoint: + chunk.isEntry && chunk.facadeModuleId + ? originalMetafile.outputs[chunk.facadeModuleId]?.entryPoint + : undefined, + }; + } + + return newMetafile; +} + +/** + * Creates an InitialFileRecord object with a specified depth. + * @param depth The depth of the file in the dependency graph. + * @returns An InitialFileRecord object. + */ +function createInitialFileRecord(depth: number): InitialFileRecord { + return { + type: 'script', + entrypoint: false, + external: false, + serverFile: false, + depth, + }; +} + +/** + * Creates an esbuild message object for a chunk optimization failure. + * @param message The error message detailing the cause of the failure. + * @returns A partial esbuild message object. + */ +function createChunkOptimizationFailureMessage(message: string): Message { + // Most of these fields are not actually needed for printing the error + return { + id: '', + text: 'Chunk optimization failed', + detail: undefined, + pluginName: '', + location: null, + notes: [ + { + text: message, + location: null, + }, + ], + }; +} + +/** + * Optimizes the chunks of a build result using rolldown. + * + * This function takes the output of an esbuild build, identifies the main browser entry point, + * and uses rolldown to bundle and optimize the JavaScript chunks. The optimized chunks + * replace the original ones in the build result, and the metafile is updated to reflect + * the changes. + * + * @param original The original build result from esbuild. + * @param sourcemap A boolean or 'hidden' to control sourcemap generation. + * @returns A promise that resolves to the updated build result with optimized chunks. + */ export async function optimizeChunks( original: BundleContextResult, sourcemap: boolean | 'hidden', @@ -40,8 +191,8 @@ export async function optimizeChunks( } } - // No action required if no browser main entrypoint - if (!mainFile) { + // No action required if no browser main entrypoint or metafile for stats + if (!mainFile || !original.metafile) { return original; } @@ -65,7 +216,7 @@ export async function optimizeChunks( let bundle; let optimizedOutput; try { - bundle = await rollup({ + bundle = await rolldown({ input: mainFile, plugins: [ { @@ -101,7 +252,7 @@ export async function optimizeChunks( }); const result = await bundle.generate({ - compact: true, + minify: { mangle: false, compress: false }, sourcemap, chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`, }); @@ -110,28 +261,30 @@ export async function optimizeChunks( assertIsError(e); return { - errors: [ - // Most of these fields are not actually needed for printing the error - { - id: '', - text: 'Chunk optimization failed', - detail: undefined, - pluginName: '', - location: null, - notes: [ - { - text: e.message, - location: null, - }, - ], - }, - ], + errors: [createChunkOptimizationFailureMessage(e.message)], warnings: original.warnings, }; } finally { await bundle?.close(); } + // Update metafile + const newMetafile = rolldownToEsbuildMetafile(optimizedOutput, original.metafile); + // Add back the outputs that were not part of the optimization + for (const [path, output] of Object.entries(original.metafile.outputs)) { + if (usedChunks.has(path)) { + continue; + } + + newMetafile.outputs[path] = output; + for (const inputPath of Object.keys(output.inputs)) { + if (!newMetafile.inputs[inputPath]) { + newMetafile.inputs[inputPath] = original.metafile.inputs[inputPath]; + } + } + } + original.metafile = newMetafile; + // Remove used chunks and associated sourcemaps from the original result original.outputFiles = original.outputFiles.filter( (file) => @@ -192,13 +345,7 @@ export async function optimizeChunks( continue; } - const record: InitialFileRecord = { - type: 'script', - entrypoint: false, - external: false, - serverFile: false, - depth: entryRecord.depth + 1, - }; + const record = createInitialFileRecord(entryRecord.depth + 1); entriesToAnalyze.push([importPath, record]); } diff --git a/packages/angular/build/src/builders/application/index.ts b/packages/angular/build/src/builders/application/index.ts index 80261c41277f..b83e3b48f270 100644 --- a/packages/angular/build/src/builders/application/index.ts +++ b/packages/angular/build/src/builders/application/index.ts @@ -14,7 +14,7 @@ import { BuildOutputFileType } from '../../tools/esbuild/bundler-context'; import { createJsonBuildManifest, emitFilesToDisk } from '../../tools/esbuild/utils'; import { colors as ansiColors } from '../../utils/color'; import { deleteOutputDir } from '../../utils/delete-output-dir'; -import { useJSONBuildLogs } from '../../utils/environment-options'; +import { bazelEsbuildPluginPath, useJSONBuildLogs } from '../../utils/environment-options'; import { purgeStaleBuildCache } from '../../utils/purge-cache'; import { assertCompatibleAngularVersion } from '../../utils/version'; import { runEsBuildBuildAction } from './build-action'; @@ -56,6 +56,14 @@ export async function* buildApplicationInternal( return; } + if (bazelEsbuildPluginPath) { + extensions ??= {}; + extensions.codePlugins ??= []; + + const { default: bazelEsbuildPlugin } = await import(bazelEsbuildPluginPath); + extensions.codePlugins.push(bazelEsbuildPlugin); + } + const normalizedOptions = await normalizeOptions(context, projectName, options, extensions); if (!normalizedOptions.outputOptions.ignoreServer) { @@ -109,7 +117,8 @@ export async function* buildApplicationInternal( const hasError = result.errors.length > 0; result.addLog( - `Application bundle generation ${hasError ? 'failed' : 'complete'}. [${buildTime.toFixed(3)} seconds]\n`, + `Application bundle generation ${hasError ? 'failed' : 'complete'}.` + + ` [${buildTime.toFixed(3)} seconds] - ${new Date().toISOString()}\n`, ); } diff --git a/packages/angular/build/src/builders/application/options.ts b/packages/angular/build/src/builders/application/options.ts index c3b13699a06e..83b7ea428f35 100644 --- a/packages/angular/build/src/builders/application/options.ts +++ b/packages/angular/build/src/builders/application/options.ts @@ -25,7 +25,7 @@ import { loadPostcssConfiguration, } from '../../utils/postcss-configuration'; import { getProjectRootPaths, normalizeDirectoryPath } from '../../utils/project-metadata'; -import { urlJoin } from '../../utils/url'; +import { addTrailingSlash, joinUrlParts, stripLeadingSlash } from '../../utils/url'; import { Schema as ApplicationBuilderOptions, ExperimentalPlatform, @@ -206,13 +206,22 @@ export async function normalizeOptions( } } - let loaderExtensions: Record | undefined; + let loaderExtensions: + | Record + | undefined; if (options.loader) { for (const [extension, value] of Object.entries(options.loader)) { if (extension[0] !== '.' || /\.[cm]?[jt]sx?$/.test(extension)) { continue; } - if (value !== 'text' && value !== 'binary' && value !== 'file' && value !== 'empty') { + if ( + value !== 'text' && + value !== 'binary' && + value !== 'file' && + value !== 'dataurl' && + value !== 'base64' && + value !== 'empty' + ) { continue; } loaderExtensions ??= {}; @@ -672,7 +681,16 @@ export function getLocaleBaseHref( const baseHrefSuffix = localeData.baseHref ?? localeData.subPath + '/'; - return baseHrefSuffix !== '' ? urlJoin(baseHref, baseHrefSuffix) : undefined; + let joinedBaseHref: string | undefined; + if (baseHrefSuffix !== '') { + joinedBaseHref = addTrailingSlash(joinUrlParts(baseHref, baseHrefSuffix)); + + if (baseHref && baseHref[0] !== '/') { + joinedBaseHref = stripLeadingSlash(joinedBaseHref); + } + } + + return joinedBaseHref; } /** diff --git a/packages/angular/build/src/builders/application/options_spec.ts b/packages/angular/build/src/builders/application/options_spec.ts new file mode 100644 index 000000000000..ac6320905019 --- /dev/null +++ b/packages/angular/build/src/builders/application/options_spec.ts @@ -0,0 +1,106 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { NormalizedApplicationBuildOptions, getLocaleBaseHref } from './options'; + +describe('getLocaleBaseHref', () => { + const baseI18nOptions: NormalizedApplicationBuildOptions['i18nOptions'] = { + inlineLocales: new Set(), + sourceLocale: 'en-US', + locales: {}, + flatOutput: false, + shouldInline: false, + hasDefinedSourceLocale: false, + }; + + it('should return undefined if flatOutput is true', () => { + const result = getLocaleBaseHref(undefined, { ...baseI18nOptions, flatOutput: true }, 'fr'); + expect(result).toBeUndefined(); + }); + + it('should return undefined if locale is not found', () => { + const result = getLocaleBaseHref(undefined, baseI18nOptions, 'fr'); + expect(result).toBeUndefined(); + }); + + it('should return baseHref from locale data if present', () => { + const i18nOptions = { + ...baseI18nOptions, + locales: { + fr: { + files: [], + translation: {}, + subPath: 'fr', + baseHref: '/fr/', + }, + }, + }; + const result = getLocaleBaseHref(undefined, i18nOptions, 'fr'); + expect(result).toBe('/fr/'); + }); + + it('should join baseHref and locale subPath if baseHref is provided', () => { + const i18nOptions = { + ...baseI18nOptions, + locales: { + fr: { + files: [], + translation: {}, + subPath: 'fr', + }, + }, + }; + const result = getLocaleBaseHref('/app/', i18nOptions, 'fr'); + expect(result).toBe('/app/fr/'); + }); + + it('should handle missing baseHref (undefined) correctly', () => { + const i18nOptions = { + ...baseI18nOptions, + locales: { + fr: { + files: [], + translation: {}, + subPath: 'fr', + }, + }, + }; + const result = getLocaleBaseHref(undefined, i18nOptions, 'fr'); + expect(result).toBe('/fr/'); + }); + + it('should handle empty baseHref correctly', () => { + const i18nOptions = { + ...baseI18nOptions, + locales: { + fr: { + files: [], + translation: {}, + subPath: 'fr', + }, + }, + }; + const result = getLocaleBaseHref('', i18nOptions, 'fr'); + expect(result).toBe('/fr/'); + }); + + it('should strip leading slash if baseHref does not start with slash', () => { + const i18nOptions = { + ...baseI18nOptions, + locales: { + fr: { + files: [], + translation: {}, + subPath: 'fr', + }, + }, + }; + const result = getLocaleBaseHref('app/', i18nOptions, 'fr'); + expect(result).toBe('app/fr/'); + }); +}); diff --git a/packages/angular/build/src/builders/application/schema.json b/packages/angular/build/src/builders/application/schema.json index ef4cbb75b82a..8db4e6145b3f 100644 --- a/packages/angular/build/src/builders/application/schema.json +++ b/packages/angular/build/src/builders/application/schema.json @@ -6,7 +6,7 @@ "properties": { "assets": { "type": "array", - "description": "List of static application assets.", + "description": "Define the assets to be copied to the output directory. These assets are copied as-is without any further processing or hashing.", "default": [], "items": { "$ref": "#/definitions/assetPattern" @@ -279,10 +279,10 @@ ] }, "loader": { - "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.", + "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` inlines the content as a Base64-encoded string; `empty` considers the content to be empty and not include it in bundles.", "type": "object", "patternProperties": { - "^\\.\\S+$": { "enum": ["text", "binary", "file", "empty"] } + "^\\.\\S+$": { "enum": ["text", "binary", "file", "dataurl", "base64", "empty"] } } }, "define": { @@ -441,7 +441,7 @@ }, "outputHashing": { "type": "string", - "description": "Define the output filename cache-busting hashing mode.", + "description": "Define the output filename cache-busting hashing mode.\n\n- `none`: No hashing.\n- `all`: Hash for all output bundles. \n- `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in CSS files).\n- `bundles`: Hash for output of lazy and main bundles.", "default": "none", "enum": ["none", "all", "media", "bundles"] }, @@ -611,7 +611,7 @@ }, "outputMode": { "type": "string", - "description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR).", + "description": "Defines the type of build output artifact. 'static': Generates a static site build artifact for deployment on any static hosting service. 'server': Generates a server application build artifact, required for applications using hybrid rendering or APIs.", "enum": ["static", "server"] } }, diff --git a/packages/angular/build/src/builders/application/tests/behavior/component-stylesheets_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/component-stylesheets_spec.ts index ecc460bcb405..ddae750a64a4 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/component-stylesheets_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/component-stylesheets_spec.ts @@ -11,7 +11,7 @@ import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setu describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Behavior: "Component Stylesheets"', () => { - it('should successfuly compile with an empty inline style', async () => { + it('should successfully compile with an empty inline style', async () => { await harness.modifyFile('src/app/app.component.ts', (content) => { return content.replace('styleUrls', 'styles').replace('./app.component.css', ''); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/loader-import-attribute_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/loader-import-attribute_spec.ts index 2f360047b278..91c4cafc571a 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/loader-import-attribute_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/loader-import-attribute_spec.ts @@ -51,6 +51,41 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { harness.expectFile('dist/browser/main.js').content.not.toContain('ABC'); }); + it('should inline base64 content for file extension set to "base64"', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + }); + + await harness.writeFile('./src/a.unknown', 'ABC'); + await harness.writeFile( + 'src/main.ts', + '// @ts-expect-error\nimport contents from "./a.unknown" with { loader: "base64" };\n console.log(contents);', + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBe(true); + // Should contain the base64 encoding used esbuild and not the text content + harness.expectFile('dist/browser/main.js').content.toContain('QUJD'); + harness.expectFile('dist/browser/main.js').content.not.toContain('ABC'); + }); + + it('should inline dataurl content for file extension set to "dataurl"', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + }); + + await harness.writeFile('./src/a.svg', 'ABC'); + await harness.writeFile( + 'src/main.ts', + '// @ts-expect-error\nimport contents from "./a.svg" with { loader: "dataurl" };\n console.log(contents);', + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBe(true); + // Should contain the dataurl encoding used esbuild and not the text content + harness.expectFile('dist/browser/main.js').content.toContain('data:image/svg+xml,ABC'); + }); + it('should emit an output file for loader attribute set to "file"', async () => { harness.useTarget('build', { ...BASE_OPTIONS, diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-assets_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-assets_spec.ts index a48c19fd1baf..7bfcca94d242 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-assets_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-assets_spec.ts @@ -6,16 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; -/** - * Maximum time in milliseconds for single build/rebuild - * This accounts for CI variability. - */ -const BUILD_TIMEOUT = 10_000; - describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Behavior: "Rebuilds when input asset changes"', () => { beforeEach(async () => { @@ -36,30 +29,18 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { watch: true, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/asset.txt').content.toContain('foo'); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBeTrue(); + harness.expectFile('dist/browser/asset.txt').content.toContain('foo'); - await harness.writeFile('public/asset.txt', 'bar'); - break; - case 1: - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/asset.txt').content.toContain('bar'); - break; - } - }), - take(2), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(2); + await harness.writeFile('public/asset.txt', 'bar'); + }, + ({ result }) => { + expect(result?.success).toBeTrue(); + harness.expectFile('dist/browser/asset.txt').content.toContain('bar'); + }, + ]); }); it('remove deleted asset from output', async () => { @@ -79,32 +60,21 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { watch: true, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/asset-one.txt').toExist(); - harness.expectFile('dist/browser/asset-two.txt').toExist(); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBeTrue(); + harness.expectFile('dist/browser/asset-one.txt').toExist(); + harness.expectFile('dist/browser/asset-two.txt').toExist(); - await harness.removeFile('public/asset-two.txt'); - break; - case 1: - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/asset-one.txt').toExist(); - harness.expectFile('dist/browser/asset-two.txt').toNotExist(); - break; - } - }), - take(2), - count(), - ) - .toPromise(); + await harness.removeFile('public/asset-two.txt'); + }, - expect(buildCount).toBe(2); + ({ result }) => { + expect(result?.success).toBeTrue(); + harness.expectFile('dist/browser/asset-one.txt').toExist(); + harness.expectFile('dist/browser/asset-two.txt').toNotExist(); + }, + ]); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts index a252a0580d0b..26ae35a8221f 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; @@ -32,46 +31,31 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { await harness.writeFile('src/app/app.component.scss', "@import './a';"); await harness.writeFile('src/app/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); - const buildCount = await harness - .execute() - .pipe( - timeout(30000), - concatMap(async ({ result }, index) => { - expect(result?.success).toBe(true); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBe(true); - switch (index) { - case 0: - harness.expectFile('dist/browser/main.js').content.toContain('color: aqua'); - harness.expectFile('dist/browser/main.js').content.not.toContain('color: blue'); + harness.expectFile('dist/browser/main.js').content.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: blue'); - await harness.writeFile( - 'src/app/a.scss', - '$primary: blue;\\nh1 { color: $primary; }', - ); - break; - case 1: - harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/main.js').content.toContain('color: blue'); + await harness.writeFile('src/app/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); + }, + async ({ result }) => { + expect(result?.success).toBe(true); - await harness.writeFile( - 'src/app/a.scss', - '$primary: green;\\nh1 { color: $primary; }', - ); - break; - case 2: - harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/main.js').content.not.toContain('color: blue'); - harness.expectFile('dist/browser/main.js').content.toContain('color: green'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.toContain('color: blue'); - break; - } - }), - take(3), - count(), - ) - .toPromise(); + await harness.writeFile('src/app/a.scss', '$primary: green;\\nh1 { color: $primary; }'); + }, + ({ result }) => { + expect(result?.success).toBe(true); - expect(buildCount).toBe(3); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: blue'); + harness.expectFile('dist/browser/main.js').content.toContain('color: green'); + }, + ]); }); } }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts index 196cbf4e6b5d..fa384be88080 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts @@ -6,10 +6,14 @@ * found in the LICENSE file at https://angular.dev/license */ -import { logging } from '@angular-devkit/core'; -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { + APPLICATION_BUILDER_INFO, + BASE_OPTIONS, + describeBuilder, + expectLog, + expectNoLog, +} from '../setup'; /** * Maximum time in milliseconds for single build/rebuild @@ -73,85 +77,55 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { `, ); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result, logs }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBeTrue(); - // Update directive to use a different input type for 'foo' (number -> string) - // Should cause a template error - await harness.writeFile( - 'src/app/dir.ts', - ` + // Update directive to use a different input type for 'foo' (number -> string) + // Should cause a template error + await harness.writeFile( + 'src/app/dir.ts', + ` import { Directive, Input } from '@angular/core'; @Directive({ selector: 'dir', standalone: false }) export class Dir { @Input() foo: string; } `, - ); - - break; - case 1: - expect(result?.success).toBeFalse(); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(typeErrorText), - }), - ); - - // Make an unrelated change to verify error cache was updated - // Should persist error in the next rebuild - await harness.modifyFile('src/main.ts', (content) => content + '\n'); - - break; - case 2: - expect(result?.success).toBeFalse(); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(typeErrorText), - }), - ); - - // Revert the directive change that caused the error - // Should remove the error - await harness.writeFile('src/app/dir.ts', goodDirectiveContents); - - break; - case 3: - expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(typeErrorText), - }), - ); - - // Make an unrelated change to verify error cache was updated - // Should continue showing no error - await harness.modifyFile('src/main.ts', (content) => content + '\n'); - - break; - case 4: - expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(typeErrorText), - }), - ); - - break; - } - }), - take(5), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(5); + ); + }, + async ({ result, logs }) => { + expect(result?.success).toBeFalse(); + expectLog(logs, typeErrorText); + + // Make an unrelated change to verify error cache was updated + // Should persist error in the next rebuild + await harness.modifyFile('src/main.ts', (content) => content + '\n'); + }, + async ({ result, logs }) => { + expect(result?.success).toBeFalse(); + expectLog(logs, typeErrorText); + + // Revert the directive change that caused the error + // Should remove the error + await harness.writeFile('src/app/dir.ts', goodDirectiveContents); + }, + async ({ result, logs }) => { + expect(result?.success).toBeTrue(); + expectNoLog(logs, typeErrorText); + + // Make an unrelated change to verify error cache was updated + // Should continue showing no error + await harness.modifyFile('src/main.ts', (content) => content + '\n'); + }, + ({ result, logs }) => { + expect(result?.success).toBeTrue(); + expectNoLog(logs, typeErrorText); + }, + ], + { outputLogsOnFailure: false }, + ); }); it('detects cumulative block syntax errors', async () => { @@ -160,104 +134,49 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { watch: true, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ logs }, index) => { - switch (index) { - case 0: - // Add invalid block syntax - await harness.appendToFile('src/app/app.component.html', '@one'); - - break; - case 1: - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), - }), - ); - - // Make an unrelated change to verify error cache was updated - // Should persist error in the next rebuild - await harness.modifyFile('src/main.ts', (content) => content + '\n'); - - break; - case 2: - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), - }), - ); - - // Add more invalid block syntax - await harness.appendToFile('src/app/app.component.html', '@two'); - - break; - case 3: - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), - }), - ); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@two'), - }), - ); - - // Add more invalid block syntax - await harness.appendToFile('src/app/app.component.html', '@three'); - - break; - case 4: - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), - }), - ); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@two'), - }), - ); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@three'), - }), - ); - - // Revert the changes that caused the error - // Should remove the error - await harness.writeFile('src/app/app.component.html', '

GOOD

'); - - break; - case 5: - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@one'), - }), - ); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@two'), - }), - ); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringContaining('@three'), - }), - ); - - break; - } - }), - take(6), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(6); + await harness.executeWithCases( + [ + async () => { + // Add invalid block syntax + await harness.appendToFile('src/app/app.component.html', '@if-one'); + }, + async ({ logs }) => { + expectLog(logs, '@if-one'); + + // Make an unrelated change to verify error cache was updated + // Should persist error in the next rebuild + await harness.modifyFile('src/main.ts', (content) => content + '\n'); + }, + async ({ logs }) => { + expectLog(logs, '@if-one'); + + // Add more invalid block syntax + await harness.appendToFile('src/app/app.component.html', '@if-two'); + }, + async ({ logs }) => { + expectLog(logs, '@if-one'); + expectLog(logs, '@if-two'); + + // Add more invalid block syntax + await harness.appendToFile('src/app/app.component.html', '@if-three'); + }, + async ({ logs }) => { + expectLog(logs, '@if-one'); + expectLog(logs, '@if-two'); + expectLog(logs, '@if-three'); + + // Revert the changes that caused the error + // Should remove the error + await harness.writeFile('src/app/app.component.html', '

GOOD

'); + }, + ({ logs }) => { + expectNoLog(logs, '@if-one'); + expectNoLog(logs, '@if-two'); + expectNoLog(logs, '@if-three'); + }, + ], + { outputLogsOnFailure: false }, + ); }); it('recovers from component stylesheet error', async () => { @@ -267,46 +186,26 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { aot: false, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result, logs }, index) => { - switch (index) { - case 0: - await harness.writeFile('src/app/app.component.css', 'invalid-css-content'); - - break; - case 1: - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('invalid-css-content'), - }), - ); - - await harness.writeFile('src/app/app.component.css', 'p { color: green }'); - - break; - case 2: - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('invalid-css-content'), - }), - ); - - harness - .expectFile('dist/browser/main.js') - .content.toContain('p {\\n color: green;\\n}'); - - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases( + [ + async () => { + await harness.writeFile('src/app/app.component.css', 'invalid-css-content'); + }, + async ({ logs }) => { + expectLog(logs, 'invalid-css-content'); + + await harness.writeFile('src/app/app.component.css', 'p { color: green }'); + }, + ({ logs }) => { + expectNoLog(logs, 'invalid-css-content'); + + harness + .expectFile('dist/browser/main.js') + .content.toContain('p {\\n color: green;\\n}'); + }, + ], + { outputLogsOnFailure: false }, + ); }); it('recovers from component template error', async () => { @@ -315,59 +214,34 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { watch: true, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result, logs }, index) => { - switch (index) { - case 0: - // Missing ending `>` on the div will cause an error - await harness.appendToFile('src/app/app.component.html', '
Hello, world!({ - message: jasmine.stringMatching('Unexpected character "EOF"'), - }), - ); - - await harness.appendToFile('src/app/app.component.html', '>'); - - break; - case 2: - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('Unexpected character "EOF"'), - }), - ); - - harness.expectFile('dist/browser/main.js').content.toContain('Hello, world!'); - - // Make an additional valid change to ensure that rebuilds still trigger - await harness.appendToFile('src/app/app.component.html', '
Guten Tag
'); - - break; - case 3: - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('invalid-css-content'), - }), - ); - - harness.expectFile('dist/browser/main.js').content.toContain('Hello, world!'); - harness.expectFile('dist/browser/main.js').content.toContain('Guten Tag'); - - break; - } - }), - take(4), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(4); + await harness.executeWithCases( + [ + async () => { + // Missing ending `>` on the div will cause an error + await harness.appendToFile('src/app/app.component.html', '
Hello, world! { + expectLog(logs, 'Unexpected character "EOF"'); + + await harness.appendToFile('src/app/app.component.html', '>'); + }, + async ({ logs }) => { + expectNoLog(logs, 'Unexpected character "EOF"'); + + harness.expectFile('dist/browser/main.js').content.toContain('Hello, world!'); + + // Make an additional valid change to ensure that rebuilds still trigger + await harness.appendToFile('src/app/app.component.html', '
Guten Tag
'); + }, + ({ logs }) => { + expectNoLog(logs, 'invalid-css-content'); + + harness.expectFile('dist/browser/main.js').content.toContain('Hello, world!'); + harness.expectFile('dist/browser/main.js').content.toContain('Guten Tag'); + }, + ], + { outputLogsOnFailure: false }, + ); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-general_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-general_spec.ts index ca88f94e5b63..d9ea8870f687 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-general_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-general_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; @@ -45,68 +44,54 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { `, ); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result, logs }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/main.js').content.toContain('FILE-A'); - - // Delete the imported file - await harness.removeFile('src/app/file-a.ts'); - - break; - case 1: - // Should fail from missing import - expect(result?.success).toBeFalse(); - - // Remove the failing import - await harness.modifyFile('src/app/app.component.ts', (content) => - content.replace(`import './file-a';`, ''), - ); - - break; - case 2: - expect(result?.success).toBeTrue(); - - harness.expectFile('dist/browser/main.js').content.not.toContain('FILE-A'); - - // Recreate the file and the import - await harness.writeFile('src/app/file-a.ts', fileAContent); - await harness.modifyFile( - 'src/app/app.component.ts', - (content) => `import './file-a';\n` + content, - ); - - break; - case 3: - expect(result?.success).toBeTrue(); - - harness.expectFile('dist/browser/main.js').content.toContain('FILE-A'); - - // Change the imported file - await harness.modifyFile('src/app/file-a.ts', (content) => - content.replace('FILE-A', 'FILE-B'), - ); - - break; - case 4: - expect(result?.success).toBeTrue(); - - harness.expectFile('dist/browser/main.js').content.toContain('FILE-B'); - - break; - } - }), - take(5), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(5); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBeTrue(); + harness.expectFile('dist/browser/main.js').content.toContain('FILE-A'); + + // Delete the imported file + await harness.removeFile('src/app/file-a.ts'); + }, + async ({ result }) => { + // Should fail from missing import + expect(result?.success).toBeFalse(); + + // Remove the failing import + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace(`import './file-a';`, ''), + ); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + + harness.expectFile('dist/browser/main.js').content.not.toContain('FILE-A'); + + // Recreate the file and the import + await harness.writeFile('src/app/file-a.ts', fileAContent); + await harness.modifyFile( + 'src/app/app.component.ts', + (content) => `import './file-a';\n` + content, + ); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + + harness.expectFile('dist/browser/main.js').content.toContain('FILE-A'); + + // Change the imported file + await harness.modifyFile('src/app/file-a.ts', (content) => + content.replace('FILE-A', 'FILE-B'), + ); + }, + ({ result }) => { + expect(result?.success).toBeTrue(); + + harness.expectFile('dist/browser/main.js').content.toContain('FILE-B'); + }, + ], + { outputLogsOnFailure: false }, + ); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-global_styles_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-global_styles_spec.ts index e58b2e031a90..22c4c32202bd 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-global_styles_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-global_styles_spec.ts @@ -6,16 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; -/** - * Maximum time in milliseconds for single build/rebuild - * This accounts for CI variability. - */ -export const BUILD_TIMEOUT = 30_000; - describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Behavior: "Rebuilds when global stylesheets change"', () => { beforeEach(async () => { @@ -33,41 +26,31 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { await harness.writeFile('src/styles.scss', "@import './a';"); await harness.writeFile('src/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(30000), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/styles.css').content.toContain('color: aqua'); - harness.expectFile('dist/browser/styles.css').content.not.toContain('color: blue'); - - await harness.writeFile( - 'src/a.scss', - 'invalid-invalid-invalid\\nh1 { color: $primary; }', - ); - break; - case 1: - expect(result?.success).toBe(false); - - await harness.writeFile('src/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); - break; - case 2: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/styles.css').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/styles.css').content.toContain('color: blue'); - - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/styles.css').content.toContain('color: aqua'); + harness.expectFile('dist/browser/styles.css').content.not.toContain('color: blue'); + + await harness.writeFile( + 'src/a.scss', + 'invalid-invalid-invalid\\nh1 { color: $primary; }', + ); + }, + async ({ result }) => { + expect(result?.success).toBe(false); + + await harness.writeFile('src/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); + }, + ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/styles.css').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/styles.css').content.toContain('color: blue'); + }, + ], + { outputLogsOnFailure: false }, + ); }); it('rebuilds Sass stylesheet after error on initial build from import', async () => { @@ -80,37 +63,28 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { await harness.writeFile('src/styles.scss', "@import './a';"); await harness.writeFile('src/a.scss', 'invalid-invalid-invalid\\nh1 { color: $primary; }'); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(30000), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBe(false); - - await harness.writeFile('src/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); - break; - case 1: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/styles.css').content.toContain('color: aqua'); - harness.expectFile('dist/browser/styles.css').content.not.toContain('color: blue'); - - await harness.writeFile('src/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); - break; - case 2: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/styles.css').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/styles.css').content.toContain('color: blue'); - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBe(false); + + await harness.writeFile('src/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); + }, + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/styles.css').content.toContain('color: aqua'); + harness.expectFile('dist/browser/styles.css').content.not.toContain('color: blue'); + + await harness.writeFile('src/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); + }, + ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/styles.css').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/styles.css').content.toContain('color: blue'); + }, + ], + { outputLogsOnFailure: false }, + ); }); it('rebuilds dependent Sass stylesheets after error on initial build from import', async () => { @@ -127,45 +101,36 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { await harness.writeFile('src/other.scss', "@import './a'; h1 { color: green; }"); await harness.writeFile('src/a.scss', 'invalid-invalid-invalid\\nh1 { color: $primary; }'); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(30000), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBe(false); - - await harness.writeFile('src/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); - break; - case 1: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/styles.css').content.toContain('color: aqua'); - harness.expectFile('dist/browser/styles.css').content.not.toContain('color: blue'); - - harness.expectFile('dist/browser/other.css').content.toContain('color: green'); - harness.expectFile('dist/browser/other.css').content.toContain('color: aqua'); - harness.expectFile('dist/browser/other.css').content.not.toContain('color: blue'); - - await harness.writeFile('src/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); - break; - case 2: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/styles.css').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/styles.css').content.toContain('color: blue'); - - harness.expectFile('dist/browser/other.css').content.toContain('color: green'); - harness.expectFile('dist/browser/other.css').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/other.css').content.toContain('color: blue'); - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBe(false); + + await harness.writeFile('src/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); + }, + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/styles.css').content.toContain('color: aqua'); + harness.expectFile('dist/browser/styles.css').content.not.toContain('color: blue'); + + harness.expectFile('dist/browser/other.css').content.toContain('color: green'); + harness.expectFile('dist/browser/other.css').content.toContain('color: aqua'); + harness.expectFile('dist/browser/other.css').content.not.toContain('color: blue'); + + await harness.writeFile('src/a.scss', '$primary: blue;\\nh1 { color: $primary; }'); + }, + ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/styles.css').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/styles.css').content.toContain('color: blue'); + + harness.expectFile('dist/browser/other.css').content.toContain('color: green'); + harness.expectFile('dist/browser/other.css').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/other.css').content.toContain('color: blue'); + }, + ], + { outputLogsOnFailure: false }, + ); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-index-html_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-index-html_spec.ts index df9dbc6f0c93..99603bc98cee 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-index-html_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-index-html_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; @@ -29,43 +28,28 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { watch: true, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(30000), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/index.html').content.toContain('charset="utf-8"'); - - await harness.modifyFile('src/index.html', (content) => - content.replace('charset="utf-8"', 'abc'), - ); - break; - case 1: - expect(result?.success).toBe(true); - harness - .expectFile('dist/browser/index.html') - .content.not.toContain('charset="utf-8"'); - - await harness.modifyFile('src/index.html', (content) => - content.replace('abc', 'charset="utf-8"'), - ); - break; - case 2: - expect(result?.success).toBe(true); - harness.expectFile('dist/browser/index.html').content.toContain('charset="utf-8"'); - - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/index.html').content.toContain('charset="utf-8"'); + + await harness.modifyFile('src/index.html', (content) => + content.replace('charset="utf-8"', 'abc'), + ); + }, + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/index.html').content.not.toContain('charset="utf-8"'); + + await harness.modifyFile('src/index.html', (content) => + content.replace('abc', 'charset="utf-8"'), + ); + }, + ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/index.html').content.toContain('charset="utf-8"'); + }, + ]); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/rebuild-web-workers_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/rebuild-web-workers_spec.ts index 421e51f99f5b..2fdad10f8d8d 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/rebuild-web-workers_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/rebuild-web-workers_spec.ts @@ -6,16 +6,14 @@ * found in the LICENSE file at https://angular.dev/license */ -import { logging } from '@angular-devkit/core'; -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; - -/** - * Maximum time in milliseconds for single build/rebuild - * This accounts for CI variability. - */ -export const BUILD_TIMEOUT = 30_000; +import { + APPLICATION_BUILDER_INFO, + BASE_OPTIONS, + describeBuilder, + expectLog, + expectNoLog, +} from '../setup'; /** * A regular expression used to check if a built worker is correctly referenced in application code. @@ -56,84 +54,50 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { `, ); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result, logs }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); - - // Ensure built worker is referenced in the application code - harness - .expectFile('dist/browser/main.js') - .content.toMatch(REFERENCED_WORKER_REGEXP); - - // Update the worker file to be invalid syntax - await harness.writeFile('src/app/worker.ts', `asd;fj$3~kls;kd^(*fjlk;sdj---flk`); - - break; - case 1: - expect(result?.success).toBeFalse(); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(errorText), - }), - ); - - // Make an unrelated change to verify error cache was updated - // Should persist error in the next rebuild - await harness.modifyFile('src/main.ts', (content) => content + '\n'); - - break; - case 2: - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(errorText), - }), - ); - - // Revert the change that caused the error - // Should remove the error - await harness.writeFile('src/app/worker.ts', workerCodeFile); - - break; - case 3: - expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(errorText), - }), - ); - - // Make an unrelated change to verify error cache was updated - // Should continue showing no error - await harness.modifyFile('src/main.ts', (content) => content + '\n'); - - break; - case 4: - expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(errorText), - }), - ); - - // Ensure built worker is referenced in the application code - harness - .expectFile('dist/browser/main.js') - .content.toMatch(REFERENCED_WORKER_REGEXP); - - break; - } - }), - take(5), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(5); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBeTrue(); + + // Ensure built worker is referenced in the application code + harness.expectFile('dist/browser/main.js').content.toMatch(REFERENCED_WORKER_REGEXP); + + // Update the worker file to be invalid syntax + await harness.writeFile('src/app/worker.ts', `asd;fj$3~kls;kd^(*fjlk;sdj---flk`); + }, + async ({ result, logs }) => { + expect(result?.success).toBeFalse(); + expectLog(logs, errorText); + + // Make an unrelated change to verify error cache was updated + // Should persist error in the next rebuild + await harness.modifyFile('src/main.ts', (content) => content + '\n'); + }, + async ({ logs }) => { + expectLog(logs, errorText); + + // Revert the change that caused the error + // Should remove the error + await harness.writeFile('src/app/worker.ts', workerCodeFile); + }, + async ({ result, logs }) => { + expect(result?.success).toBeTrue(); + expectNoLog(logs, errorText); + + // Make an unrelated change to verify error cache was updated + // Should continue showing no error + await harness.modifyFile('src/main.ts', (content) => content + '\n'); + }, + ({ result, logs }) => { + expect(result?.success).toBeTrue(); + expectNoLog(logs, errorText); + + // Ensure built worker is referenced in the application code + harness.expectFile('dist/browser/main.js').content.toMatch(REFERENCED_WORKER_REGEXP); + }, + ], + { outputLogsOnFailure: false }, + ); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-lazy_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-lazy_spec.ts index c8dd39bfae5d..ba01e2a27dce 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-lazy_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-lazy_spec.ts @@ -6,11 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import type { logging } from '@angular-devkit/core'; -import { concatMap, count, firstValueFrom, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { OutputHashing } from '../../schema'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, expectLog } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { beforeEach(async () => { @@ -42,51 +40,33 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { ssr: true, }); - const buildCount = await firstValueFrom( - harness.execute({ outputLogsOnFailure: false }).pipe( - timeout(30_000), - concatMap(async ({ result, logs }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBeTrue(); - // Add valid code - await harness.appendToFile('src/lazy.ts', `console.log('foo');`); + // Add valid code + await harness.appendToFile('src/lazy.ts', `console.log('foo');`); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); - break; - case 1: - expect(result?.success).toBeTrue(); + // Update type of 'foo' to invalid (number -> string) + await harness.writeFile('src/lazy.ts', `export const foo: string = 1;`); + }, + async ({ result, logs }) => { + expect(result?.success).toBeFalse(); + expectLog(logs, `Type 'number' is not assignable to type 'string'.`); - // Update type of 'foo' to invalid (number -> string) - await harness.writeFile('src/lazy.ts', `export const foo: string = 1;`); - - break; - case 2: - expect(result?.success).toBeFalse(); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching( - `Type 'number' is not assignable to type 'string'.`, - ), - }), - ); - - // Fix TS error - await harness.writeFile('src/lazy.ts', `export const foo: string = "1";`); - - break; - case 3: - expect(result?.success).toBeTrue(); - - break; - } - }), - take(4), - count(), - ), + // Fix TS error + await harness.writeFile('src/lazy.ts', `export const foo: string = "1";`); + }, + ({ result }) => { + expect(result?.success).toBeTrue(); + }, + ], + { outputLogsOnFailure: false }, ); - - expect(buildCount).toBe(4); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-touch-file_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-touch-file_spec.ts index 65f0540f2d1b..eeb160ebef47 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-touch-file_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/typescript-rebuild-touch-file_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; @@ -20,32 +19,23 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { aot, }); - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(30_000), - concatMap(async ({ result }, index) => { - switch (index) { - case 0: - expect(result?.success).toBeTrue(); - // Touch a file without doing any changes. - await harness.modifyFile('src/app/app.component.ts', (content) => content); - break; - case 1: - expect(result?.success).toBeTrue(); - await harness.removeFile('src/app/app.component.ts'); - break; - case 2: - expect(result?.success).toBeFalse(); - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases( + [ + async ({ result }) => { + expect(result?.success).toBeTrue(); + // Touch a file without doing any changes. + await harness.modifyFile('src/app/app.component.ts', (content) => content); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + await harness.removeFile('src/app/app.component.ts'); + }, + ({ result }) => { + expect(result?.success).toBeFalse(); + }, + ], + { outputLogsOnFailure: false }, + ); }); } }); diff --git a/packages/angular/build/src/builders/application/tests/behavior/typescript-resolve-json_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/typescript-resolve-json_spec.ts index e7d060de1262..cf21d5545f7a 100644 --- a/packages/angular/build/src/builders/application/tests/behavior/typescript-resolve-json_spec.ts +++ b/packages/angular/build/src/builders/application/tests/behavior/typescript-resolve-json_spec.ts @@ -20,6 +20,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { // Enable tsconfig resolveJsonModule option in tsconfig await harness.modifyFile('tsconfig.json', (content) => { const tsconfig = JSON.parse(content); + tsconfig.compilerOptions.moduleResolution = 'node'; tsconfig.compilerOptions.resolveJsonModule = true; return JSON.stringify(tsconfig); @@ -43,6 +44,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { // Enable tsconfig resolveJsonModule option in tsconfig await harness.modifyFile('tsconfig.json', (content) => { const tsconfig = JSON.parse(content); + tsconfig.compilerOptions.moduleResolution = 'node'; tsconfig.compilerOptions.resolveJsonModule = undefined; return JSON.stringify(tsconfig); @@ -71,6 +73,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { // Enable tsconfig resolveJsonModule option in tsconfig await harness.modifyFile('tsconfig.json', (content) => { const tsconfig = JSON.parse(content); + tsconfig.compilerOptions.moduleResolution = 'node'; tsconfig.compilerOptions.resolveJsonModule = false; return JSON.stringify(tsconfig); diff --git a/packages/angular/build/src/builders/application/tests/options/allowed-common-js-dependencies_spec.ts b/packages/angular/build/src/builders/application/tests/options/allowed-common-js-dependencies_spec.ts index ad29d985f712..bcc361ccdbe1 100644 --- a/packages/angular/build/src/builders/application/tests/options/allowed-common-js-dependencies_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/allowed-common-js-dependencies_spec.ts @@ -6,9 +6,14 @@ * found in the LICENSE file at https://angular.dev/license */ -import { logging } from '@angular-devkit/core'; import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { + APPLICATION_BUILDER_INFO, + BASE_OPTIONS, + describeBuilder, + expectLog, + expectNoLog, +} from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Option: "allowedCommonJsDependencies"', () => { @@ -30,22 +35,11 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching( - /Module 'buffer' used by 'src\/app\/app\.component\.ts' is not ESM/, - ), - }), - ); - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('base64-js'), - }), + expectLog(logs, /Module 'buffer' used by 'src\/app\/app\.component\.ts' is not ESM/); + expectLog(logs, /CommonJS or AMD dependencies/); + expectNoLog( + logs, + 'base64-js', 'Should not warn on transitive CommonJS packages which parent is also CommonJS.', ); }); @@ -70,11 +64,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); + expectNoLog(logs, /CommonJS or AMD dependencies/); }); it('should not show warning when all dependencies are allowed by wildcard', async () => { @@ -95,11 +85,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); + expectNoLog(logs, /CommonJS or AMD dependencies/); }); it('should not show warning when depending on zone.js', async () => { @@ -120,11 +106,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); + expectNoLog(logs, /CommonJS or AMD dependencies/); }); it(`should not show warning when importing non global local data '@angular/common/locale/fr'`, async () => { @@ -142,11 +124,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); + expectNoLog(logs, /CommonJS or AMD dependencies/); }); it('should not show warning in JIT for templateUrl and styleUrl when using paths', async () => { @@ -178,11 +156,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); + expectNoLog(logs, /CommonJS or AMD dependencies/); }); it('should not show warning for relative imports', async () => { @@ -198,11 +172,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/CommonJS or AMD dependencies/), - }), - ); + expectNoLog(logs, /CommonJS or AMD dependencies/); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/bundle-budgets_spec.ts b/packages/angular/build/src/builders/application/tests/options/bundle-budgets_spec.ts index 4614d5a5788e..40757365ce8e 100644 --- a/packages/angular/build/src/builders/application/tests/options/bundle-budgets_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/bundle-budgets_spec.ts @@ -6,13 +6,14 @@ * found in the LICENSE file at https://angular.dev/license */ -import { logging } from '@angular-devkit/core'; import { buildApplication } from '../../index'; import { Type } from '../../schema'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, + expectLog, + expectNoLog, lazyModuleFiles, lazyModuleFnImport, } from '../setup'; @@ -31,12 +32,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - level: 'warn', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectNoLog(logs, BUDGET_NOT_MET_REGEXP); }); it(`should error when size is above 'maximumError' threshold`, async () => { @@ -48,12 +44,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBeFalse(); - expect(logs).toContain( - jasmine.objectContaining({ - level: 'error', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectLog(logs, BUDGET_NOT_MET_REGEXP); }); it(`should warn when size is above 'maximumWarning' threshold`, async () => { @@ -65,12 +56,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ - level: 'warn', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectLog(logs, BUDGET_NOT_MET_REGEXP); }); it(`should warn when lazy bundle is above 'maximumWarning' threshold`, async () => { @@ -85,12 +71,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ - level: 'warn', - message: jasmine.stringMatching('lazy-module exceeded maximum budget'), - }), - ); + expectLog(logs, 'lazy-module exceeded maximum budget'); }); it(`should not warn when non-injected style is not within the baseline threshold`, async () => { @@ -118,12 +99,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - level: 'warn', - message: jasmine.stringMatching('lazy-styles failed to meet minimum budget'), - }), - ); + expectNoLog(logs, 'lazy-styles failed to meet minimum budget'); }); CSS_EXTENSIONS.forEach((ext) => { @@ -154,12 +130,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ - level: 'warn', - message: jasmine.stringMatching(new RegExp(`app.component.${ext}`)), - }), - ); + expectLog(logs, new RegExp(`app.component.${ext}`)); }); }); @@ -175,12 +146,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - level: 'error', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectNoLog(logs, BUDGET_NOT_MET_REGEXP); }); it(`when 'intial' budget`, async () => { @@ -194,12 +160,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - level: 'error', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectNoLog(logs, BUDGET_NOT_MET_REGEXP); }); it(`when 'all' budget`, async () => { @@ -213,12 +174,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - level: 'error', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectNoLog(logs, BUDGET_NOT_MET_REGEXP); }); it(`when 'any' budget`, async () => { @@ -232,12 +188,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce(); expect(result?.success).toBe(true); - expect(logs).not.toContain( - jasmine.objectContaining({ - level: 'error', - message: jasmine.stringMatching(BUDGET_NOT_MET_REGEXP), - }), - ); + expectNoLog(logs, BUDGET_NOT_MET_REGEXP); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/external-dependencies_spec.ts b/packages/angular/build/src/builders/application/tests/options/external-dependencies_spec.ts index feb9b6447c3b..deb55e172109 100644 --- a/packages/angular/build/src/builders/application/tests/options/external-dependencies_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/external-dependencies_spec.ts @@ -24,7 +24,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { .content.not.toMatch(/from ['"]@angular\/common['"]/); }); - it('should only externalize the listed depedencies when option is set', async () => { + it('should only externalize the listed dependencies when option is set', async () => { harness.useTarget('build', { ...BASE_OPTIONS, externalDependencies: ['@angular/core'], @@ -39,7 +39,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { .content.not.toMatch(/from ['"]@angular\/common['"]/); }); - it('should externalize the listed depedencies in Web Workers when option is set', async () => { + it('should externalize the listed dependencies in Web Workers when option is set', async () => { harness.useTarget('build', { ...BASE_OPTIONS, externalDependencies: ['path'], diff --git a/packages/angular/build/src/builders/application/tests/options/i18n-missing-translation_spec.ts b/packages/angular/build/src/builders/application/tests/options/i18n-missing-translation_spec.ts index d29c0a84adbc..90ac8206a1b8 100644 --- a/packages/angular/build/src/builders/application/tests/options/i18n-missing-translation_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/i18n-missing-translation_spec.ts @@ -7,7 +7,7 @@ */ import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, expectNoLog } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Option: "i18nMissingTranslation"', () => { @@ -131,11 +131,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('No translation found for'), - }), - ); + expectNoLog(logs, 'No translation found for'); }); it('should not error or warn when i18nMissingTranslation is set to error and all found', async () => { @@ -158,11 +154,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('No translation found for'), - }), - ); + expectNoLog(logs, 'No translation found for'); }); it('should not error or warn when i18nMissingTranslation is set to warning and all found', async () => { @@ -185,11 +177,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('No translation found for'), - }), - ); + expectNoLog(logs, 'No translation found for'); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/inline-style-language_spec.ts b/packages/angular/build/src/builders/application/tests/options/inline-style-language_spec.ts index 632bc6f1db7b..21a905c792d6 100644 --- a/packages/angular/build/src/builders/application/tests/options/inline-style-language_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/inline-style-language_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { buildApplication } from '../../index'; import { InlineStyleLanguage } from '../../schema'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; @@ -87,56 +86,38 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { content.replace('__STYLE_MARKER__', '$primary: indianred;\\nh1 { color: $primary; }'), ); - const buildCount = await harness - .execute() - .pipe( - timeout(30000), - concatMap(async ({ result }, index) => { - expect(result?.success).toBe(true); - - switch (index) { - case 0: - harness - .expectFile('dist/browser/main.js') - .content.toContain('color: indianred'); - harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); - - await harness.modifyFile('src/app/app.component.ts', (content) => - content.replace( - '$primary: indianred;\\nh1 { color: $primary; }', - '$primary: aqua;\\nh1 { color: $primary; }', - ), - ); - break; - case 1: - harness - .expectFile('dist/browser/main.js') - .content.not.toContain('color: indianred'); - harness.expectFile('dist/browser/main.js').content.toContain('color: aqua'); - - await harness.modifyFile('src/app/app.component.ts', (content) => - content.replace( - '$primary: aqua;\\nh1 { color: $primary; }', - '$primary: blue;\\nh1 { color: $primary; }', - ), - ); - break; - case 2: - harness - .expectFile('dist/browser/main.js') - .content.not.toContain('color: indianred'); - harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); - harness.expectFile('dist/browser/main.js').content.toContain('color: blue'); - - break; - } - }), - take(3), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(3); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/main.js').content.toContain('color: indianred'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); + + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace( + '$primary: indianred;\\nh1 { color: $primary; }', + '$primary: aqua;\\nh1 { color: $primary; }', + ), + ); + }, + async ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: indianred'); + harness.expectFile('dist/browser/main.js').content.toContain('color: aqua'); + + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace( + '$primary: aqua;\\nh1 { color: $primary; }', + '$primary: blue;\\nh1 { color: $primary; }', + ), + ); + }, + ({ result }) => { + expect(result?.success).toBe(true); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: indianred'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.toContain('color: blue'); + }, + ]); }); }); } diff --git a/packages/angular/build/src/builders/application/tests/options/loader_spec.ts b/packages/angular/build/src/builders/application/tests/options/loader_spec.ts index d7a6858d6e4b..2945df7bb4eb 100644 --- a/packages/angular/build/src/builders/application/tests/options/loader_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/loader_spec.ts @@ -108,6 +108,55 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { harness.expectFile('dist/browser/main.js').content.not.toContain('ABC'); }); + it('should inline base64 content for file extension set to "base64"', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + loader: { + '.unknown': 'base64', + }, + }); + + await harness.writeFile( + './src/types.d.ts', + 'declare module "*.unknown" { const content: string; export default content; }', + ); + await harness.writeFile('./src/a.unknown', 'ABC'); + await harness.writeFile( + 'src/main.ts', + 'import contents from "./a.unknown";\n console.log(contents);', + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBe(true); + // Should contain the base64 encoding used esbuild and not the text content + harness.expectFile('dist/browser/main.js').content.toContain('QUJD'); + harness.expectFile('dist/browser/main.js').content.not.toContain('ABC'); + }); + + it('should inline dataurl content for file extension set to "dataurl"', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + loader: { + '.svg': 'dataurl', + }, + }); + + await harness.writeFile( + './src/types.d.ts', + 'declare module "*.svg" { const content: string; export default content; }', + ); + await harness.writeFile('./src/a.svg', 'ABC'); + await harness.writeFile( + 'src/main.ts', + 'import contents from "./a.svg";\n console.log(contents);', + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBe(true); + // Should contain the dataurl encoding used esbuild and not the text content + harness.expectFile('dist/browser/main.js').content.toContain('data:image/svg+xml,ABC'); + }); + it('should emit an output file for file extension set to "file"', async () => { harness.useTarget('build', { ...BASE_OPTIONS, diff --git a/packages/angular/build/src/builders/application/tests/options/output-path_spec.ts b/packages/angular/build/src/builders/application/tests/options/output-path_spec.ts index f8d4513c7de7..b6c72b9bee58 100644 --- a/packages/angular/build/src/builders/application/tests/options/output-path_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/output-path_spec.ts @@ -10,30 +10,30 @@ import { buildApplication } from '../../index'; import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { - beforeEach(async () => { - // Add a global stylesheet media file - await harness.writeFile('src/styles.css', `h1 { background: url('./spectrum.png')}`); - // Add a component stylesheet media file - await harness.writeFile('src/app/abc.svg', ''); - await harness.writeFile('src/app/app.component.css', `h2 { background: url('./abc.svg')}`); - - // Enable SSR - await harness.modifyFile('src/tsconfig.app.json', (content) => { - const tsConfig = JSON.parse(content); - tsConfig.files ??= []; - tsConfig.files.push('main.server.ts', 'server.ts'); + describe('Option: "outputPath"', () => { + beforeEach(async () => { + // Add a global stylesheet media file + await harness.writeFile('src/styles.css', `h1 { background: url('./spectrum.png')}`); + // Add a component stylesheet media file + await harness.writeFile('src/app/abc.svg', ''); + await harness.writeFile('src/app/app.component.css', `h2 { background: url('./abc.svg')}`); + + // Enable SSR + await harness.modifyFile('src/tsconfig.app.json', (content) => { + const tsConfig = JSON.parse(content); + tsConfig.files ??= []; + tsConfig.files.push('main.server.ts', 'server.ts'); + + return JSON.stringify(tsConfig); + }); - return JSON.stringify(tsConfig); + // Application server code is not needed in this test + await harness.writeFile('src/main.server.ts', `console.log('Hello!');`); + await harness.writeFile('src/server.ts', `console.log('Hello!');`); }); - // Application server code is not needed in this test - await harness.writeFile('src/main.server.ts', `console.log('Hello!');`); - await harness.writeFile('src/server.ts', `console.log('Hello!');`); - }); - - describe('Option: "outputPath"', () => { - describe(`when option value is is a string`, () => { - beforeEach(() => { + describe('when option value is a string', () => { + it('should emit browser, media and server files in their respective directories', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -44,34 +44,20 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { entry: 'src/server.ts', }, }); - }); - it(`should emit browser bundles in 'browser' directory`, async () => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); harness.expectFile('dist/browser/main.js').toExist(); - }); - - it(`should emit media files in 'browser/media' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/media/spectrum.png').toExist(); harness.expectFile('dist/browser/media/abc.svg').toExist(); - }); - - it(`should emit server bundles in 'server' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/server/server.mjs').toExist(); }); }); - describe(`when option value is an object`, () => { + describe('when option value is an object', () => { describe(`'media' is set to 'resources'`, () => { - beforeEach(() => { + it('should emit browser, media and server files in their respective directories', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -85,33 +71,19 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { entry: 'src/server.ts', }, }); - }); - it(`should emit browser bundles in 'browser' directory`, async () => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); harness.expectFile('dist/browser/main.js').toExist(); - }); - - it(`should emit media files in 'browser/resource' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/resource/spectrum.png').toExist(); harness.expectFile('dist/browser/resource/abc.svg').toExist(); - }); - - it(`should emit server bundles in 'server' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/server/server.mjs').toExist(); }); }); describe(`'media' is set to ''`, () => { - beforeEach(() => { + it('should emit browser, media and server files in their respective directories', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -125,36 +97,20 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { entry: 'src/server.ts', }, }); - }); - it(`should emit browser bundles in 'browser' directory`, async () => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); harness.expectFile('dist/browser/main.js').toExist(); - }); - - it(`should emit media files in 'browser' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/spectrum.png').toExist(); harness.expectFile('dist/browser/abc.svg').toExist(); - - // Component CSS should not be considered media - harness.expectFile('dist/browser/app.component.css').toNotExist(); - }); - - it(`should emit server bundles in 'server' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/server/server.mjs').toExist(); + harness.expectFile('dist/browser/app.component.css').toNotExist(); }); }); describe(`'server' is set to 'node-server'`, () => { - beforeEach(() => { + it('should emit browser, media and server files in their respective directories', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -168,33 +124,19 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { entry: 'src/server.ts', }, }); - }); - it(`should emit browser bundles in 'browser' directory`, async () => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); harness.expectFile('dist/browser/main.js').toExist(); - }); - - it(`should emit media files in 'browser/media' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/media/spectrum.png').toExist(); harness.expectFile('dist/browser/media/abc.svg').toExist(); - }); - - it(`should emit server bundles in 'node-server' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/node-server/server.mjs').toExist(); }); }); describe(`'browser' is set to 'public'`, () => { - beforeEach(() => { + it('should emit browser, media and server files in their respective directories', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -208,51 +150,19 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { entry: 'src/server.ts', }, }); - }); - it(`should emit browser bundles in 'public' directory`, async () => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); harness.expectFile('dist/public/main.js').toExist(); - }); - - it(`should emit media files in 'public/media' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/public/media/spectrum.png').toExist(); harness.expectFile('dist/public/media/abc.svg').toExist(); - }); - - it(`should emit server bundles in 'server' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/server/server.mjs').toExist(); }); }); describe(`'browser' is set to ''`, () => { - it(`should emit browser bundles in '' directory`, async () => { - harness.useTarget('build', { - ...BASE_OPTIONS, - polyfills: [], - server: 'src/main.server.ts', - outputPath: { - base: 'dist', - browser: '', - }, - ssr: false, - }); - - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - - harness.expectFile('dist/main.js').toExist(); - }); - - it(`should emit media files in 'media' directory`, async () => { + it('should emit browser and media files in the root output directory when ssr is disabled', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -268,11 +178,12 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); + harness.expectFile('dist/main.js').toExist(); harness.expectFile('dist/media/spectrum.png').toExist(); harness.expectFile('dist/media/abc.svg').toExist(); }); - it(`should error when ssr is enabled`, async () => { + it('should error when ssr is enabled', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -298,8 +209,8 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { }); }); - describe(`'server' is set ''`, () => { - beforeEach(() => { + describe(`'server' is set to ''`, () => { + it('should emit browser, media and server files in their respective directories', async () => { harness.useTarget('build', { ...BASE_OPTIONS, polyfills: [], @@ -313,27 +224,13 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { entry: 'src/server.ts', }, }); - }); - it(`should emit browser bundles in 'browser' directory`, async () => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); harness.expectFile('dist/browser/main.js').toExist(); - }); - - it(`should emit media files in 'browser/media' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/media/spectrum.png').toExist(); harness.expectFile('dist/browser/media/abc.svg').toExist(); - }); - - it(`should emit server bundles in '' directory`, async () => { - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/server.mjs').toExist(); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/polyfills_spec.ts b/packages/angular/build/src/builders/application/tests/options/polyfills_spec.ts index 290ea281208d..8b5cc3a09ab3 100644 --- a/packages/angular/build/src/builders/application/tests/options/polyfills_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/polyfills_spec.ts @@ -16,71 +16,75 @@ const testsVariants: [suitName: string, baseUrl: string | undefined][] = [ ]; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { - for (const [suitName, baseUrl] of testsVariants) { - describe(suitName, () => { - beforeEach(async () => { - await harness.modifyFile('tsconfig.json', (content) => { - const tsconfig = JSON.parse(content); - tsconfig.compilerOptions.baseUrl = baseUrl; - - return JSON.stringify(tsconfig); - }); - }); - - it('uses a provided TypeScript file', async () => { - harness.useTarget('build', { - ...BASE_OPTIONS, - polyfills: ['src/polyfills.ts'], + describe('Option: polyfills', () => { + for (const [suitName, baseUrl] of testsVariants) { + describe(suitName, () => { + beforeEach(async () => { + await harness.writeFile('src/main.ts', 'console.log("TEST");'); + + await harness.modifyFile('tsconfig.json', (content) => { + const tsconfig = JSON.parse(content); + tsconfig.compilerOptions.baseUrl = baseUrl; + + return JSON.stringify(tsconfig); + }); }); - const { result } = await harness.executeOnce(); + it('uses a provided TypeScript file', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + polyfills: ['src/polyfills.ts'], + }); - expect(result?.success).toBe(true); - - harness.expectFile('dist/browser/polyfills.js').toExist(); - }); + const { result } = await harness.executeOnce(); - it('uses a provided JavaScript file', async () => { - await harness.writeFile('src/polyfills.js', `console.log('main');`); + expect(result?.success).toBe(true); - harness.useTarget('build', { - ...BASE_OPTIONS, - polyfills: ['src/polyfills.js'], + harness.expectFile('dist/browser/polyfills.js').toExist(); }); - const { result } = await harness.executeOnce(); + it('uses a provided JavaScript file', async () => { + await harness.writeFile('src/polyfills.js', `console.log('main');`); - expect(result?.success).toBe(true); + harness.useTarget('build', { + ...BASE_OPTIONS, + polyfills: ['src/polyfills.js'], + }); - harness.expectFile('dist/browser/polyfills.js').content.toContain(`console.log("main")`); - }); + const { result } = await harness.executeOnce(); + + expect(result?.success).toBe(true); - it('fails and shows an error when file does not exist', async () => { - harness.useTarget('build', { - ...BASE_OPTIONS, - polyfills: ['src/missing.ts'], + harness.expectFile('dist/browser/polyfills.js').content.toContain(`console.log("main")`); }); - const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); + it('fails and shows an error when file does not exist', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + polyfills: ['src/missing.ts'], + }); - expect(result?.success).toBe(false); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching('Could not resolve') }), - ); + const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); - harness.expectFile('dist/browser/polyfills.js').toNotExist(); - }); + expect(result?.success).toBe(false); + expect(logs).toContain( + jasmine.objectContaining({ message: jasmine.stringMatching('Could not resolve') }), + ); - it('resolves module specifiers in array', async () => { - harness.useTarget('build', { - ...BASE_OPTIONS, - polyfills: ['zone.js', 'zone.js/testing'], + harness.expectFile('dist/browser/polyfills.js').toNotExist(); }); - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - harness.expectFile('dist/browser/polyfills.js').toExist(); + it('resolves module specifiers in array', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + polyfills: ['zone.js', 'zone.js/testing'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('dist/browser/polyfills.js').toExist(); + }); }); - }); - } + } + }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/scripts_spec.ts b/packages/angular/build/src/builders/application/tests/options/scripts_spec.ts index 757ff81acbac..dde35f851159 100644 --- a/packages/angular/build/src/builders/application/tests/options/scripts_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/scripts_spec.ts @@ -7,7 +7,7 @@ */ import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, expectLog } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Option: "scripts"', () => { @@ -145,9 +145,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching(/scripts\.js.+\d+ bytes/) }), - ); + expectLog(logs, /scripts\.js.+\d+ bytes/); }); }); @@ -412,9 +410,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching(/scripts\.js.+\d+ bytes/) }), - ); + expectLog(logs, /scripts\.js.+\d+ bytes/); }); it('shows the output script as a chunk entry with bundleName in the logging output', async () => { @@ -429,9 +425,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching(/extra\.js.+\d+ bytes/) }), - ); + expectLog(logs, /extra\.js.+\d+ bytes/); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/style-preprocessor-options-sass_spec.ts b/packages/angular/build/src/builders/application/tests/options/style-preprocessor-options-sass_spec.ts index 33c1d1cc9a4b..a3da36606825 100644 --- a/packages/angular/build/src/builders/application/tests/options/style-preprocessor-options-sass_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/style-preprocessor-options-sass_spec.ts @@ -7,8 +7,7 @@ */ import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; -import { logging } from '@angular-devkit/core'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, expectNoLog } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Option: "stylePreprocessorOptions.sass"', () => { @@ -28,11 +27,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); expect(result?.success).toBeFalse(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('darken() is deprecated'), - }), - ); + expectNoLog(logs, 'darken() is deprecated'); }); it('should succeed without `fatalDeprecations` despite using deprecated color functions', async () => { @@ -79,11 +74,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { }); expect(result?.success).toBeFalse(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('darken() is deprecated'), - }), - ); + expectNoLog(logs, 'darken() is deprecated'); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/styles_spec.ts b/packages/angular/build/src/builders/application/tests/options/styles_spec.ts index eb8d973ae904..311b0037daa5 100644 --- a/packages/angular/build/src/builders/application/tests/options/styles_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/styles_spec.ts @@ -7,7 +7,7 @@ */ import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, expectLog } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Option: "styles"', () => { @@ -147,9 +147,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching(/styles\.css.+\d+ bytes/) }), - ); + expectLog(logs, /styles\.css.+\d+ bytes/); }); }); @@ -440,9 +438,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching(/styles\.css.+\d+ bytes/) }), - ); + expectLog(logs, /styles\.css.+\d+ bytes/); }); it('shows the output style as a chunk entry with bundleName in the logging output', async () => { @@ -457,9 +453,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { expect(result?.success).toBe(true); - expect(logs).toContain( - jasmine.objectContaining({ message: jasmine.stringMatching(/extra\.css.+\d+ bytes/) }), - ); + expectLog(logs, /extra\.css.+\d+ bytes/); }); }); }); diff --git a/packages/angular/build/src/builders/application/tests/options/subresource-integrity_spec.ts b/packages/angular/build/src/builders/application/tests/options/subresource-integrity_spec.ts index 4afb87ebaed3..f3ec9476b21f 100644 --- a/packages/angular/build/src/builders/application/tests/options/subresource-integrity_spec.ts +++ b/packages/angular/build/src/builders/application/tests/options/subresource-integrity_spec.ts @@ -6,9 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import { logging } from '@angular-devkit/core'; import { buildApplication } from '../../index'; -import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder, expectNoLog } from '../setup'; describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { describe('Option: "subresourceIntegrity"', () => { @@ -64,11 +63,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { harness .expectFile('dist/browser/index.html') .content.toMatch(/integrity="\w+-[A-Za-z0-9/+=]+"/); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching(/subresource-integrity/), - }), - ); + expectNoLog(logs, /subresource-integrity/); }); }); }); diff --git a/packages/angular/build/src/builders/dev-server/builder.ts b/packages/angular/build/src/builders/dev-server/builder.ts index 4ea11d5f11e9..d75f999d84fd 100644 --- a/packages/angular/build/src/builders/dev-server/builder.ts +++ b/packages/angular/build/src/builders/dev-server/builder.ts @@ -18,7 +18,7 @@ import { import { normalizeOptions } from './options'; import type { DevServerBuilderOutput } from './output'; import type { Schema as DevServerBuilderOptions } from './schema'; -import { serveWithVite } from './vite-server'; +import { serveWithVite } from './vite'; /** * A Builder that executes a development server based on the provided browser target option. diff --git a/packages/angular/build/src/builders/dev-server/options.ts b/packages/angular/build/src/builders/dev-server/options.ts index 3e0f59319117..b6da278f2936 100644 --- a/packages/angular/build/src/builders/dev-server/options.ts +++ b/packages/angular/build/src/builders/dev-server/options.ts @@ -93,6 +93,7 @@ export async function normalizeOptions( poll, open, verbose, + define, watch, liveReload, hmr, @@ -114,6 +115,7 @@ export async function normalizeOptions( poll, open, verbose, + define, watch, liveReload: !!liveReload, hmr: hmr ?? !!liveReload, diff --git a/packages/angular/build/src/builders/dev-server/schema.json b/packages/angular/build/src/builders/dev-server/schema.json index 41902e43d8d0..023478ff7e52 100644 --- a/packages/angular/build/src/builders/dev-server/schema.json +++ b/packages/angular/build/src/builders/dev-server/schema.json @@ -53,6 +53,13 @@ } ] }, + "define": { + "description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "headers": { "type": "object", "description": "Custom HTTP headers to be added to all responses.", diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/build-assets_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/build-assets_spec.ts index c1ee820d6f1b..f7c7a0acb33a 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/build-assets_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/build-assets_spec.ts @@ -12,6 +12,11 @@ import { describeServeBuilder } from '../jasmine-helpers'; import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupTarget) => { + beforeEach(async () => { + // Application code is not needed for these tests + await harness.writeFile('src/main.ts', 'console.log("TEST");'); + }); + const javascriptFileContent = "import {foo} from 'unresolved'; /* a comment */const foo = `bar`;\n\n\n"; @@ -53,6 +58,42 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT expect(await response?.text()).toContain(javascriptFileContent); }); + it('serves a project CSS asset unmodified', async () => { + const cssFileContent = 'p { color: blue };'; + await harness.writeFile('src/extra.css', cssFileContent); + + setupTarget(harness, { + assets: ['src/extra.css'], + }); + + harness.useTarget('serve', { + ...BASE_OPTIONS, + }); + + const { result, response } = await executeOnceAndFetch(harness, 'extra.css'); + + expect(result?.success).toBeTrue(); + expect(await response?.text()).toBe(cssFileContent); + }); + + it('serves a project SCSS asset unmodified', async () => { + const cssFileContent = 'p { color: blue };'; + await harness.writeFile('src/extra.scss', cssFileContent); + + setupTarget(harness, { + assets: ['src/extra.scss'], + }); + + harness.useTarget('serve', { + ...BASE_OPTIONS, + }); + + const { result, response } = await executeOnceAndFetch(harness, 'extra.scss'); + + expect(result?.success).toBeTrue(); + expect(await response?.text()).toBe(cssFileContent); + }); + it('should return 404 for non existing assets', async () => { setupTarget(harness, { assets: [], diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/build-errors_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/build-errors_spec.ts index 82467da0d249..aa4763771fdd 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/build-errors_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/build-errors_spec.ts @@ -6,11 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { executeDevServer } from '../../index'; import { describeServeBuilder } from '../jasmine-helpers'; -import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup'; -import { logging } from '@angular-devkit/core'; +import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO, expectLog, expectNoLog } from '../setup'; describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupTarget) => { describe('Behavior: "Rebuild Error Detection"', () => { @@ -27,40 +25,22 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT // Missing ending `>` on the div will cause an error await harness.appendToFile('src/app/app.component.html', '
Hello, world! { - switch (index) { - case 0: - expect(result?.success).toBeFalse(); - debugger; - expect(logs).toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('Unexpected character "EOF"'), - }), - ); - - await harness.appendToFile('src/app/app.component.html', '>'); - - break; - case 1: - expect(result?.success).toBeTrue(); - expect(logs).not.toContain( - jasmine.objectContaining({ - message: jasmine.stringMatching('Unexpected character "EOF"'), - }), - ); - break; - } - }), - take(2), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(2); + await harness.executeWithCases( + [ + async ({ result, logs }) => { + expect(result?.success).toBeFalse(); + debugger; + expectLog(logs, 'Unexpected character "EOF"'); + + await harness.appendToFile('src/app/app.component.html', '>'); + }, + ({ result, logs }) => { + expect(result?.success).toBeTrue(); + expectNoLog(logs, 'Unexpected character "EOF"'); + }, + ], + { outputLogsOnFailure: false }, + ); }); }); }); diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/build_localize_replaced_watch_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/build_localize_replaced_watch_spec.ts index 9bc326ebe087..210dc01fc454 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/build_localize_replaced_watch_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/build_localize_replaced_watch_spec.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { executeDevServer } from '../../index'; import { describeServeBuilder } from '../jasmine-helpers'; -import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup'; +import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupTarget) => { describe('Behavior: "i18n $localize calls are replaced during watching"', () => { @@ -45,31 +44,24 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT `, ); - const buildCount = await harness - .execute() - .pipe( - timeout(BUILD_TIMEOUT * 2), - concatMap(async ({ result }, index) => { - expect(result?.success).toBe(true); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBe(true); - const response = await fetch(new URL('main.js', `${result?.baseUrl}`)); - expect(await response?.text()).not.toContain('$localize`:'); + const response = await fetch(new URL('main.js', `${result?.baseUrl}`)); + expect(await response?.text()).not.toContain('$localize`:'); - switch (index) { - case 0: { - await harness.modifyFile('src/app/app.component.html', (content) => - content.replace('introduction', 'intro'), - ); - break; - } - } - }), - take(2), - count(), - ) - .toPromise(); + await harness.modifyFile('src/app/app.component.html', (content) => + content.replace('introduction', 'intro'), + ); + }, + async ({ result }) => { + expect(result?.success).toBe(true); - expect(buildCount).toBe(2); + const response = await fetch(new URL('main.js', `${result?.baseUrl}`)); + expect(await response?.text()).not.toContain('$localize`:'); + }, + ]); }); }); }); diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/build_translation_watch_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/build_translation_watch_spec.ts index 00c652449db2..b7d65e52e966 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/build_translation_watch_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/build_translation_watch_spec.ts @@ -7,11 +7,10 @@ */ /* eslint-disable max-len */ -import { concatMap, count, take, timeout } from 'rxjs'; import { URL } from 'node:url'; import { executeDevServer } from '../../index'; import { describeServeBuilder } from '../jasmine-helpers'; -import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup'; +import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; describeServeBuilder( executeDevServer, @@ -30,7 +29,7 @@ describeServeBuilder( }, i18n: { locales: { - 'fr': 'src/locales/messages.fr.xlf', + fr: 'src/locales/messages.fr.xlf', }, }, }); @@ -53,38 +52,26 @@ describeServeBuilder( await harness.writeFile('src/locales/messages.fr.xlf', TRANSLATION_FILE_CONTENT); - const buildCount = await harness - .execute() - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result }, index) => { - expect(result?.success).toBe(true); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBe(true); - const mainUrl = new URL('main.js', `${result?.baseUrl}`); + const mainUrl = new URL('main.js', `${result?.baseUrl}`); + const response = await fetch(mainUrl); + expect(await response?.text()).toContain('Bonjour'); - switch (index) { - case 0: { - const response = await fetch(mainUrl); - expect(await response?.text()).toContain('Bonjour'); - - await harness.modifyFile('src/locales/messages.fr.xlf', (content) => - content.replace('Bonjour', 'Salut'), - ); - break; - } - case 1: { - const response = await fetch(mainUrl); - expect(await response?.text()).toContain('Salut'); - break; - } - } - }), - take(2), - count(), - ) - .toPromise(); + await harness.modifyFile('src/locales/messages.fr.xlf', (content) => + content.replace('Bonjour', 'Salut'), + ); + }, + async ({ result }) => { + expect(result?.success).toBe(true); - expect(buildCount).toBe(2); + const mainUrl = new URL('main.js', `${result?.baseUrl}`); + const response = await fetch(mainUrl); + expect(await response?.text()).toContain('Salut'); + }, + ]); }); }); }, diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts index 7617e31b45af..efdd749de258 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts @@ -6,16 +6,13 @@ * found in the LICENSE file at https://angular.dev/license */ -/* eslint-disable import/no-extraneous-dependencies */ -import { tags } from '@angular-devkit/core'; import { createServer } from 'node:http'; import { createProxyServer } from 'http-proxy'; import { AddressInfo } from 'node:net'; import puppeteer, { Browser, Page } from 'puppeteer'; -import { count, debounceTime, finalize, switchMap, take, timeout } from 'rxjs'; import { executeDevServer } from '../../index'; import { describeServeBuilder } from '../jasmine-helpers'; -import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup'; +import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; // eslint-disable-next-line @typescript-eslint/no-explicit-any declare const document: any; @@ -44,58 +41,58 @@ async function createProxy(target: string, secure: boolean, ws = true): Promise< target, secure, ssl: secure && { - key: tags.stripIndents` - -----BEGIN RSA PRIVATE KEY----- - MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt - CQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK - dRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF - gBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k - 9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy - 7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ - 3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5 - ZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU - faqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3 - /SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ - BnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/ - Xm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6 - XNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV - 6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj - 9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U - fZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P - nW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz - TU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV - HmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY - /16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX - JOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3 - zk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ - iGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml - amfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6 - Lof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW - QyvMqmN1kGy20SZbQDD/fLfqBQ== - -----END RSA PRIVATE KEY----- + key: ` +-----BEGIN RSA PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt +CQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK +dRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF +gBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k +9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy +7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ +3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5 +ZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU +faqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3 +/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ +BnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/ +Xm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6 +XNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV +6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj +9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U +fZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P +nW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz +TU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV +HmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY +/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX +JOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3 +zk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ +iGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml +amfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6 +Lof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW +QyvMqmN1kGy20SZbQDD/fLfqBQ== +-----END RSA PRIVATE KEY----- `, - cert: tags.stripIndents` - -----BEGIN CERTIFICATE----- - MIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV - BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX - aWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF - MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 - ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB - CgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1 - J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM - ie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU - E9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI - NmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS - tASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb - 3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw - DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72 - 6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg - LwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb - hek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+ - Zv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU - DDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I - 7Q== - -----END CERTIFICATE----- + cert: ` +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF +MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 +ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1 +J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM +ie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU +E9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI +NmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS +tASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb +3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw +DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72 +6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg +LwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb +hek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+ +Zv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU +DDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I +7Q== +-----END CERTIFICATE----- `, }, }).listen(proxyPort); @@ -108,8 +105,7 @@ async function createProxy(target: string, secure: boolean, ws = true): Promise< async function goToPageAndWaitForWS(page: Page, url: string): Promise { const baseUrl = url.replace(/^http/, 'ws'); - const socksRequest = - baseUrl[baseUrl.length - 1] === '/' ? `${baseUrl}ng-cli-ws` : `${baseUrl}/ng-cli-ws`; + const socksRequest = baseUrl.at(-1) === '/' ? `${baseUrl}ng-cli-ws` : `${baseUrl}/ng-cli-ws`; // Create a Chrome dev tools session so that we can capturing websocket request. // https://github.com/puppeteer/puppeteer/issues/2974 @@ -190,38 +186,24 @@ describeServeBuilder( await harness.writeFile('src/app/app.component.html', '

{{ title }}

'); - const buildCount = await harness - .execute() - .pipe( - debounceTime(1000), - timeout(BUILD_TIMEOUT * 2), - switchMap(async ({ result }, index) => { - expect(result?.success).toBeTrue(); - if (typeof result?.baseUrl !== 'string') { - throw new Error('Expected "baseUrl" to be a string.'); - } - - switch (index) { - case 0: - await goToPageAndWaitForWS(page, result.baseUrl); - await harness.modifyFile('src/app/app.component.ts', (content) => - content.replace(`'app'`, `'app-live-reload'`), - ); - break; - case 1: - const innerText = await page.evaluate( - () => document.querySelector('p').innerText, - ); - expect(innerText).toBe('app-live-reload'); - break; - } - }), - take(2), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(2); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBeTrue(); + if (typeof result?.baseUrl !== 'string') { + throw new Error('Expected "baseUrl" to be a string.'); + } + + await goToPageAndWaitForWS(page, result.baseUrl); + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace(`'app'`, `'app-live-reload'`), + ); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + const innerText = await page.evaluate(() => document.querySelector('p').innerText); + expect(innerText).toBe('app-live-reload'); + }, + ]); }); it('works without http -> http proxy', async () => { @@ -232,42 +214,29 @@ describeServeBuilder( await harness.writeFile('src/app/app.component.html', '

{{ title }}

'); let proxy: ProxyInstance | undefined; - const buildCount = await harness - .execute() - .pipe( - debounceTime(1000), - timeout(BUILD_TIMEOUT * 2), - switchMap(async ({ result }, index) => { + try { + await harness.executeWithCases([ + async ({ result }) => { expect(result?.success).toBeTrue(); if (typeof result?.baseUrl !== 'string') { throw new Error('Expected "baseUrl" to be a string.'); } - switch (index) { - case 0: - proxy = await createProxy(result.baseUrl, false); - await goToPageAndWaitForWS(page, proxy.url); - await harness.modifyFile('src/app/app.component.ts', (content) => - content.replace(`'app'`, `'app-live-reload'`), - ); - break; - case 1: - const innerText = await page.evaluate( - () => document.querySelector('p').innerText, - ); - expect(innerText).toBe('app-live-reload'); - break; - } - }), - take(2), - count(), - finalize(() => { - proxy?.server.close(); - }), - ) - .toPromise(); - - expect(buildCount).toBe(2); + proxy = await createProxy(result.baseUrl, false); + await goToPageAndWaitForWS(page, proxy.url); + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace(`'app'`, `'app-live-reload'`), + ); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + const innerText = await page.evaluate(() => document.querySelector('p').innerText); + expect(innerText).toBe('app-live-reload'); + }, + ]); + } finally { + proxy?.server.close(); + } }); it('works without https -> http proxy', async () => { @@ -278,42 +247,29 @@ describeServeBuilder( await harness.writeFile('src/app/app.component.html', '

{{ title }}

'); let proxy: ProxyInstance | undefined; - const buildCount = await harness - .execute() - .pipe( - debounceTime(1000), - timeout(BUILD_TIMEOUT * 2), - switchMap(async ({ result }, index) => { + try { + await harness.executeWithCases([ + async ({ result }) => { expect(result?.success).toBeTrue(); if (typeof result?.baseUrl !== 'string') { throw new Error('Expected "baseUrl" to be a string.'); } - switch (index) { - case 0: - proxy = await createProxy(result.baseUrl, true); - await goToPageAndWaitForWS(page, proxy.url); - await harness.modifyFile('src/app/app.component.ts', (content) => - content.replace(`'app'`, `'app-live-reload'`), - ); - break; - case 1: - const innerText = await page.evaluate( - () => document.querySelector('p').innerText, - ); - expect(innerText).toBe('app-live-reload'); - break; - } - }), - take(2), - count(), - finalize(() => { - proxy?.server.close(); - }), - ) - .toPromise(); - - expect(buildCount).toBe(2); + proxy = await createProxy(result.baseUrl, true); + await goToPageAndWaitForWS(page, proxy.url); + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace(`'app'`, `'app-live-reload'`), + ); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + const innerText = await page.evaluate(() => document.querySelector('p').innerText); + expect(innerText).toBe('app-live-reload'); + }, + ]); + } finally { + proxy?.server.close(); + } }); }, ); diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/serve_service-worker_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/serve_service-worker_spec.ts index f0a237cae51a..b3b63c3a3093 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/serve_service-worker_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/serve_service-worker_spec.ts @@ -6,11 +6,10 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, take, timeout } from 'rxjs'; import { executeDevServer } from '../../index'; import { executeOnceAndFetch } from '../execute-fetch'; import { describeServeBuilder } from '../jasmine-helpers'; -import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup'; +import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; const manifest = { index: '/index.html', @@ -57,7 +56,7 @@ describeServeBuilder( }, i18n: { sourceLocale: { - 'code': 'fr', + code: 'fr', }, }, }); @@ -176,48 +175,40 @@ describeServeBuilder( watch: true, }); - const buildCount = await harness - .execute() - .pipe( - timeout(BUILD_TIMEOUT), - concatMap(async ({ result }, index) => { - expect(result?.success).toBeTrue(); - const response = await fetch(new URL('ngsw.json', `${result?.baseUrl}`)); - const { hashTable } = (await response.json()) as { hashTable: object }; - const hashTableEntries = Object.keys(hashTable); - - switch (index) { - case 0: - expect(hashTableEntries).toEqual([ - '/assets/folder-asset.txt', - '/favicon.ico', - '/index.html', - '/media/spectrum.png', - ]); - - await harness.writeFile( - 'src/assets/folder-new-asset.txt', - harness.readFile('src/assets/folder-asset.txt'), - ); - break; - - case 1: - expect(hashTableEntries).toEqual([ - '/assets/folder-asset.txt', - '/assets/folder-new-asset.txt', - '/favicon.ico', - '/index.html', - '/media/spectrum.png', - ]); - break; - } - }), - take(2), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(2); + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBeTrue(); + const response = await fetch(new URL('ngsw.json', `${result?.baseUrl}`)); + const { hashTable } = (await response.json()) as { hashTable: object }; + const hashTableEntries = Object.keys(hashTable); + + expect(hashTableEntries).toEqual([ + '/assets/folder-asset.txt', + '/favicon.ico', + '/index.html', + '/media/spectrum.png', + ]); + + await harness.writeFile( + 'src/assets/folder-new-asset.txt', + harness.readFile('src/assets/folder-asset.txt'), + ); + }, + async ({ result }) => { + expect(result?.success).toBeTrue(); + const response = await fetch(new URL('ngsw.json', `${result?.baseUrl}`)); + const { hashTable } = (await response.json()) as { hashTable: object }; + const hashTableEntries = Object.keys(hashTable); + + expect(hashTableEntries).toEqual([ + '/assets/folder-asset.txt', + '/assets/folder-new-asset.txt', + '/favicon.ico', + '/index.html', + '/media/spectrum.png', + ]); + }, + ]); }); }); }, diff --git a/packages/angular/build/src/builders/dev-server/tests/execute-fetch.ts b/packages/angular/build/src/builders/dev-server/tests/execute-fetch.ts index ebbdcf3f1133..75a4e7935ebe 100644 --- a/packages/angular/build/src/builders/dev-server/tests/execute-fetch.ts +++ b/packages/angular/build/src/builders/dev-server/tests/execute-fetch.ts @@ -28,7 +28,7 @@ export async function executeOnceAndFetch( let content = undefined; if (executionResult.result?.success) { let baseUrl = `${executionResult.result.baseUrl}`; - baseUrl = baseUrl[baseUrl.length - 1] === '/' ? baseUrl : `${baseUrl}/`; + baseUrl = baseUrl.at(-1) === '/' ? baseUrl : `${baseUrl}/`; const resolvedUrl = new URL(url, baseUrl); const originalResponse = await fetch(resolvedUrl, options?.request); response = originalResponse.clone(); @@ -68,7 +68,7 @@ export async function executeOnceAndGet( let content = undefined; if (executionResult.result?.success) { let baseUrl = `${executionResult.result.baseUrl}`; - baseUrl = baseUrl[baseUrl.length - 1] === '/' ? baseUrl : `${baseUrl}/`; + baseUrl = baseUrl.at(-1) === '/' ? baseUrl : `${baseUrl}/`; const resolvedUrl = new URL(url, baseUrl); response = await new Promise((resolve) => diff --git a/packages/angular/build/src/builders/dev-server/tests/options/allowed-hosts_spec.ts b/packages/angular/build/src/builders/dev-server/tests/options/allowed-hosts_spec.ts index 8e96c7b4b4b0..775e057bece6 100644 --- a/packages/angular/build/src/builders/dev-server/tests/options/allowed-hosts_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/options/allowed-hosts_spec.ts @@ -10,6 +10,7 @@ import { executeDevServer } from '../../index'; import { executeOnceAndGet } from '../execute-fetch'; import { describeServeBuilder } from '../jasmine-helpers'; import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; +import { text } from 'node:stream/consumers'; const FETCH_HEADERS = Object.freeze({ Host: 'example.com' }); @@ -33,6 +34,7 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT expect(result?.success).toBeTrue(); expect(response?.statusCode).toBe(403); + expect(response && (await text(response))).toContain('angular.json'); }); it('does not allow an invalid host when option is an empty array', async () => { @@ -47,6 +49,7 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT expect(result?.success).toBeTrue(); expect(response?.statusCode).toBe(403); + expect(response && (await text(response))).toContain('angular.json'); }); it('allows a host when specified in the option', async () => { diff --git a/packages/angular/build/src/builders/dev-server/tests/options/define_spec.ts b/packages/angular/build/src/builders/dev-server/tests/options/define_spec.ts new file mode 100644 index 000000000000..3c6ea08e15b4 --- /dev/null +++ b/packages/angular/build/src/builders/dev-server/tests/options/define_spec.ts @@ -0,0 +1,92 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { executeDevServer } from '../../index'; +import { executeOnceAndFetch } from '../execute-fetch'; +import { describeServeBuilder } from '../jasmine-helpers'; +import { BASE_OPTIONS, DEV_SERVER_BUILDER_INFO } from '../setup'; + +describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupTarget) => { + describe('option: "define"', () => { + beforeEach(() => { + setupTarget(harness); + + // Application code + harness.writeFile( + 'src/main.ts', + ` + // @ts-ignore + console.log(TEST); + // @ts-ignore + console.log(BUILD); + // @ts-ignore + console.log(SERVE); + `, + ); + }); + + it('should replace global identifiers in the application', async () => { + harness.useTarget('serve', { + ...BASE_OPTIONS, + define: { + TEST: JSON.stringify('test123'), + }, + }); + + const { result, response } = await executeOnceAndFetch(harness, '/main.js'); + + expect(result?.success).toBeTrue(); + const content = await response?.text(); + expect(content).toContain('console.log("test123")'); + }); + + it('should merge "define" option from dev-server and build', async () => { + harness.modifyTarget('build', (options) => { + options.define = { + BUILD: JSON.stringify('build'), + }; + }); + + harness.useTarget('serve', { + ...BASE_OPTIONS, + define: { + SERVE: JSON.stringify('serve'), + }, + }); + + const { result, response } = await executeOnceAndFetch(harness, '/main.js'); + + expect(result?.success).toBeTrue(); + const content = await response?.text(); + expect(content).toContain('console.log("build")'); + expect(content).toContain('console.log("serve")'); + }); + + it('should overwrite "define" option from build with the one from dev-server', async () => { + harness.modifyTarget('build', (options) => { + options.define = { + TEST: JSON.stringify('build'), + }; + }); + + harness.useTarget('serve', { + ...BASE_OPTIONS, + define: { + TEST: JSON.stringify('serve'), + }, + }); + + const { result, response } = await executeOnceAndFetch(harness, '/main.js'); + + expect(result?.success).toBeTrue(); + const content = await response?.text(); + expect(content).toContain('console.log("serve")'); + expect(content).not.toContain('console.log("build")'); + }); + }); +}); diff --git a/packages/angular/build/src/builders/dev-server/vite-server.ts b/packages/angular/build/src/builders/dev-server/vite-server.ts deleted file mode 100644 index b09775c4a312..000000000000 --- a/packages/angular/build/src/builders/dev-server/vite-server.ts +++ /dev/null @@ -1,964 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import type { ɵdestroyAngularServerApp as destroyAngularServerApp } from '@angular/ssr'; -import type { BuilderContext } from '@angular-devkit/architect'; -import type { Plugin } from 'esbuild'; -import assert from 'node:assert'; -import { readFile } from 'node:fs/promises'; -import { builtinModules, isBuiltin } from 'node:module'; -import { join } from 'node:path'; -import type { Connect, InlineConfig, ViteDevServer } from 'vite'; -import type { ComponentStyleRecord } from '../../tools/vite/middlewares'; -import { - ServerSsrMode, - createAngularLocaleDataPlugin, - createAngularMemoryPlugin, - createAngularSetupMiddlewaresPlugin, - createAngularSsrTransformPlugin, - createRemoveIdPrefixPlugin, -} from '../../tools/vite/plugins'; -import { EsbuildLoaderOption, getDepOptimizationConfig } from '../../tools/vite/utils'; -import { loadProxyConfiguration, normalizeSourceMaps } from '../../utils'; -import { useComponentStyleHmr, useComponentTemplateHmr } from '../../utils/environment-options'; -import { loadEsmModule } from '../../utils/load-esm'; -import { Result, ResultFile, ResultKind } from '../application/results'; -import { - type ApplicationBuilderInternalOptions, - BuildOutputFileType, - type ExternalResultMetadata, - JavaScriptTransformer, - getSupportedBrowsers, - isZonelessApp, - transformSupportedBrowsersToTargets, -} from './internal'; -import type { NormalizedDevServerOptions } from './options'; -import type { DevServerBuilderOutput } from './output'; - -interface OutputFileRecord { - contents: Uint8Array; - size: number; - hash: string; - updated: boolean; - servable: boolean; - type: BuildOutputFileType; -} - -interface OutputAssetRecord { - source: string; - updated: boolean; -} - -interface DevServerExternalResultMetadata extends Omit { - explicitBrowser: string[]; - explicitServer: string[]; -} - -export type BuilderAction = ( - options: ApplicationBuilderInternalOptions, - context: BuilderContext, - plugins?: Plugin[], -) => AsyncIterable; - -/** - * Build options that are also present on the dev server but are only passed - * to the build. - */ -const CONVENIENCE_BUILD_OPTIONS = ['watch', 'poll', 'verbose'] as const; - -// eslint-disable-next-line max-lines-per-function -export async function* serveWithVite( - serverOptions: NormalizedDevServerOptions, - builderName: string, - builderAction: BuilderAction, - context: BuilderContext, - transformers?: { - indexHtml?: (content: string) => Promise; - }, - extensions?: { - middleware?: Connect.NextHandleFunction[]; - buildPlugins?: Plugin[]; - }, -): AsyncIterableIterator { - // Get the browser configuration from the target name. - const rawBrowserOptions = await context.getTargetOptions(serverOptions.buildTarget); - - // Deploy url is not used in the dev-server. - delete rawBrowserOptions.deployUrl; - - // Copy convenience options to build - for (const optionName of CONVENIENCE_BUILD_OPTIONS) { - const optionValue = serverOptions[optionName]; - if (optionValue !== undefined) { - rawBrowserOptions[optionName] = optionValue; - } - } - - // TODO: Adjust architect to not force a JsonObject derived return type - const browserOptions = (await context.validateOptions( - rawBrowserOptions, - builderName, - )) as unknown as ApplicationBuilderInternalOptions; - - if (browserOptions.prerender || (browserOptions.outputMode && browserOptions.server)) { - // Disable prerendering if enabled and force SSR. - // This is so instead of prerendering all the routes for every change, the page is "prerendered" when it is requested. - browserOptions.prerender = undefined; - browserOptions.ssr ||= true; - } - - // Disable auto CSP. - browserOptions.security = { - autoCsp: false, - }; - - // Disable JSON build stats. - // These are not accessible with the dev server and can cause HMR fallbacks. - if (browserOptions.statsJson === true) { - context.logger.warn( - 'Build JSON statistics output (`statsJson` option) has been disabled.' + - ' The development server does not support this option.', - ); - } - browserOptions.statsJson = false; - - // Set all packages as external to support Vite's prebundle caching - browserOptions.externalPackages = serverOptions.prebundle; - - // Disable generating a full manifest with routes. - // This is done during runtime when using the dev-server. - browserOptions.partialSSRBuild = true; - - // The development server currently only supports a single locale when localizing. - // This matches the behavior of the Webpack-based development server but could be expanded in the future. - if ( - browserOptions.localize === true || - (Array.isArray(browserOptions.localize) && browserOptions.localize.length > 1) - ) { - context.logger.warn( - 'Localization (`localize` option) has been disabled. The development server only supports localizing a single locale per build.', - ); - browserOptions.localize = false; - } else if (browserOptions.localize) { - // When localization is enabled with a single locale, force a flat path to maintain behavior with the existing Webpack-based dev server. - browserOptions.forceI18nFlatOutput = true; - } - - const { vendor: thirdPartySourcemaps, scripts: scriptsSourcemaps } = normalizeSourceMaps( - browserOptions.sourceMap ?? false, - ); - - if (scriptsSourcemaps && browserOptions.server) { - // https://nodejs.org/api/process.html#processsetsourcemapsenabledval - process.setSourceMapsEnabled(true); - } - - // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable) - browserOptions.externalRuntimeStyles = - serverOptions.liveReload && serverOptions.hmr && useComponentStyleHmr; - - // Enable to support component template hot replacement (`NG_HMR_TEMPLATE=0` can be used to disable selectively) - // This will also replace file-based/inline styles as code if external runtime styles are not enabled. - browserOptions.templateUpdates = - serverOptions.liveReload && serverOptions.hmr && useComponentTemplateHmr; - browserOptions.incrementalResults = true; - - // Setup the prebundling transformer that will be shared across Vite prebundling requests - const prebundleTransformer = new JavaScriptTransformer( - // Always enable JIT linking to support applications built with and without AOT. - // In a development environment the additional scope information does not - // have a negative effect unlike production where final output size is relevant. - { sourcemap: true, jit: true, thirdPartySourcemaps }, - 1, - ); - - // The index HTML path will be updated from the build results if provided by the builder - let htmlIndexPath = 'index.html'; - - // dynamically import Vite for ESM compatibility - const { createServer, normalizePath } = await loadEsmModule('vite'); - - let server: ViteDevServer | undefined; - let serverUrl: URL | undefined; - let hadError = false; - const generatedFiles = new Map(); - const assetFiles = new Map(); - const externalMetadata: DevServerExternalResultMetadata = { - implicitBrowser: [], - implicitServer: [], - explicitBrowser: [], - explicitServer: [], - }; - const componentStyles = new Map(); - const templateUpdates = new Map(); - - // Add cleanup logic via a builder teardown. - let deferred: () => void; - context.addTeardown(async () => { - await server?.close(); - await prebundleTransformer.close(); - deferred?.(); - }); - - // TODO: Switch this to an architect schedule call when infrastructure settings are supported - for await (const result of builderAction(browserOptions, context, extensions?.buildPlugins)) { - if (result.kind === ResultKind.Failure) { - if (result.errors.length && server) { - hadError = true; - server.ws.send({ - type: 'error', - err: { - message: result.errors[0].text, - stack: '', - loc: result.errors[0].location ?? undefined, - }, - }); - } - - yield { baseUrl: '', success: false }; - continue; - } - // Clear existing error overlay on successful result - if (hadError && server) { - hadError = false; - // Send an empty update to clear the error overlay - server.ws.send({ - 'type': 'update', - updates: [], - }); - } - - let needClientUpdate = true; - switch (result.kind) { - case ResultKind.Full: - if (result.detail?.['htmlIndexPath']) { - htmlIndexPath = result.detail['htmlIndexPath'] as string; - } - if (serverOptions.servePath === undefined && result.detail?.['htmlBaseHref']) { - const baseHref = result.detail['htmlBaseHref'] as string; - // Remove trailing slash - serverOptions.servePath = - baseHref !== './' && baseHref[baseHref.length - 1] === '/' - ? baseHref.slice(0, -1) - : baseHref; - } - - assetFiles.clear(); - componentStyles.clear(); - generatedFiles.clear(); - - for (const [outputPath, file] of Object.entries(result.files)) { - updateResultRecord( - outputPath, - file, - normalizePath, - htmlIndexPath, - generatedFiles, - assetFiles, - componentStyles, - // The initial build will not yet have a server setup - !server, - ); - } - - // Clear stale template updates on code rebuilds - templateUpdates.clear(); - - break; - case ResultKind.Incremental: - assert(server, 'Builder must provide an initial full build before incremental results.'); - - // Background updates should only update server files/options - needClientUpdate = !result.background; - - for (const removed of result.removed) { - const filePath = '/' + normalizePath(removed.path); - generatedFiles.delete(filePath); - assetFiles.delete(filePath); - } - - for (const modified of result.modified) { - updateResultRecord( - modified, - result.files[modified], - normalizePath, - htmlIndexPath, - generatedFiles, - assetFiles, - componentStyles, - ); - } - - for (const added of result.added) { - updateResultRecord( - added, - result.files[added], - normalizePath, - htmlIndexPath, - generatedFiles, - assetFiles, - componentStyles, - ); - } - - break; - case ResultKind.ComponentUpdate: - assert(serverOptions.hmr, 'Component updates are only supported with HMR enabled.'); - assert( - server, - 'Builder must provide an initial full build before component update results.', - ); - - for (const componentUpdate of result.updates) { - if (componentUpdate.type === 'template') { - templateUpdates.set(componentUpdate.id, componentUpdate.content); - server.ws.send('angular:component-update', { - id: componentUpdate.id, - timestamp: Date.now(), - }); - } - } - - context.logger.info('Component update sent to client(s).'); - continue; - default: - context.logger.warn(`Unknown result kind [${(result as Result).kind}] provided by build.`); - continue; - } - - // To avoid disconnecting the array objects from the option, these arrays need to be mutated instead of replaced. - if (result.detail?.['externalMetadata']) { - const { implicitBrowser, implicitServer, explicit } = result.detail[ - 'externalMetadata' - ] as ExternalResultMetadata; - const implicitServerFiltered = implicitServer.filter( - (m) => !isBuiltin(m) && !isAbsoluteUrl(m), - ); - const implicitBrowserFiltered = implicitBrowser.filter((m) => !isAbsoluteUrl(m)); - - // Empty Arrays to avoid growing unlimited with every re-build. - externalMetadata.explicitBrowser.length = 0; - externalMetadata.explicitServer.length = 0; - externalMetadata.implicitServer.length = 0; - externalMetadata.implicitBrowser.length = 0; - - const externalDeps = browserOptions.externalDependencies ?? []; - externalMetadata.explicitBrowser.push(...explicit, ...externalDeps); - externalMetadata.explicitServer.push(...explicit, ...externalDeps, ...builtinModules); - externalMetadata.implicitServer.push(...implicitServerFiltered); - externalMetadata.implicitBrowser.push(...implicitBrowserFiltered); - - // The below needs to be sorted as Vite uses these options are part of the hashing invalidation algorithm. - // See: https://github.com/vitejs/vite/blob/0873bae0cfe0f0718ad2f5743dd34a17e4ab563d/packages/vite/src/node/optimizer/index.ts#L1203-L1239 - externalMetadata.explicitBrowser.sort(); - externalMetadata.explicitServer.sort(); - externalMetadata.implicitServer.sort(); - externalMetadata.implicitBrowser.sort(); - } - - if (server) { - // Update fs allow list to include any new assets from the build option. - server.config.server.fs.allow = [ - ...new Set([ - ...server.config.server.fs.allow, - ...[...assetFiles.values()].map(({ source }) => source), - ]), - ]; - - const updatedFiles = await invalidateUpdatedFiles( - normalizePath, - generatedFiles, - assetFiles, - server, - ); - - if (needClientUpdate) { - handleUpdate(server, serverOptions, context.logger, componentStyles, updatedFiles); - } - } else { - const projectName = context.target?.project; - if (!projectName) { - throw new Error('The builder requires a target.'); - } - - context.logger.info( - 'NOTE: Raw file sizes do not reflect development server per-request transformations.', - ); - - if (browserOptions.ssr && serverOptions.inspect) { - const { host, port } = serverOptions.inspect as { host?: string; port?: number }; - const { default: inspector } = await import('node:inspector'); - inspector.open(port, host, true); - context.addTeardown(() => inspector.close()); - } - - const { root = '' } = await context.getProjectMetadata(projectName); - const projectRoot = join(context.workspaceRoot, root as string); - const browsers = getSupportedBrowsers(projectRoot, context.logger); - - const target = transformSupportedBrowsersToTargets(browsers); - // Needed for browser-esbuild as polyfills can be a string. - const polyfills = Array.isArray((browserOptions.polyfills ??= [])) - ? browserOptions.polyfills - : [browserOptions.polyfills]; - - let ssrMode: ServerSsrMode = ServerSsrMode.NoSsr; - if ( - browserOptions.outputMode && - typeof browserOptions.ssr === 'object' && - browserOptions.ssr.entry - ) { - ssrMode = ServerSsrMode.ExternalSsrMiddleware; - } else if (browserOptions.ssr) { - ssrMode = ServerSsrMode.InternalSsrMiddleware; - } - - if (browserOptions.progress !== false && ssrMode !== ServerSsrMode.NoSsr) { - // This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`. - process.once('SIGINT', () => { - process.kill(process.pid); - }); - } - - // Setup server and start listening - const serverConfiguration = await setupServer( - serverOptions, - generatedFiles, - assetFiles, - browserOptions.preserveSymlinks, - externalMetadata, - ssrMode, - prebundleTransformer, - target, - isZonelessApp(polyfills), - componentStyles, - templateUpdates, - browserOptions.loader as EsbuildLoaderOption | undefined, - { - ...browserOptions.define, - 'ngHmrMode': browserOptions.templateUpdates ? 'true' : 'false', - }, - extensions?.middleware, - transformers?.indexHtml, - thirdPartySourcemaps, - ); - - server = await createServer(serverConfiguration); - await server.listen(); - - // Setup builder context logging for browser clients - server.hot.on('angular:log', (data: { text: string; kind?: string }) => { - if (typeof data?.text !== 'string') { - context.logger.warn('Development server client sent invalid internal log event.'); - } - switch (data.kind) { - case 'error': - context.logger.error(`[CLIENT ERROR]: ${data.text}`); - break; - case 'warning': - context.logger.warn(`[CLIENT WARNING]: ${data.text}`); - break; - default: - context.logger.info(`[CLIENT INFO]: ${data.text}`); - break; - } - }); - - // Setup component HMR invalidation - // Invalidation occurs when the runtime cannot update a component - server.hot.on( - 'angular:invalidate', - (data: { id: string; message?: string; error?: boolean }) => { - if (typeof data?.id !== 'string') { - context.logger.warn( - 'Development server client sent invalid internal invalidate event.', - ); - } - - // Clear invalid template update - templateUpdates.delete(data.id); - - // Some cases are expected unsupported update scenarios but some may be errors. - // If an error occurred, log the error in addition to the invalidation. - if (data.error) { - context.logger.error( - `Component update failed${data.message ? `: ${data.message}` : '.'}` + - '\nPlease consider reporting the error at https://github.com/angular/angular-cli/issues', - ); - } else { - context.logger.warn( - `Component update unsupported${data.message ? `: ${data.message}` : '.'}`, - ); - } - - server?.ws.send({ - type: 'full-reload', - path: '*', - }); - context.logger.info('Page reload sent to client(s).'); - }, - ); - - const urls = server.resolvedUrls; - if (urls && (urls.local.length || urls.network.length)) { - serverUrl = new URL(urls.local[0] ?? urls.network[0]); - } - - // log connection information - server.printUrls(); - - server.bindCLIShortcuts({ - print: true, - customShortcuts: [ - { - key: 'r', - description: 'force reload browser', - action(server) { - componentStyles.forEach((record) => record.used?.clear()); - server.ws.send({ - type: 'full-reload', - path: '*', - }); - }, - }, - ], - }); - } - - // TODO: adjust output typings to reflect both development servers - yield { - success: true, - port: serverUrl?.port, - baseUrl: serverUrl?.href, - } as unknown as DevServerBuilderOutput; - } - - await new Promise((resolve) => (deferred = resolve)); -} - -/** - * Invalidates any updated asset or generated files and resets their `updated` state. - * This function also clears the server application cache when necessary. - * - * @returns A list of files that were updated and invalidated. - */ -async function invalidateUpdatedFiles( - normalizePath: (id: string) => string, - generatedFiles: Map, - assetFiles: Map, - server: ViteDevServer, -): Promise { - const updatedFiles: string[] = []; - - // Invalidate any updated asset - for (const [file, record] of assetFiles) { - if (!record.updated) { - continue; - } - - record.updated = false; - updatedFiles.push(file); - } - - // Invalidate any updated files - let serverApplicationChanged = false; - for (const [file, record] of generatedFiles) { - if (!record.updated) { - continue; - } - - record.updated = false; - updatedFiles.push(file); - serverApplicationChanged ||= record.type === BuildOutputFileType.ServerApplication; - - const updatedModules = server.moduleGraph.getModulesByFile( - normalizePath(join(server.config.root, file)), - ); - updatedModules?.forEach((m) => server.moduleGraph.invalidateModule(m)); - } - - if (serverApplicationChanged) { - // Clear the server app cache and - // trigger module evaluation before reload to initiate dependency optimization. - const { ɵdestroyAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')) as { - ɵdestroyAngularServerApp: typeof destroyAngularServerApp; - }; - - ɵdestroyAngularServerApp(); - } - - return updatedFiles; -} - -/** - * Handles updates for the client by sending HMR or full page reload commands - * based on the updated files. It also ensures proper tracking of component styles and determines if - * a full reload is needed. - */ -function handleUpdate( - server: ViteDevServer, - serverOptions: NormalizedDevServerOptions, - logger: BuilderContext['logger'], - componentStyles: Map, - updatedFiles: string[], -): void { - if (!updatedFiles.length) { - return; - } - - if (serverOptions.hmr) { - if (updatedFiles.every((f) => f.endsWith('.css'))) { - let requiresReload = false; - const timestamp = Date.now(); - const updates = updatedFiles.flatMap((filePath) => { - // For component styles, an HMR update must be sent for each one with the corresponding - // component identifier search parameter (`ngcomp`). The Vite client code will not keep - // the existing search parameters when it performs an update and each one must be - // specified explicitly. Typically, there is only one each though as specific style files - // are not typically reused across components. - const record = componentStyles.get(filePath); - if (record) { - if (record.reload) { - // Shadow DOM components currently require a full reload. - // Vite's CSS hot replacement does not support shadow root searching. - requiresReload = true; - - return []; - } - - return Array.from(record.used ?? []).map((id) => { - return { - type: 'css-update' as const, - timestamp, - path: `${filePath}?ngcomp` + (typeof id === 'string' ? `=${id}` : ''), - acceptedPath: filePath, - }; - }); - } - - return { - type: 'css-update' as const, - timestamp, - path: filePath, - acceptedPath: filePath, - }; - }); - - if (!requiresReload) { - server.ws.send({ - type: 'update', - updates, - }); - logger.info('Stylesheet update sent to client(s).'); - - return; - } - } - } - - // Send reload command to clients - if (serverOptions.liveReload) { - // Clear used component tracking on full reload - componentStyles.forEach((record) => record.used?.clear()); - - server.ws.send({ - type: 'full-reload', - path: '*', - }); - - logger.info('Page reload sent to client(s).'); - } -} - -function updateResultRecord( - outputPath: string, - file: ResultFile, - normalizePath: (id: string) => string, - htmlIndexPath: string, - generatedFiles: Map, - assetFiles: Map, - componentStyles: Map, - initial = false, -): void { - if (file.origin === 'disk') { - assetFiles.set('/' + normalizePath(outputPath), { - source: normalizePath(file.inputPath), - updated: !initial, - }); - - return; - } - - let filePath; - if (outputPath === htmlIndexPath) { - // Convert custom index output path to standard index path for dev-server usage. - // This mimics the Webpack dev-server behavior. - filePath = '/index.html'; - } else { - filePath = '/' + normalizePath(outputPath); - } - - const servable = - file.type === BuildOutputFileType.Browser || file.type === BuildOutputFileType.Media; - - // Skip analysis of sourcemaps - if (filePath.endsWith('.map')) { - generatedFiles.set(filePath, { - contents: file.contents, - servable, - size: file.contents.byteLength, - hash: file.hash, - type: file.type, - updated: false, - }); - - return; - } - - // New or updated file - generatedFiles.set(filePath, { - contents: file.contents, - size: file.contents.byteLength, - hash: file.hash, - // Consider the files updated except on the initial build result - updated: !initial, - type: file.type, - servable, - }); - - // Record any external component styles - if (filePath.endsWith('.css') && /^\/[a-f0-9]{64}\.css$/.test(filePath)) { - const componentStyle = componentStyles.get(filePath); - if (componentStyle) { - componentStyle.rawContent = file.contents; - } else { - componentStyles.set(filePath, { - rawContent: file.contents, - }); - } - } -} - -// eslint-disable-next-line max-lines-per-function -export async function setupServer( - serverOptions: NormalizedDevServerOptions, - outputFiles: Map, - assets: Map, - preserveSymlinks: boolean | undefined, - externalMetadata: DevServerExternalResultMetadata, - ssrMode: ServerSsrMode, - prebundleTransformer: JavaScriptTransformer, - target: string[], - zoneless: boolean, - componentStyles: Map, - templateUpdates: Map, - prebundleLoaderExtensions: EsbuildLoaderOption | undefined, - define: ApplicationBuilderInternalOptions['define'], - extensionMiddleware?: Connect.NextHandleFunction[], - indexHtmlTransformer?: (content: string) => Promise, - thirdPartySourcemaps = false, -): Promise { - const proxy = await loadProxyConfiguration( - serverOptions.workspaceRoot, - serverOptions.proxyConfig, - ); - - // dynamically import Vite for ESM compatibility - const { normalizePath } = await loadEsmModule('vite'); - - // Path will not exist on disk and only used to provide separate path for Vite requests - const virtualProjectRoot = normalizePath( - join(serverOptions.workspaceRoot, `.angular/vite-root`, serverOptions.buildTarget.project), - ); - - // Files used for SSR warmup. - let ssrFiles: string[] | undefined; - switch (ssrMode) { - case ServerSsrMode.InternalSsrMiddleware: - ssrFiles = ['./main.server.mjs']; - break; - case ServerSsrMode.ExternalSsrMiddleware: - ssrFiles = ['./main.server.mjs', './server.mjs']; - break; - } - - /** - * Required when using `externalDependencies` to prevent Vite load errors. - * - * @note Can be removed if Vite introduces native support for externals. - * @note Vite misresolves browser modules in SSR when accessing URLs with multiple segments - * (e.g., 'foo/bar'), as they are not correctly re-based from the base href. - */ - const preTransformRequests = - externalMetadata.explicitBrowser.length === 0 && ssrMode === ServerSsrMode.NoSsr; - const cacheDir = join(serverOptions.cacheOptions.path, serverOptions.buildTarget.project, 'vite'); - const configuration: InlineConfig = { - configFile: false, - envFile: false, - cacheDir, - root: virtualProjectRoot, - publicDir: false, - esbuild: false, - mode: 'development', - // We use custom as we do not rely on Vite's htmlFallbackMiddleware and indexHtmlMiddleware. - appType: 'custom', - css: { - devSourcemap: true, - }, - // Ensure custom 'file' loader build option entries are handled by Vite in application code that - // reference third-party libraries. Relative usage is handled directly by the build and not Vite. - // Only 'file' loader entries are currently supported directly by Vite. - assetsInclude: - prebundleLoaderExtensions && - Object.entries(prebundleLoaderExtensions) - .filter(([, value]) => value === 'file') - // Create a file extension glob for each key - .map(([key]) => '*' + key), - // Vite will normalize the `base` option by adding a leading slash. - base: serverOptions.servePath, - resolve: { - mainFields: ['es2020', 'browser', 'module', 'main'], - preserveSymlinks, - }, - dev: { - preTransformRequests, - }, - server: { - preTransformRequests, - warmup: { - ssrFiles, - }, - port: serverOptions.port, - strictPort: true, - host: serverOptions.host, - open: serverOptions.open, - allowedHosts: serverOptions.allowedHosts, - headers: serverOptions.headers, - // Disable the websocket if live reload is disabled (false/undefined are the only valid values) - ws: serverOptions.liveReload === false && serverOptions.hmr === false ? false : undefined, - // When server-side rendering (SSR) is enabled togather with SSL and Express is being used, - // we must configure Vite to use HTTP/1.1. - // This is necessary because Express does not support HTTP/2. - // We achieve this by defining an empty proxy. - // See: https://github.com/vitejs/vite/blob/c4b532cc900bf988073583511f57bd581755d5e3/packages/vite/src/node/http.ts#L106 - proxy: - serverOptions.ssl && ssrMode === ServerSsrMode.ExternalSsrMiddleware - ? (proxy ?? {}) - : proxy, - cors: { - // This will add the header `Access-Control-Allow-Origin: http://example.com`, - // where `http://example.com` is the requesting origin. - origin: true, - // Allow preflight requests to be proxied. - preflightContinue: true, - }, - // File watching is handled by the build directly. `null` disables file watching for Vite. - watch: null, - fs: { - // Ensure cache directory, node modules, and all assets are accessible by the client. - // The first two are required for Vite to function in prebundling mode (the default) and to load - // the Vite client-side code for browser reloading. These would be available by default but when - // the `allow` option is explicitly configured, they must be included manually. - allow: [ - cacheDir, - join(serverOptions.workspaceRoot, 'node_modules'), - ...[...assets.values()].map(({ source }) => source), - ], - }, - }, - ssr: { - // Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored. - noExternal: /.*/, - // Exclude any Node.js built in module and provided dependencies (currently build defined externals) - external: externalMetadata.explicitServer, - optimizeDeps: getDepOptimizationConfig({ - // Only enable with caching since it causes prebundle dependencies to be cached - disabled: serverOptions.prebundle === false, - // Exclude any explicitly defined dependencies (currently build defined externals and node.js built-ins) - exclude: externalMetadata.explicitServer, - // Include all implict dependencies from the external packages internal option - include: externalMetadata.implicitServer, - ssr: true, - prebundleTransformer, - zoneless, - target, - loader: prebundleLoaderExtensions, - thirdPartySourcemaps, - define, - }), - }, - plugins: [ - createAngularLocaleDataPlugin(), - createAngularSetupMiddlewaresPlugin({ - outputFiles, - assets, - indexHtmlTransformer, - extensionMiddleware, - componentStyles, - templateUpdates, - ssrMode, - resetComponentUpdates: () => templateUpdates.clear(), - projectRoot: serverOptions.projectRoot, - }), - createRemoveIdPrefixPlugin(externalMetadata.explicitBrowser), - await createAngularSsrTransformPlugin(serverOptions.workspaceRoot), - await createAngularMemoryPlugin({ - virtualProjectRoot, - outputFiles, - templateUpdates, - external: externalMetadata.explicitBrowser, - disableViteTransport: !serverOptions.liveReload, - }), - ], - // Browser only optimizeDeps. (This does not run for SSR dependencies). - optimizeDeps: getDepOptimizationConfig({ - // Only enable with caching since it causes prebundle dependencies to be cached - disabled: serverOptions.prebundle === false, - // Exclude any explicitly defined dependencies (currently build defined externals) - exclude: externalMetadata.explicitBrowser, - // Include all implict dependencies from the external packages internal option - include: externalMetadata.implicitBrowser, - ssr: false, - prebundleTransformer, - target, - zoneless, - loader: prebundleLoaderExtensions, - thirdPartySourcemaps, - define, - }), - }; - - if (serverOptions.ssl) { - if (serverOptions.sslCert && serverOptions.sslKey) { - configuration.server ??= {}; - // server configuration is defined above - configuration.server.https = { - cert: await readFile(serverOptions.sslCert), - key: await readFile(serverOptions.sslKey), - }; - } else { - const { default: basicSslPlugin } = await import('@vitejs/plugin-basic-ssl'); - configuration.plugins ??= []; - configuration.plugins.push(basicSslPlugin()); - } - } - - return configuration; -} - -/** - * Checks if the given value is an absolute URL. - * - * This function helps in avoiding Vite's prebundling from processing absolute URLs (http://, https://, //) as files. - * - * @param value - The URL or path to check. - * @returns `true` if the value is not an absolute URL; otherwise, `false`. - */ -function isAbsoluteUrl(value: string): boolean { - return /^(?:https?:)?\/\//.test(value); -} diff --git a/packages/angular/build/src/builders/dev-server/vite/hmr.ts b/packages/angular/build/src/builders/dev-server/vite/hmr.ts new file mode 100644 index 000000000000..467962572463 --- /dev/null +++ b/packages/angular/build/src/builders/dev-server/vite/hmr.ts @@ -0,0 +1,153 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { ɵdestroyAngularServerApp as destroyAngularServerApp } from '@angular/ssr'; +import type { BuilderContext } from '@angular-devkit/architect'; +import { join } from 'node:path'; +import type { ViteDevServer } from 'vite'; +import type { ComponentStyleRecord } from '../../../tools/vite/middlewares'; +import { BuildOutputFileType } from '../internal'; +import type { NormalizedDevServerOptions } from '../options'; +import type { OutputAssetRecord, OutputFileRecord } from './utils'; + +/** + * Invalidates any updated asset or generated files and resets their `updated` state. + * This function also clears the server application cache when necessary. + * + * @returns A list of files that were updated and invalidated. + */ +export async function invalidateUpdatedFiles( + normalizePath: (id: string) => string, + generatedFiles: Map, + assetFiles: Map, + server: ViteDevServer, +): Promise { + const updatedFiles: string[] = []; + + // Invalidate any updated asset + for (const [file, record] of assetFiles) { + if (!record.updated) { + continue; + } + + record.updated = false; + updatedFiles.push(file); + } + + // Invalidate any updated files + let serverApplicationChanged = false; + for (const [file, record] of generatedFiles) { + if (!record.updated) { + continue; + } + + record.updated = false; + updatedFiles.push(file); + serverApplicationChanged ||= record.type === BuildOutputFileType.ServerApplication; + + const updatedModules = server.moduleGraph.getModulesByFile( + normalizePath(join(server.config.root, file)), + ); + updatedModules?.forEach((m) => server.moduleGraph.invalidateModule(m)); + } + + if (serverApplicationChanged) { + // Clear the server app cache and trigger module evaluation before reload to initiate dependency optimization. + // The querystring is needed as a workaround for: + // `ɵgetOrCreateAngularServerApp` can be undefined right after an error. + const { ɵdestroyAngularServerApp } = (await server.ssrLoadModule( + `/main.server.mjs?timestamp=${Date.now()}`, + )) as { + ɵdestroyAngularServerApp: typeof destroyAngularServerApp; + }; + + ɵdestroyAngularServerApp(); + } + + return updatedFiles; +} + +/** + * Handles updates for the client by sending HMR or full page reload commands + * based on the updated files. It also ensures proper tracking of component styles and determines if + * a full reload is needed. + */ +export function handleUpdate( + server: ViteDevServer, + serverOptions: NormalizedDevServerOptions, + logger: BuilderContext['logger'], + componentStyles: Map, + updatedFiles: string[], +): void { + if (!updatedFiles.length) { + return; + } + + if (serverOptions.hmr) { + if (updatedFiles.every((f) => f.endsWith('.css'))) { + let requiresReload = false; + const timestamp = Date.now(); + const updates = updatedFiles.flatMap((filePath) => { + // For component styles, an HMR update must be sent for each one with the corresponding + // component identifier search parameter (`ngcomp`). The Vite client code will not keep + // the existing search parameters when it performs an update and each one must be + // specified explicitly. Typically, there is only one each though as specific style files + // are not typically reused across components. + const record = componentStyles.get(filePath); + if (record) { + if (record.reload) { + // Shadow DOM components currently require a full reload. + // Vite's CSS hot replacement does not support shadow root searching. + requiresReload = true; + + return []; + } + + return Array.from(record.used ?? []).map((id) => { + return { + type: 'css-update' as const, + timestamp, + path: `${filePath}?ngcomp` + (typeof id === 'string' ? `=${id}` : ''), + acceptedPath: filePath, + }; + }); + } + + return { + type: 'css-update' as const, + timestamp, + path: filePath, + acceptedPath: filePath, + }; + }); + + if (!requiresReload) { + server.ws.send({ + type: 'update', + updates, + }); + logger.info('Stylesheet update sent to client(s).'); + + return; + } + } + } + + // Send reload command to clients + if (serverOptions.liveReload) { + // Clear used component tracking on full reload + componentStyles.forEach((record) => record.used?.clear()); + + server.ws.send({ + type: 'full-reload', + path: '*', + }); + + logger.info('Page reload sent to client(s).'); + } +} diff --git a/packages/angular/build/src/builders/dev-server/vite/index.ts b/packages/angular/build/src/builders/dev-server/vite/index.ts new file mode 100644 index 000000000000..8129daac1ba1 --- /dev/null +++ b/packages/angular/build/src/builders/dev-server/vite/index.ts @@ -0,0 +1,514 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderContext } from '@angular-devkit/architect'; +import type { Plugin } from 'esbuild'; +import assert from 'node:assert'; +import { builtinModules, isBuiltin } from 'node:module'; +import { join } from 'node:path'; +import type { Connect, ViteDevServer } from 'vite'; +import type { ComponentStyleRecord } from '../../../tools/vite/middlewares'; +import { ServerSsrMode } from '../../../tools/vite/plugins'; +import { EsbuildLoaderOption, updateExternalMetadata } from '../../../tools/vite/utils'; +import { normalizeSourceMaps } from '../../../utils'; +import { useComponentStyleHmr, useComponentTemplateHmr } from '../../../utils/environment-options'; +import { Result, ResultKind } from '../../application/results'; +import { OutputHashing } from '../../application/schema'; +import { + type ApplicationBuilderInternalOptions, + type ExternalResultMetadata, + JavaScriptTransformer, + getSupportedBrowsers, + isZonelessApp, + transformSupportedBrowsersToTargets, +} from '../internal'; +import type { NormalizedDevServerOptions } from '../options'; +import type { DevServerBuilderOutput } from '../output'; +import { handleUpdate, invalidateUpdatedFiles } from './hmr'; +import { setupServer } from './server'; +import { + DevServerExternalResultMetadata, + OutputAssetRecord, + OutputFileRecord, + updateResultRecord, +} from './utils'; + +export type BuilderAction = ( + options: ApplicationBuilderInternalOptions, + context: BuilderContext, + plugins?: Plugin[], +) => AsyncIterable; + +/** + * Build options that are also present on the dev server but are only passed + * to the build. + */ +const CONVENIENCE_BUILD_OPTIONS = ['watch', 'poll', 'verbose', 'define'] as const; + +// eslint-disable-next-line max-lines-per-function +export async function* serveWithVite( + serverOptions: NormalizedDevServerOptions, + builderName: string, + builderAction: BuilderAction, + context: BuilderContext, + transformers?: { + indexHtml?: (content: string) => Promise; + }, + extensions?: { + middleware?: Connect.NextHandleFunction[]; + buildPlugins?: Plugin[]; + }, +): AsyncIterableIterator { + // Get the browser configuration from the target name. + const rawBrowserOptions = await context.getTargetOptions(serverOptions.buildTarget); + + // Deploy url is not used in the dev-server. + delete rawBrowserOptions.deployUrl; + + // Copy convenience options to build + for (const optionName of CONVENIENCE_BUILD_OPTIONS) { + const optionValue = serverOptions[optionName]; + if (optionValue !== undefined) { + if (optionName === 'define' && rawBrowserOptions[optionName]) { + // Define has merging behavior within the application + for (const [key, value] of Object.entries(optionValue)) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (rawBrowserOptions[optionName] as any)[key] = value; + } + } else { + rawBrowserOptions[optionName] = optionValue; + } + } + } + + // TODO: Adjust architect to not force a JsonObject derived return type + const browserOptions = (await context.validateOptions( + rawBrowserOptions, + builderName, + )) as unknown as ApplicationBuilderInternalOptions; + + if (browserOptions.prerender || (browserOptions.outputMode && browserOptions.server)) { + // Disable prerendering if enabled and force SSR. + // This is so instead of prerendering all the routes for every change, the page is "prerendered" when it is requested. + browserOptions.prerender = undefined; + browserOptions.ssr ||= true; + } + + // Disable auto CSP. + browserOptions.security = { + autoCsp: false, + }; + + // Disable JSON build stats. + // These are not accessible with the dev server and can cause HMR fallbacks. + if (browserOptions.statsJson === true) { + context.logger.warn( + 'Build JSON statistics output (`statsJson` option) has been disabled.' + + ' The development server does not support this option.', + ); + } + browserOptions.statsJson = false; + + // Set all packages as external to support Vite's prebundle caching + browserOptions.externalPackages = serverOptions.prebundle; + + // Disable generating a full manifest with routes. + // This is done during runtime when using the dev-server. + browserOptions.partialSSRBuild = true; + + // The development server currently only supports a single locale when localizing. + // This matches the behavior of the Webpack-based development server but could be expanded in the future. + if ( + browserOptions.localize === true || + (Array.isArray(browserOptions.localize) && browserOptions.localize.length > 1) + ) { + context.logger.warn( + 'Localization (`localize` option) has been disabled. The development server only supports localizing a single locale per build.', + ); + browserOptions.localize = false; + } else if (browserOptions.localize) { + // When localization is enabled with a single locale, force a flat path to maintain behavior with the existing Webpack-based dev server. + browserOptions.forceI18nFlatOutput = true; + } + + const { vendor: thirdPartySourcemaps, scripts: scriptsSourcemaps } = normalizeSourceMaps( + browserOptions.sourceMap ?? false, + ); + + if (scriptsSourcemaps && browserOptions.server) { + // https://nodejs.org/api/process.html#processsetsourcemapsenabledval + process.setSourceMapsEnabled(true); + } + + if ( + serverOptions.hmr && + (browserOptions.outputHashing === OutputHashing.All || + browserOptions.outputHashing === OutputHashing.Bundles) + ) { + serverOptions.hmr = false; + + context.logger.warn( + `Hot Module Replacement (HMR) is disabled because the 'outputHashing' option is set to '${browserOptions.outputHashing}'. ` + + 'HMR is incompatible with this setting.', + ); + } + + const componentsHmrCanBeUsed = + browserOptions.aot && serverOptions.liveReload && serverOptions.hmr; + + // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable) + browserOptions.externalRuntimeStyles = componentsHmrCanBeUsed && useComponentStyleHmr; + + // Enable to support component template hot replacement (`NG_HMR_TEMPLATE=0` can be used to disable selectively) + // This will also replace file-based/inline styles as code if external runtime styles are not enabled. + browserOptions.templateUpdates = componentsHmrCanBeUsed && useComponentTemplateHmr; + browserOptions.incrementalResults = true; + + // Setup the prebundling transformer that will be shared across Vite prebundling requests + const prebundleTransformer = new JavaScriptTransformer( + // Always enable JIT linking to support applications built with and without AOT. + // In a development environment the additional scope information does not + // have a negative effect unlike production where final output size is relevant. + { sourcemap: true, jit: true, thirdPartySourcemaps }, + 1, + ); + + // The index HTML path will be updated from the build results if provided by the builder + let htmlIndexPath = 'index.html'; + + const { createServer, normalizePath } = await import('vite'); + + let server: ViteDevServer | undefined; + let serverUrl: URL | undefined; + let hadError = false; + const generatedFiles = new Map(); + const assetFiles = new Map(); + const externalMetadata: DevServerExternalResultMetadata = { + implicitBrowser: [], + implicitServer: [], + explicitBrowser: [], + explicitServer: [], + }; + const componentStyles = new Map(); + const templateUpdates = new Map(); + + // Add cleanup logic via a builder teardown. + let deferred: () => void; + context.addTeardown(async () => { + await server?.close(); + await prebundleTransformer.close(); + deferred?.(); + }); + + // TODO: Switch this to an architect schedule call when infrastructure settings are supported + for await (const result of builderAction(browserOptions, context, extensions?.buildPlugins)) { + if (result.kind === ResultKind.Failure) { + if (result.errors.length && server) { + hadError = true; + server.ws.send({ + type: 'error', + err: { + message: result.errors[0].text, + stack: '', + loc: result.errors[0].location ?? undefined, + }, + }); + } + + yield { baseUrl: '', success: false }; + continue; + } + // Clear existing error overlay on successful result + if (hadError && server) { + hadError = false; + // Send an empty update to clear the error overlay + server.ws.send({ + 'type': 'update', + updates: [], + }); + } + + let needClientUpdate = true; + switch (result.kind) { + case ResultKind.Full: + if (result.detail?.['htmlIndexPath']) { + htmlIndexPath = result.detail['htmlIndexPath'] as string; + } + if (serverOptions.servePath === undefined && result.detail?.['htmlBaseHref']) { + const baseHref = result.detail['htmlBaseHref'] as string; + // Remove trailing slash + serverOptions.servePath = + baseHref !== './' && baseHref.at(-1) === '/' ? baseHref.slice(0, -1) : baseHref; + } + + assetFiles.clear(); + componentStyles.clear(); + generatedFiles.clear(); + + for (const [outputPath, file] of Object.entries(result.files)) { + updateResultRecord( + outputPath, + file, + normalizePath, + htmlIndexPath, + generatedFiles, + assetFiles, + componentStyles, + // The initial build will not yet have a server setup + !server, + ); + } + + // Clear stale template updates on code rebuilds + templateUpdates.clear(); + + break; + case ResultKind.Incremental: + assert(server, 'Builder must provide an initial full build before incremental results.'); + + // Background updates should only update server files/options + needClientUpdate = !result.background; + + for (const removed of result.removed) { + const filePath = '/' + normalizePath(removed.path); + generatedFiles.delete(filePath); + assetFiles.delete(filePath); + } + + for (const modified of result.modified) { + updateResultRecord( + modified, + result.files[modified], + normalizePath, + htmlIndexPath, + generatedFiles, + assetFiles, + componentStyles, + ); + } + + for (const added of result.added) { + updateResultRecord( + added, + result.files[added], + normalizePath, + htmlIndexPath, + generatedFiles, + assetFiles, + componentStyles, + ); + } + + break; + case ResultKind.ComponentUpdate: + assert(serverOptions.hmr, 'Component updates are only supported with HMR enabled.'); + assert( + server, + 'Builder must provide an initial full build before component update results.', + ); + + for (const componentUpdate of result.updates) { + if (componentUpdate.type === 'template') { + templateUpdates.set(componentUpdate.id, componentUpdate.content); + server.ws.send('angular:component-update', { + id: componentUpdate.id, + timestamp: Date.now(), + }); + } + } + + context.logger.info('Component update sent to client(s).'); + continue; + default: + context.logger.warn(`Unknown result kind [${(result as Result).kind}] provided by build.`); + continue; + } + + // To avoid disconnecting the array objects from the option, these arrays need to be mutated instead of replaced. + updateExternalMetadata(result, externalMetadata, browserOptions.externalDependencies); + + if (server) { + // Update fs allow list to include any new assets from the build option. + server.config.server.fs.allow = [ + ...new Set([ + ...server.config.server.fs.allow, + ...[...assetFiles.values()].map(({ source }) => source), + ]), + ]; + + const updatedFiles = await invalidateUpdatedFiles( + normalizePath, + generatedFiles, + assetFiles, + server, + ); + + if (needClientUpdate) { + handleUpdate(server, serverOptions, context.logger, componentStyles, updatedFiles); + } + } else { + const projectName = context.target?.project; + if (!projectName) { + throw new Error('The builder requires a target.'); + } + + context.logger.info( + 'NOTE: Raw file sizes do not reflect development server per-request transformations.', + ); + + if (browserOptions.ssr && serverOptions.inspect) { + const { host, port } = serverOptions.inspect as { host?: string; port?: number }; + const { default: inspector } = await import('node:inspector'); + inspector.open(port, host, true); + context.addTeardown(() => inspector.close()); + } + + const { root = '' } = await context.getProjectMetadata(projectName); + const projectRoot = join(context.workspaceRoot, root as string); + const browsers = getSupportedBrowsers(projectRoot, context.logger); + + const target = transformSupportedBrowsersToTargets(browsers); + // Needed for browser-esbuild as polyfills can be a string. + const polyfills = Array.isArray((browserOptions.polyfills ??= [])) + ? browserOptions.polyfills + : [browserOptions.polyfills]; + + let ssrMode: ServerSsrMode = ServerSsrMode.NoSsr; + if ( + browserOptions.outputMode && + typeof browserOptions.ssr === 'object' && + browserOptions.ssr.entry + ) { + ssrMode = ServerSsrMode.ExternalSsrMiddleware; + } else if (browserOptions.ssr) { + ssrMode = ServerSsrMode.InternalSsrMiddleware; + } + + if (browserOptions.progress !== false && ssrMode !== ServerSsrMode.NoSsr) { + // This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`. + process.once('SIGINT', () => { + process.kill(process.pid); + }); + } + + // Setup server and start listening + const serverConfiguration = await setupServer( + serverOptions, + generatedFiles, + assetFiles, + browserOptions.preserveSymlinks, + externalMetadata, + ssrMode, + prebundleTransformer, + target, + isZonelessApp(polyfills), + componentStyles, + templateUpdates, + browserOptions.loader as EsbuildLoaderOption | undefined, + { + ...browserOptions.define, + 'ngJitMode': browserOptions.aot ? 'false' : 'true', + 'ngHmrMode': browserOptions.templateUpdates ? 'true' : 'false', + }, + extensions?.middleware, + transformers?.indexHtml, + thirdPartySourcemaps, + ); + + server = await createServer(serverConfiguration); + await server.listen(); + + // Setup builder context logging for browser clients + server.hot.on('angular:log', (data: { text: string; kind?: string }) => { + if (typeof data?.text !== 'string') { + context.logger.warn('Development server client sent invalid internal log event.'); + } + switch (data.kind) { + case 'error': + context.logger.error(`[CLIENT ERROR]: ${data.text}`); + break; + case 'warning': + context.logger.warn(`[CLIENT WARNING]: ${data.text}`); + break; + default: + context.logger.info(`[CLIENT INFO]: ${data.text}`); + break; + } + }); + + // Setup component HMR invalidation + // Invalidation occurs when the runtime cannot update a component + server.hot.on( + 'angular:invalidate', + (data: { id: string; message?: string; error?: boolean }) => { + if (typeof data?.id !== 'string') { + context.logger.warn( + 'Development server client sent invalid internal invalidate event.', + ); + } + + // Clear invalid template update + templateUpdates.delete(data.id); + + // Some cases are expected unsupported update scenarios but some may be errors. + // If an error occurred, log the error in addition to the invalidation. + if (data.error) { + context.logger.error( + `Component update failed${data.message ? `: ${data.message}` : '.'}` + + '\nPlease consider reporting the error at https://github.com/angular/angular-cli/issues', + ); + } else { + context.logger.warn( + `Component update unsupported${data.message ? `: ${data.message}` : '.'}`, + ); + } + + server?.ws.send({ + type: 'full-reload', + path: '*', + }); + context.logger.info('Page reload sent to client(s).'); + }, + ); + + const urls = server.resolvedUrls; + if (urls && (urls.local.length || urls.network.length)) { + serverUrl = new URL(urls.local[0] ?? urls.network[0]); + } + + // log connection information + server.printUrls(); + + server.bindCLIShortcuts({ + print: true, + customShortcuts: [ + { + key: 'r', + description: 'force reload browser', + action(server) { + componentStyles.forEach((record) => record.used?.clear()); + server.ws.send({ + type: 'full-reload', + path: '*', + }); + }, + }, + ], + }); + } + + // TODO: adjust output typings to reflect both development servers + yield { + success: true, + port: serverUrl?.port, + baseUrl: serverUrl?.href, + } as unknown as DevServerBuilderOutput; + } + + await new Promise((resolve) => (deferred = resolve)); +} diff --git a/packages/angular/build/src/builders/dev-server/vite/server.ts b/packages/angular/build/src/builders/dev-server/vite/server.ts new file mode 100644 index 000000000000..73f58ad5c348 --- /dev/null +++ b/packages/angular/build/src/builders/dev-server/vite/server.ts @@ -0,0 +1,271 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { readFile } from 'node:fs/promises'; +import { join } from 'node:path'; +import type { Connect, InlineConfig, SSROptions, ServerOptions } from 'vite'; +import type { ComponentStyleRecord } from '../../../tools/vite/middlewares'; +import { + ServerSsrMode, + createAngularMemoryPlugin, + createAngularServerSideSSLPlugin, + createAngularSetupMiddlewaresPlugin, + createAngularSsrTransformPlugin, + createRemoveIdPrefixPlugin, +} from '../../../tools/vite/plugins'; +import { EsbuildLoaderOption, getDepOptimizationConfig } from '../../../tools/vite/utils'; +import { loadProxyConfiguration } from '../../../utils'; +import { type ApplicationBuilderInternalOptions, JavaScriptTransformer } from '../internal'; +import type { NormalizedDevServerOptions } from '../options'; +import { DevServerExternalResultMetadata, OutputAssetRecord, OutputFileRecord } from './utils'; + +async function createServerConfig( + serverOptions: NormalizedDevServerOptions, + assets: Map, + ssrMode: ServerSsrMode, + preTransformRequests: boolean, + cacheDir: string, +): Promise { + const proxy = await loadProxyConfiguration( + serverOptions.workspaceRoot, + serverOptions.proxyConfig, + ); + + // Files used for SSR warmup. + let ssrFiles: string[] | undefined; + switch (ssrMode) { + case ServerSsrMode.InternalSsrMiddleware: + ssrFiles = ['./main.server.mjs']; + break; + case ServerSsrMode.ExternalSsrMiddleware: + ssrFiles = ['./main.server.mjs', './server.mjs']; + break; + } + + const server: ServerOptions = { + preTransformRequests, + warmup: { + ssrFiles, + }, + port: serverOptions.port, + strictPort: true, + host: serverOptions.host, + open: serverOptions.open, + allowedHosts: serverOptions.allowedHosts, + headers: serverOptions.headers, + // Disable the websocket if live reload is disabled (false/undefined are the only valid values) + ws: serverOptions.liveReload === false && serverOptions.hmr === false ? false : undefined, + proxy, + cors: { + // This will add the header `Access-Control-Allow-Origin: http://example.com`, + // where `http://example.com` is the requesting origin. + origin: true, + // Allow preflight requests to be proxied. + preflightContinue: true, + }, + // File watching is handled by the build directly. `null` disables file watching for Vite. + watch: null, + fs: { + // Ensure cache directory, node modules, and all assets are accessible by the client. + // The first two are required for Vite to function in prebundling mode (the default) and to load + // the Vite client-side code for browser reloading. These would be available by default but when + // the `allow` option is explicitly configured, they must be included manually. + allow: [ + cacheDir, + join(serverOptions.workspaceRoot, 'node_modules'), + ...[...assets.values()].map(({ source }) => source), + ], + }, + }; + + if (serverOptions.ssl) { + if (serverOptions.sslCert && serverOptions.sslKey) { + server.https = { + cert: await readFile(serverOptions.sslCert), + key: await readFile(serverOptions.sslKey), + }; + } + } + + return server; +} + +function createSsrConfig( + externalMetadata: DevServerExternalResultMetadata, + serverOptions: NormalizedDevServerOptions, + prebundleTransformer: JavaScriptTransformer, + zoneless: boolean, + target: string[], + prebundleLoaderExtensions: EsbuildLoaderOption | undefined, + thirdPartySourcemaps: boolean, + define: ApplicationBuilderInternalOptions['define'], +): SSROptions { + return { + // Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored. + noExternal: /.*/, + // Exclude any Node.js built in module and provided dependencies (currently build defined externals) + external: externalMetadata.explicitServer, + optimizeDeps: getDepOptimizationConfig({ + // Only enable with caching since it causes prebundle dependencies to be cached + disabled: serverOptions.prebundle === false, + // Exclude any explicitly defined dependencies (currently build defined externals and node.js built-ins) + exclude: externalMetadata.explicitServer, + // Include all implict dependencies from the external packages internal option + include: externalMetadata.implicitServer, + ssr: true, + prebundleTransformer, + zoneless, + target, + loader: prebundleLoaderExtensions, + thirdPartySourcemaps, + define, + }), + }; +} + +export async function setupServer( + serverOptions: NormalizedDevServerOptions, + outputFiles: Map, + assets: Map, + preserveSymlinks: boolean | undefined, + externalMetadata: DevServerExternalResultMetadata, + ssrMode: ServerSsrMode, + prebundleTransformer: JavaScriptTransformer, + target: string[], + zoneless: boolean, + componentStyles: Map, + templateUpdates: Map, + prebundleLoaderExtensions: EsbuildLoaderOption | undefined, + define: ApplicationBuilderInternalOptions['define'], + extensionMiddleware?: Connect.NextHandleFunction[], + indexHtmlTransformer?: (content: string) => Promise, + thirdPartySourcemaps = false, +): Promise { + const { normalizePath } = await import('vite'); + + // Path will not exist on disk and only used to provide separate path for Vite requests + const virtualProjectRoot = normalizePath( + join(serverOptions.workspaceRoot, `.angular/vite-root`, serverOptions.buildTarget.project), + ); + + /** + * Required when using `externalDependencies` to prevent Vite load errors. + * + * @note Can be removed if Vite introduces native support for externals. + * @note Vite misresolves browser modules in SSR when accessing URLs with multiple segments + * (e.g., 'foo/bar'), as they are not correctly re-based from the base href. + */ + const preTransformRequests = + externalMetadata.explicitBrowser.length === 0 && ssrMode === ServerSsrMode.NoSsr; + const cacheDir = join(serverOptions.cacheOptions.path, serverOptions.buildTarget.project, 'vite'); + + const configuration: InlineConfig = { + configFile: false, + envFile: false, + cacheDir, + root: virtualProjectRoot, + publicDir: false, + esbuild: false, + mode: 'development', + // We use custom as we do not rely on Vite's htmlFallbackMiddleware and indexHtmlMiddleware. + appType: 'custom', + css: { + devSourcemap: true, + }, + // Ensure custom 'file' loader build option entries are handled by Vite in application code that + // reference third-party libraries. Relative usage is handled directly by the build and not Vite. + // Only 'file' loader entries are currently supported directly by Vite. + assetsInclude: + prebundleLoaderExtensions && + Object.entries(prebundleLoaderExtensions) + .filter(([, value]) => value === 'file') + // Create a file extension glob for each key + .map(([key]) => '*' + key), + // Vite will normalize the `base` option by adding a leading slash. + base: serverOptions.servePath, + resolve: { + mainFields: ['es2020', 'browser', 'module', 'main'], + preserveSymlinks, + }, + dev: { + preTransformRequests, + }, + server: await createServerConfig( + serverOptions, + assets, + ssrMode, + preTransformRequests, + cacheDir, + ), + ssr: + ssrMode === ServerSsrMode.NoSsr + ? undefined + : createSsrConfig( + externalMetadata, + serverOptions, + prebundleTransformer, + zoneless, + target, + prebundleLoaderExtensions, + thirdPartySourcemaps, + define, + ), + plugins: [ + createAngularSetupMiddlewaresPlugin({ + outputFiles, + assets, + indexHtmlTransformer, + extensionMiddleware, + componentStyles, + templateUpdates, + ssrMode, + resetComponentUpdates: () => templateUpdates.clear(), + projectRoot: serverOptions.projectRoot, + }), + createRemoveIdPrefixPlugin(externalMetadata.explicitBrowser), + await createAngularSsrTransformPlugin(serverOptions.workspaceRoot), + await createAngularMemoryPlugin({ + virtualProjectRoot, + outputFiles, + templateUpdates, + external: externalMetadata.explicitBrowser, + disableViteTransport: !serverOptions.liveReload, + }), + ], + // Browser only optimizeDeps. (This does not run for SSR dependencies). + optimizeDeps: getDepOptimizationConfig({ + // Only enable with caching since it causes prebundle dependencies to be cached + disabled: serverOptions.prebundle === false, + // Exclude any explicitly defined dependencies (currently build defined externals) + exclude: externalMetadata.explicitBrowser, + // Include all implict dependencies from the external packages internal option + include: externalMetadata.implicitBrowser, + ssr: false, + prebundleTransformer, + target, + zoneless, + loader: prebundleLoaderExtensions, + thirdPartySourcemaps, + define, + }), + }; + + if (serverOptions.ssl) { + configuration.plugins ??= []; + if (!serverOptions.sslCert || !serverOptions.sslKey) { + const { default: basicSslPlugin } = await import('@vitejs/plugin-basic-ssl'); + configuration.plugins.push(basicSslPlugin()); + } + + if (ssrMode !== ServerSsrMode.NoSsr) { + configuration.plugins?.push(createAngularServerSideSSLPlugin()); + } + } + + return configuration; +} diff --git a/packages/angular/build/src/builders/dev-server/vite/utils.ts b/packages/angular/build/src/builders/dev-server/vite/utils.ts new file mode 100644 index 000000000000..e1e6b4f96847 --- /dev/null +++ b/packages/angular/build/src/builders/dev-server/vite/utils.ts @@ -0,0 +1,111 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { ComponentStyleRecord } from '../../../tools/vite/middlewares'; +import type { ResultFile } from '../../application/results'; +import { BuildOutputFileType, type ExternalResultMetadata } from '../internal'; + +export interface OutputFileRecord { + contents: Uint8Array; + size: number; + hash: string; + updated: boolean; + servable: boolean; + type: BuildOutputFileType; +} + +export interface OutputAssetRecord { + source: string; + updated: boolean; +} + +export interface DevServerExternalResultMetadata extends Omit { + explicitBrowser: string[]; + explicitServer: string[]; +} + +export function updateResultRecord( + outputPath: string, + file: ResultFile, + normalizePath: (id: string) => string, + htmlIndexPath: string, + generatedFiles: Map, + assetFiles: Map, + componentStyles: Map, + initial = false, +): void { + if (file.origin === 'disk') { + assetFiles.set('/' + normalizePath(outputPath), { + source: normalizePath(file.inputPath), + updated: !initial, + }); + + return; + } + + let filePath; + if (outputPath === htmlIndexPath) { + // Convert custom index output path to standard index path for dev-server usage. + // This mimics the Webpack dev-server behavior. + filePath = '/index.html'; + } else { + filePath = '/' + normalizePath(outputPath); + } + + const servable = + file.type === BuildOutputFileType.Browser || file.type === BuildOutputFileType.Media; + + // Skip analysis of sourcemaps + if (filePath.endsWith('.map')) { + generatedFiles.set(filePath, { + contents: file.contents, + servable, + size: file.contents.byteLength, + hash: file.hash, + type: file.type, + updated: false, + }); + + return; + } + + // New or updated file + generatedFiles.set(filePath, { + contents: file.contents, + size: file.contents.byteLength, + hash: file.hash, + // Consider the files updated except on the initial build result + updated: !initial, + type: file.type, + servable, + }); + + // Record any external component styles + if (filePath.endsWith('.css') && /^\/[a-f0-9]{64}\.css$/.test(filePath)) { + const componentStyle = componentStyles.get(filePath); + if (componentStyle) { + componentStyle.rawContent = file.contents; + } else { + componentStyles.set(filePath, { + rawContent: file.contents, + }); + } + } +} + +/** + * Checks if the given value is an absolute URL. + * + * This function helps in avoiding Vite's prebundling from processing absolute URLs (http://, https://, //) as files. + * + * @param value - The URL or path to check. + * @returns `true` if the value is not an absolute URL; otherwise, `false`. + */ +export function isAbsoluteUrl(value: string): boolean { + return /^(?:https?:)?\/\//.test(value); +} diff --git a/packages/angular/build/src/builders/extract-i18n/builder.ts b/packages/angular/build/src/builders/extract-i18n/builder.ts index 5e44c31fa516..f74d1d219712 100644 --- a/packages/angular/build/src/builders/extract-i18n/builder.ts +++ b/packages/angular/build/src/builders/extract-i18n/builder.ts @@ -10,7 +10,6 @@ import type { Diagnostics } from '@angular/localize/tools'; import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; import fs from 'node:fs'; import path from 'node:path'; -import { loadEsmModule } from '../../utils/load-esm'; import { assertCompatibleAngularVersion } from '../../utils/version'; import type { ApplicationBuilderExtensions } from '../application/options'; import { normalizeOptions } from './options'; @@ -51,8 +50,7 @@ export async function execute( // The package is a peer dependency and might not be present let localizeToolsModule; try { - localizeToolsModule = - await loadEsmModule('@angular/localize/tools'); + localizeToolsModule = await import('@angular/localize/tools'); } catch { return { success: false, @@ -90,16 +88,23 @@ export async function execute( return path.relative(from, to); }, }; + const duplicateTranslationBehavior = normalizedOptions.i18nOptions.duplicateTranslationBehavior; const diagnostics = checkDuplicateMessages( // eslint-disable-next-line @typescript-eslint/no-explicit-any checkFileSystem as any, extractionResult.messages, - normalizedOptions.i18nOptions.i18nDuplicateTranslation || 'warning', + duplicateTranslationBehavior, // eslint-disable-next-line @typescript-eslint/no-explicit-any extractionResult.basePath as any, ); - if (diagnostics.messages.length > 0) { - context.logger.warn(diagnostics.formatDiagnostics('')); + if (diagnostics.messages.length > 0 && duplicateTranslationBehavior !== 'ignore') { + if (duplicateTranslationBehavior === 'error') { + context.logger.error(`Extraction Failed: ${diagnostics.formatDiagnostics('')}`); + + return { success: false }; + } else { + context.logger.warn(diagnostics.formatDiagnostics('')); + } } // Serialize all extracted messages diff --git a/packages/angular/build/src/builders/extract-i18n/options.ts b/packages/angular/build/src/builders/extract-i18n/options.ts index 24be86ee7c8f..2904a466bd60 100644 --- a/packages/angular/build/src/builders/extract-i18n/options.ts +++ b/packages/angular/build/src/builders/extract-i18n/options.ts @@ -6,10 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ +import { type DiagnosticHandlingStrategy } from '@angular/localize/tools'; import { BuilderContext, targetFromTargetString } from '@angular-devkit/architect'; import { fail } from 'node:assert'; import path from 'node:path'; -import { createI18nOptions } from '../../utils/i18n-options'; +import { type I18nOptions, createI18nOptions } from '../../utils/i18n-options'; import { Schema as ExtractI18nOptions, Format } from './schema'; export type NormalizedExtractI18nOptions = Awaited>; @@ -36,7 +37,12 @@ export async function normalizeOptions( // Target specifier defaults to the current project's build target with no specified configuration const buildTargetSpecifier = options.buildTarget ?? ':'; const buildTarget = targetFromTargetString(buildTargetSpecifier, projectName, 'build'); - const i18nOptions = createI18nOptions(projectMetadata, /** inline */ false, context.logger); + const i18nOptions: I18nOptions & { + duplicateTranslationBehavior: DiagnosticHandlingStrategy; + } = { + ...createI18nOptions(projectMetadata, /** inline */ false, context.logger), + duplicateTranslationBehavior: options.i18nDuplicateTranslation || 'warning', + }; // Normalize xliff format extensions let format = options.format; diff --git a/packages/angular/build/src/builders/extract-i18n/schema.json b/packages/angular/build/src/builders/extract-i18n/schema.json index 9ab939b0e938..08a118ad7d5e 100644 --- a/packages/angular/build/src/builders/extract-i18n/schema.json +++ b/packages/angular/build/src/builders/extract-i18n/schema.json @@ -27,6 +27,11 @@ "outFile": { "type": "string", "description": "Name of the file to output." + }, + "i18nDuplicateTranslation": { + "type": "string", + "description": "How to handle duplicate translations.", + "enum": ["error", "warning", "ignore"] } }, "additionalProperties": false diff --git a/packages/angular/build/src/builders/karma/application_builder.ts b/packages/angular/build/src/builders/karma/application_builder.ts index fc92ed59dbc0..34e94b1b7645 100644 --- a/packages/angular/build/src/builders/karma/application_builder.ts +++ b/packages/angular/build/src/builders/karma/application_builder.ts @@ -9,25 +9,31 @@ import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; import type { Config, ConfigOptions, FilePattern, InlinePluginDef, Server } from 'karma'; import { randomUUID } from 'node:crypto'; +import { rmSync } from 'node:fs'; import * as fs from 'node:fs/promises'; -import type { IncomingMessage, ServerResponse } from 'node:http'; -import { createRequire } from 'node:module'; -import * as path from 'node:path'; -import { ReadableStreamController } from 'node:stream/web'; -import { globSync } from 'tinyglobby'; -import { BuildOutputFileType } from '../../tools/esbuild/bundler-context'; -import { emitFilesToDisk } from '../../tools/esbuild/utils'; +import path from 'node:path'; +import { ReadableStream } from 'node:stream/web'; import { createVirtualModulePlugin } from '../../tools/esbuild/virtual-module-plugin'; -import { getProjectRootPaths } from '../../utils/project-metadata'; +import { writeTestFiles } from '../../utils/test-files'; import { buildApplicationInternal } from '../application/index'; import { ApplicationBuilderInternalOptions } from '../application/options'; -import { Result, ResultFile, ResultKind } from '../application/results'; +import { Result, ResultKind } from '../application/results'; import { OutputHashing } from '../application/schema'; -import { findTests, getTestEntrypoints } from './find-tests'; +import { AngularAssetsMiddleware } from './assets-middleware'; +import { createInstrumentationFilter, getInstrumentationExcludedPaths } from './coverage'; +import { getBaseKarmaOptions } from './karma-config'; +import { NormalizedKarmaBuilderOptions, normalizeOptions } from './options'; +import { AngularPolyfillsPlugin } from './polyfills-plugin'; +import { injectKarmaReporter } from './progress-reporter'; import { Schema as KarmaBuilderOptions } from './schema'; - -const localResolve = createRequire(__filename).resolve; -const isWindows = process.platform === 'win32'; +import { + collectEntrypoints, + first, + getProjectSourceRoot, + hasChunkOrWorkerFiles, + normalizePolyfills, +} from './utils'; +import type { KarmaBuilderTransformsOptions } from './index'; interface BuildOptions extends ApplicationBuilderInternalOptions { // We know that it's always a string since we set it. @@ -41,242 +47,21 @@ class ApplicationBuildError extends Error { } } -interface ServeFileFunction { - ( - filepath: string, - rangeHeader: string | string[] | undefined, - response: ServerResponse, - transform?: (c: string | Uint8Array) => string | Uint8Array, - content?: string | Uint8Array, - doNotCache?: boolean, - ): void; -} - -interface LatestBuildFiles { - files: Record; -} - -const LATEST_BUILD_FILES_TOKEN = 'angularLatestBuildFiles'; - -class AngularAssetsMiddleware { - static readonly $inject = ['serveFile', LATEST_BUILD_FILES_TOKEN]; - - static readonly NAME = 'angular-test-assets'; - - constructor( - private readonly serveFile: ServeFileFunction, - private readonly latestBuildFiles: LatestBuildFiles, - ) {} - - handle(req: IncomingMessage, res: ServerResponse, next: (err?: unknown) => unknown) { - const url = new URL(`http://${req.headers['host']}${req.url}`); - // Remove the leading slash from the URL path and convert to platform specific. - // The latest build files will use the platform path separator. - let pathname = url.pathname.slice(1); - if (isWindows) { - pathname = pathname.replaceAll(path.posix.sep, path.win32.sep); - } - - const file = this.latestBuildFiles.files[pathname]; - if (!file) { - next(); - - return; - } - - switch (file.origin) { - case 'disk': - this.serveFile(file.inputPath, undefined, res, undefined, undefined, /* doNotCache */ true); - break; - case 'memory': - // Include pathname to help with Content-Type headers. - this.serveFile(`/unused/${url.pathname}`, undefined, res, undefined, file.contents, true); - break; - } - } - - static createPlugin(initialFiles: LatestBuildFiles): InlinePluginDef { - return { - [LATEST_BUILD_FILES_TOKEN]: ['value', { files: { ...initialFiles.files } }], - - [`middleware:${AngularAssetsMiddleware.NAME}`]: [ - 'factory', - Object.assign((...args: ConstructorParameters) => { - const inst = new AngularAssetsMiddleware(...args); - - return inst.handle.bind(inst); - }, AngularAssetsMiddleware), - ], - }; - } -} - -class AngularPolyfillsPlugin { - static readonly $inject = ['config.files']; - - static readonly NAME = 'angular-polyfills'; - - static createPlugin( - polyfillsFile: FilePattern, - jasmineCleanupFiles: FilePattern, - ): InlinePluginDef { - return { - // This has to be a "reporter" because reporters run _after_ frameworks - // and karma-jasmine-html-reporter injects additional scripts that may - // depend on Jasmine but aren't modules - which means that they would run - // _before_ all module code (including jasmine). - [`reporter:${AngularPolyfillsPlugin.NAME}`]: [ - 'factory', - Object.assign((files: (string | FilePattern)[]) => { - // The correct order is zone.js -> jasmine -> zone.js/testing. - // Jasmine has to see the patched version of the global `setTimeout` - // function so it doesn't cache the unpatched version. And /testing - // needs to see the global `jasmine` object so it can patch it. - const polyfillsIndex = 0; - files.splice(polyfillsIndex, 0, polyfillsFile); - - // Insert just before test_main.js. - const zoneTestingIndex = files.findIndex((f) => { - if (typeof f === 'string') { - return false; - } - - return f.pattern.endsWith('/test_main.js'); - }); - if (zoneTestingIndex === -1) { - throw new Error('Could not find test entrypoint file.'); - } - files.splice(zoneTestingIndex, 0, jasmineCleanupFiles); - - // We need to ensure that all files are served as modules, otherwise - // the order in the files list gets really confusing: Karma doesn't - // set defer on scripts, so all scripts with type=js will run first, - // even if type=module files appeared earlier in `files`. - for (const f of files) { - if (typeof f === 'string') { - throw new Error(`Unexpected string-based file: "${f}"`); - } - if (f.included === false) { - // Don't worry about files that aren't included on the initial - // page load. `type` won't affect them. - continue; - } - if (f.pattern.endsWith('.js') && 'js' === (f.type ?? 'js')) { - f.type = 'module'; - } - } - - // Add browser sourcemap support as a classic script - files.unshift({ - pattern: localResolve('source-map-support/browser-source-map-support.js'), - included: true, - watched: false, - }); - }, AngularPolyfillsPlugin), - ], - }; - } -} - -function injectKarmaReporter( - buildOptions: BuildOptions, - buildIterator: AsyncIterator, - karmaConfig: Config & ConfigOptions, - controller: ReadableStreamController, -) { - const reporterName = 'angular-progress-notifier'; - - interface RunCompleteInfo { - exitCode: number; - } - - interface KarmaEmitter { - refreshFiles(): void; - } - - class ProgressNotifierReporter { - static $inject = ['emitter', LATEST_BUILD_FILES_TOKEN]; - - constructor( - private readonly emitter: KarmaEmitter, - private readonly latestBuildFiles: LatestBuildFiles, - ) { - this.startWatchingBuild(); - } - - private startWatchingBuild() { - void (async () => { - // This is effectively "for await of but skip what's already consumed". - let isDone = false; // to mark the loop condition as "not constant". - while (!isDone) { - const { done, value: buildOutput } = await buildIterator.next(); - if (done) { - isDone = true; - break; - } - - if (buildOutput.kind === ResultKind.Failure) { - controller.enqueue({ success: false, message: 'Build failed' }); - } else if ( - buildOutput.kind === ResultKind.Incremental || - buildOutput.kind === ResultKind.Full - ) { - if (buildOutput.kind === ResultKind.Full) { - this.latestBuildFiles.files = buildOutput.files; - } else { - this.latestBuildFiles.files = { - ...this.latestBuildFiles.files, - ...buildOutput.files, - }; - } - await writeTestFiles(buildOutput.files, buildOptions.outputPath); - this.emitter.refreshFiles(); - } - } - })(); - } - - onRunComplete = function (_browsers: unknown, results: RunCompleteInfo) { - if (results.exitCode === 0) { - controller.enqueue({ success: true }); - } else { - controller.enqueue({ success: false }); - } - }; - } - - karmaConfig.reporters ??= []; - karmaConfig.reporters.push(reporterName); - - karmaConfig.plugins ??= []; - karmaConfig.plugins.push({ - [`reporter:${reporterName}`]: [ - 'factory', - Object.assign( - (...args: ConstructorParameters) => - new ProgressNotifierReporter(...args), - ProgressNotifierReporter, - ), - ], - }); -} - export function execute( options: KarmaBuilderOptions, context: BuilderContext, - karmaOptions: ConfigOptions, - transforms: { - // The karma options transform cannot be async without a refactor of the builder implementation - karmaOptions?: (options: ConfigOptions) => ConfigOptions; - } = {}, + transforms?: KarmaBuilderTransformsOptions, ): AsyncIterable { + const normalizedOptions = normalizeOptions(context, options); + const karmaOptions = getBaseKarmaOptions(normalizedOptions, context); + let karmaServer: Server; return new ReadableStream({ async start(controller) { let init; try { - init = await initializeApplication(options, context, karmaOptions, transforms); + init = await initializeApplication(normalizedOptions, context, karmaOptions, transforms); } catch (err) { if (err instanceof ApplicationBuildError) { controller.enqueue({ success: false, message: err.message }); @@ -310,76 +95,56 @@ export function execute( }); } -async function getProjectSourceRoot(context: BuilderContext): Promise { - // We have already validated that the project name is set before calling this function. - const projectName = context.target?.project; - if (!projectName) { - return context.workspaceRoot; - } - - const projectMetadata = await context.getProjectMetadata(projectName); - const { projectSourceRoot } = getProjectRootPaths(context.workspaceRoot, projectMetadata); - - return projectSourceRoot; -} - -function normalizePolyfills(polyfills: string | string[] | undefined): [string[], string[]] { - if (typeof polyfills === 'string') { - polyfills = [polyfills]; - } else if (!polyfills) { - polyfills = []; - } - - const jasmineGlobalEntryPoint = localResolve('./polyfills/jasmine_global.js'); - const jasmineGlobalCleanupEntrypoint = localResolve('./polyfills/jasmine_global_cleanup.js'); - const sourcemapEntrypoint = localResolve('./polyfills/init_sourcemaps.js'); - - const zoneTestingEntryPoint = 'zone.js/testing'; - const polyfillsExludingZoneTesting = polyfills.filter((p) => p !== zoneTestingEntryPoint); - - return [ - polyfillsExludingZoneTesting.concat([jasmineGlobalEntryPoint, sourcemapEntrypoint]), - polyfillsExludingZoneTesting.length === polyfills.length - ? [jasmineGlobalCleanupEntrypoint] - : [jasmineGlobalCleanupEntrypoint, zoneTestingEntryPoint], - ]; -} - -async function collectEntrypoints( - options: KarmaBuilderOptions, - context: BuilderContext, - projectSourceRoot: string, -): Promise> { - // Glob for files to test. - const testFiles = await findTests( - options.include ?? [], - options.exclude ?? [], - context.workspaceRoot, - projectSourceRoot, - ); - - return getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot: context.workspaceRoot }); -} - -// eslint-disable-next-line max-lines-per-function async function initializeApplication( - options: KarmaBuilderOptions, + options: NormalizedKarmaBuilderOptions, context: BuilderContext, karmaOptions: ConfigOptions, - transforms: { - karmaOptions?: (options: ConfigOptions) => ConfigOptions; - } = {}, + transforms?: KarmaBuilderTransformsOptions, ): Promise< [typeof import('karma'), Config & ConfigOptions, BuildOptions, AsyncIterator | null] > { - const outputPath = path.join(context.workspaceRoot, 'dist/test-out', randomUUID()); + const karma = await import('karma'); const projectSourceRoot = await getProjectSourceRoot(context); - const [karma, entryPoints] = await Promise.all([ - import('karma'), - collectEntrypoints(options, context, projectSourceRoot), - fs.rm(outputPath, { recursive: true, force: true }), - ]); + // Setup temporary output path and ensure it is empty + const outputPath = path.join(context.workspaceRoot, 'dist/test-out', randomUUID()); + await fs.rm(outputPath, { recursive: true, force: true }); + // Setup exit cleanup for temporary directory + const handleProcessExit = () => rmSync(outputPath, { recursive: true, force: true }); + process.once('exit', handleProcessExit); + process.once('SIGINT', handleProcessExit); + process.once('uncaughtException', handleProcessExit); + + const { buildOptions, mainName } = await setupBuildOptions( + options, + context, + projectSourceRoot, + outputPath, + ); + + const [buildOutput, buildIterator] = await runEsbuild(buildOptions, context, projectSourceRoot); + + const karmaConfig = await configureKarma( + karma, + context, + karmaOptions, + options, + buildOptions, + buildOutput, + mainName, + transforms, + ); + + return [karma, karmaConfig, buildOptions, buildIterator]; +} + +async function setupBuildOptions( + options: NormalizedKarmaBuilderOptions, + context: BuilderContext, + projectSourceRoot: string, + outputPath: string, +): Promise<{ buildOptions: BuildOptions; mainName: string }> { + const entryPoints = await collectEntrypoints(options, context, projectSourceRoot); const mainName = 'test_main'; if (options.main) { @@ -410,19 +175,13 @@ async function initializeApplication( index: false, outputHashing: OutputHashing.None, optimization: false, - sourceMap: options.codeCoverage - ? { - scripts: true, - styles: true, - vendor: true, - } - : options.sourceMap, + sourceMap: options.sourceMap, instrumentForCoverage, styles: options.styles, scripts: options.scripts, polyfills, webWorkerTsConfig: options.webWorkerTsConfig, - watch: options.watch ?? !karmaOptions.singleRun, + watch: options.watch, stylePreprocessorOptions: options.stylePreprocessorOptions, inlineStyleLanguage: options.inlineStyleLanguage, fileReplacements: options.fileReplacements, @@ -431,17 +190,29 @@ async function initializeApplication( externalDependencies: options.externalDependencies, }; + return { buildOptions, mainName }; +} + +async function runEsbuild( + buildOptions: BuildOptions, + context: BuilderContext, + projectSourceRoot: string, +): Promise<[Result & { kind: ResultKind.Full }, AsyncIterator | null]> { + const usesZoneJS = buildOptions.polyfills?.includes('zone.js'); const virtualTestBedInit = createVirtualModulePlugin({ namespace: 'angular:test-bed-init', loadContent: async () => { const contents: string[] = [ // Initialize the Angular testing environment + `import { NgModule${usesZoneJS ? ', provideZoneChangeDetection' : ''} } from '@angular/core';`, `import { getTestBed } from '@angular/core/testing';`, `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, - `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {`, + `@NgModule({ providers: [${usesZoneJS ? 'provideZoneChangeDetection(), ' : ''}], })`, + `export class TestModule {}`, + `getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), {`, ` errorOnUnknownElements: true,`, ` errorOnUnknownProperties: true,`, - '});', + `});`, ]; return { @@ -468,6 +239,21 @@ async function initializeApplication( // Write test files await writeTestFiles(buildOutput.files, buildOptions.outputPath); + return [buildOutput, buildIterator]; +} + +async function configureKarma( + karma: typeof import('karma'), + context: BuilderContext, + karmaOptions: ConfigOptions, + options: NormalizedKarmaBuilderOptions, + buildOptions: BuildOptions, + buildOutput: Result & { kind: ResultKind.Full }, + mainName: string, + transforms?: KarmaBuilderTransformsOptions, +): Promise { + const outputPath = buildOptions.outputPath; + // We need to add this to the beginning *after* the testing framework has // prepended its files. The output path is required for each since they are // added later in the test process via a plugin. @@ -488,17 +274,29 @@ async function initializeApplication( karmaOptions.basePath = outputPath; - karmaOptions.files ??= []; + const scriptsFiles: FilePattern[] = []; if (options.scripts?.length) { - // This should be more granular to support named bundles. - // However, it replicates the behavior of the Karma Webpack-based builder. - karmaOptions.files.push({ - pattern: `scripts.js`, - watched: false, - type: 'js', - }); + const outputScripts = new Set(); + for (const scriptEntry of options.scripts) { + const outputName = + typeof scriptEntry === 'string' + ? 'scripts.js' + : `${scriptEntry.bundleName ?? 'scripts'}.js`; + + if (outputScripts.has(outputName)) { + continue; + } + outputScripts.add(outputName); + scriptsFiles.push({ + pattern: `${outputPath}/${outputName}`, + watched: false, + included: typeof scriptEntry === 'string' ? true : scriptEntry.inject !== false, + type: 'js', + }); + } } + karmaOptions.files ??= []; karmaOptions.files.push( // Serve global setup script. { pattern: `${mainName}.js`, type: 'module', watched: false }, @@ -526,8 +324,8 @@ async function initializeApplication( } const parsedKarmaConfig: Config & ConfigOptions = await karma.config.parseConfig( - options.karmaConfig && path.resolve(context.workspaceRoot, options.karmaConfig), - transforms.karmaOptions ? transforms.karmaOptions(karmaOptions) : karmaOptions, + options.karmaConfig, + transforms?.karmaOptions ? await transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true }, ); @@ -572,11 +370,40 @@ async function initializeApplication( parsedKarmaConfig.middleware.push(AngularAssetsMiddleware.NAME); parsedKarmaConfig.plugins.push( - AngularPolyfillsPlugin.createPlugin(polyfillsFile, jasmineCleanupFiles), + AngularPolyfillsPlugin.createPlugin(polyfillsFile, jasmineCleanupFiles, scriptsFiles), ); parsedKarmaConfig.reporters ??= []; parsedKarmaConfig.reporters.push(AngularPolyfillsPlugin.NAME); + // Adjust karma junit reporter outDir location to maintain previous (devkit) behavior + // The base path for the reporter was previously the workspace root. + // To keep the files in the same location, the reporter's output directory is adjusted + // to be relative to the workspace root when using junit. + if (parsedKarmaConfig.reporters?.some((reporter) => reporter === 'junit')) { + if ('junitReporter' in parsedKarmaConfig) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const junitReporterOptions = (parsedKarmaConfig as any)['junitReporter'] as { + outputDir?: unknown; + }; + if (junitReporterOptions.outputDir == undefined) { + junitReporterOptions.outputDir = context.workspaceRoot; + } else if ( + typeof junitReporterOptions.outputDir === 'string' && + !path.isAbsolute(junitReporterOptions.outputDir) + ) { + junitReporterOptions.outputDir = path.join( + context.workspaceRoot, + junitReporterOptions.outputDir, + ); + } + } else { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (parsedKarmaConfig as any)['junitReporter'] = { + outputDir: context.workspaceRoot, + }; + } + } + // When using code-coverage, auto-add karma-coverage. // This was done as part of the karma plugin for webpack. if ( @@ -586,81 +413,5 @@ async function initializeApplication( parsedKarmaConfig.reporters = (parsedKarmaConfig.reporters ?? []).concat(['coverage']); } - return [karma, parsedKarmaConfig, buildOptions, buildIterator]; -} - -function hasChunkOrWorkerFiles(files: Record): boolean { - return Object.keys(files).some((filename) => { - return /(?:^|\/)(?:worker|chunk)[^/]+\.js$/.test(filename); - }); -} - -export async function writeTestFiles(files: Record, testDir: string) { - const directoryExists = new Set(); - // Writes the test related output files to disk and ensures the containing directories are present - await emitFilesToDisk(Object.entries(files), async ([filePath, file]) => { - if (file.type !== BuildOutputFileType.Browser && file.type !== BuildOutputFileType.Media) { - return; - } - - const fullFilePath = path.join(testDir, filePath); - - // Ensure output subdirectories exist - const fileBasePath = path.dirname(fullFilePath); - if (fileBasePath && !directoryExists.has(fileBasePath)) { - await fs.mkdir(fileBasePath, { recursive: true }); - directoryExists.add(fileBasePath); - } - - if (file.origin === 'memory') { - // Write file contents - await fs.writeFile(fullFilePath, file.contents); - } else { - // Copy file contents - await fs.copyFile(file.inputPath, fullFilePath, fs.constants.COPYFILE_FICLONE); - } - }); -} - -/** Returns the first item yielded by the given generator and cancels the execution. */ -async function first( - generator: AsyncIterable, - { cancel }: { cancel: boolean }, -): Promise<[T, AsyncIterator | null]> { - if (!cancel) { - const iterator: AsyncIterator = generator[Symbol.asyncIterator](); - const firstValue = await iterator.next(); - if (firstValue.done) { - throw new Error('Expected generator to emit at least once.'); - } - - return [firstValue.value, iterator]; - } - - for await (const value of generator) { - return [value, null]; - } - - throw new Error('Expected generator to emit at least once.'); -} - -function createInstrumentationFilter(includedBasePath: string, excludedPaths: Set) { - return (request: string): boolean => { - return ( - !excludedPaths.has(request) && - !/\.(e2e|spec)\.tsx?$|[\\/]node_modules[\\/]/.test(request) && - request.startsWith(includedBasePath) - ); - }; -} - -function getInstrumentationExcludedPaths(root: string, excludedPaths: string[]): Set { - const excluded = new Set(); - - for (const excludeGlob of excludedPaths) { - const excludePath = excludeGlob[0] === '/' ? excludeGlob.slice(1) : excludeGlob; - globSync(excludePath, { cwd: root }).forEach((p) => excluded.add(path.join(root, p))); - } - - return excluded; + return parsedKarmaConfig; } diff --git a/packages/angular/build/src/builders/karma/assets-middleware.ts b/packages/angular/build/src/builders/karma/assets-middleware.ts new file mode 100644 index 000000000000..fd6ce489e583 --- /dev/null +++ b/packages/angular/build/src/builders/karma/assets-middleware.ts @@ -0,0 +1,93 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { InlinePluginDef } from 'karma'; +import type { IncomingMessage, ServerResponse } from 'node:http'; +import path from 'node:path'; +import type { ResultFile } from '../application/results'; + +const isWindows = process.platform === 'win32'; + +interface ServeFileFunction { + ( + filepath: string, + rangeHeader: string | string[] | undefined, + response: ServerResponse, + transform?: (c: string | Uint8Array) => string | Uint8Array, + content?: string | Uint8Array, + doNotCache?: boolean, + ): void; +} + +export interface LatestBuildFiles { + files: Record; +} + +const LATEST_BUILD_FILES_TOKEN = 'angularLatestBuildFiles'; + +export class AngularAssetsMiddleware { + static readonly $inject = ['serveFile', LATEST_BUILD_FILES_TOKEN]; + + static readonly NAME = 'angular-test-assets'; + + constructor( + private readonly serveFile: ServeFileFunction, + private readonly latestBuildFiles: LatestBuildFiles, + ) {} + + handle(req: IncomingMessage, res: ServerResponse, next: (err?: unknown) => unknown): void { + const url = new URL(`http://${req.headers['host'] ?? ''}${req.url ?? ''}`); + // Remove the leading slash from the URL path and convert to platform specific. + // The latest build files will use the platform path separator. + let pathname = url.pathname.slice(1); + if (isWindows) { + pathname = pathname.replaceAll(path.posix.sep, path.win32.sep); + } + + const file = this.latestBuildFiles.files[pathname]; + if (!file) { + next(); + + return; + } + + // Implementation of serverFile can be found here: + // https://github.com/karma-runner/karma/blob/84f85e7016efc2266fa6b3465f494a3fa151c85c/lib/middleware/common.js#L10 + switch (file.origin) { + case 'disk': + this.serveFile(file.inputPath, undefined, res, undefined, undefined, /* doNotCache */ true); + break; + case 'memory': + // Include pathname to help with Content-Type headers. + this.serveFile( + `/unused/${url.pathname}`, + undefined, + res, + undefined, + file.contents, + /* doNotCache */ false, + ); + break; + } + } + + static createPlugin(initialFiles: LatestBuildFiles): InlinePluginDef { + return { + [LATEST_BUILD_FILES_TOKEN]: ['value', { files: { ...initialFiles.files } }], + + [`middleware:${AngularAssetsMiddleware.NAME}`]: [ + 'factory', + Object.assign((...args: ConstructorParameters) => { + const inst = new AngularAssetsMiddleware(...args); + + return inst.handle.bind(inst); + }, AngularAssetsMiddleware), + ], + }; + } +} diff --git a/packages/angular/build/src/builders/karma/coverage.ts b/packages/angular/build/src/builders/karma/coverage.ts new file mode 100644 index 000000000000..7a19f57fbebf --- /dev/null +++ b/packages/angular/build/src/builders/karma/coverage.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import path from 'node:path'; +import { globSync } from 'tinyglobby'; + +export function createInstrumentationFilter(includedBasePath: string, excludedPaths: Set) { + return (request: string): boolean => { + return ( + !excludedPaths.has(request) && + !/\.(e2e|spec)\.tsx?$|[\\/]node_modules[\\/]|[\\/]\.angular[\\/]/.test(request) && + request.startsWith(includedBasePath) + ); + }; +} + +export function getInstrumentationExcludedPaths( + root: string, + excludedPaths: string[], +): Set { + const excluded = new Set(); + + for (const excludeGlob of excludedPaths) { + const excludePath = excludeGlob[0] === '/' ? excludeGlob.slice(1) : excludeGlob; + globSync(excludePath, { cwd: root }).forEach((p) => excluded.add(path.join(root, p))); + } + + return excluded; +} diff --git a/packages/angular/build/src/builders/karma/find-tests.ts b/packages/angular/build/src/builders/karma/find-tests.ts index ec25d56cf9d2..00468146df5f 100644 --- a/packages/angular/build/src/builders/karma/find-tests.ts +++ b/packages/angular/build/src/builders/karma/find-tests.ts @@ -6,151 +6,27 @@ * found in the LICENSE file at https://angular.dev/license */ -import { PathLike, constants, promises as fs } from 'node:fs'; -import { basename, dirname, extname, join, relative } from 'node:path'; -import { glob, isDynamicPattern } from 'tinyglobby'; +import { findTests as findTestsBase } from '../unit-test/test-discovery'; -/* Go through all patterns and find unique list of files */ -export async function findTests( - include: string[], - exclude: string[], - workspaceRoot: string, - projectSourceRoot: string, -): Promise { - const matchingTestsPromises = include.map((pattern) => - findMatchingTests(pattern, exclude, workspaceRoot, projectSourceRoot), - ); - const files = await Promise.all(matchingTestsPromises); - - // Unique file names - return [...new Set(files.flat())]; -} - -interface TestEntrypointsOptions { - projectSourceRoot: string; - workspaceRoot: string; -} - -/** Generate unique bundle names for a set of test files. */ -export function getTestEntrypoints( - testFiles: string[], - { projectSourceRoot, workspaceRoot }: TestEntrypointsOptions, -): Map { - const seen = new Set(); - - return new Map( - Array.from(testFiles, (testFile) => { - const relativePath = removeRoots(testFile, [projectSourceRoot, workspaceRoot]) - // Strip leading dots and path separators. - .replace(/^[./\\]+/, '') - // Replace any path separators with dashes. - .replace(/[/\\]/g, '-'); - const baseName = `spec-${basename(relativePath, extname(relativePath))}`; - let uniqueName = baseName; - let suffix = 2; - while (seen.has(uniqueName)) { - uniqueName = `${baseName}-${suffix}`.replace(/([^\w](?:spec|test))-([\d]+)$/, '-$2$1'); - ++suffix; - } - seen.add(uniqueName); - - return [uniqueName, testFile]; - }), - ); -} - -const normalizePath = (path: string): string => path.replace(/\\/g, '/'); - -const removeLeadingSlash = (pattern: string): string => { - if (pattern.charAt(0) === '/') { - return pattern.substring(1); - } +// This file is a compatibility layer that re-exports the test discovery logic from its new location. +// This is necessary to avoid breaking the Karma builder, which still depends on this file. +export { getTestEntrypoints } from '../unit-test/test-discovery'; - return pattern; +const removeLeadingSlash = (path: string): string => { + return path.startsWith('/') ? path.substring(1) : path; }; -const removeRelativeRoot = (path: string, root: string): string => { - if (path.startsWith(root)) { - return path.substring(root.length); - } - - return path; -}; - -function removeRoots(path: string, roots: string[]): string { - for (const root of roots) { - if (path.startsWith(root)) { - return path.substring(root.length); - } - } - - return basename(path); -} - -async function findMatchingTests( - pattern: string, - ignore: string[], +export async function findTests( + include: string[], + exclude: string[], workspaceRoot: string, projectSourceRoot: string, ): Promise { - // normalize pattern, glob lib only accepts forward slashes - let normalizedPattern = normalizePath(pattern); - normalizedPattern = removeLeadingSlash(normalizedPattern); - - const relativeProjectRoot = normalizePath(relative(workspaceRoot, projectSourceRoot) + '/'); - - // remove relativeProjectRoot to support relative paths from root - // such paths are easy to get when running scripts via IDEs - normalizedPattern = removeRelativeRoot(normalizedPattern, relativeProjectRoot); - - // special logic when pattern does not look like a glob - if (!isDynamicPattern(normalizedPattern)) { - if (await isDirectory(join(projectSourceRoot, normalizedPattern))) { - normalizedPattern = `${normalizedPattern}/**/*.spec.@(ts|tsx)`; - } else { - // see if matching spec file exists - const fileExt = extname(normalizedPattern); - // Replace extension to `.spec.ext`. Example: `src/app/app.component.ts`-> `src/app/app.component.spec.ts` - const potentialSpec = join( - projectSourceRoot, - dirname(normalizedPattern), - `${basename(normalizedPattern, fileExt)}.spec${fileExt}`, - ); - - if (await exists(potentialSpec)) { - return [potentialSpec]; - } - } - } - - // normalize the patterns in the ignore list - const normalizedIgnorePatternList = ignore.map((pattern: string) => - removeRelativeRoot(removeLeadingSlash(normalizePath(pattern)), relativeProjectRoot), + // Karma has legacy support for workspace "root-relative" file paths + return findTestsBase( + include.map(removeLeadingSlash), + exclude.map(removeLeadingSlash), + workspaceRoot, + projectSourceRoot, ); - - return glob(normalizedPattern, { - cwd: projectSourceRoot, - absolute: true, - ignore: ['**/node_modules/**', ...normalizedIgnorePatternList], - }); -} - -async function isDirectory(path: PathLike): Promise { - try { - const stats = await fs.stat(path); - - return stats.isDirectory(); - } catch { - return false; - } -} - -async function exists(path: PathLike): Promise { - try { - await fs.access(path, constants.F_OK); - - return true; - } catch { - return false; - } } diff --git a/packages/angular/build/src/builders/karma/find-tests_spec.ts b/packages/angular/build/src/builders/karma/find-tests_spec.ts index 8264539ae9dd..88c97c8575fe 100644 --- a/packages/angular/build/src/builders/karma/find-tests_spec.ts +++ b/packages/angular/build/src/builders/karma/find-tests_spec.ts @@ -62,6 +62,36 @@ describe('getTestEntrypoints', () => { ]), ); }); + + describe('with removeTestExtension enabled', () => { + function getEntrypoints(workspaceRelative: string[], sourceRootRelative: string[] = []) { + return getTestEntrypoints( + [ + ...workspaceRelative.map((p) => joinWithSeparator(options.workspaceRoot, p)), + ...sourceRootRelative.map((p) => joinWithSeparator(options.projectSourceRoot, p)), + ], + { ...options, removeTestExtension: true }, + ); + } + + it('removes .spec extension', () => { + expect(getEntrypoints(['a/b.spec.js'], ['c/d.spec.js'])).toEqual( + new Map([ + ['spec-a-b', joinWithSeparator(options.workspaceRoot, 'a/b.spec.js')], + ['spec-c-d', joinWithSeparator(options.projectSourceRoot, 'c/d.spec.js')], + ]), + ); + }); + + it('removes .test extension', () => { + expect(getEntrypoints(['a/b.test.js'], ['c/d.test.js'])).toEqual( + new Map([ + ['spec-a-b', joinWithSeparator(options.workspaceRoot, 'a/b.test.js')], + ['spec-c-d', joinWithSeparator(options.projectSourceRoot, 'c/d.test.js')], + ]), + ); + }); + }); }); } }); diff --git a/packages/angular/build/src/builders/karma/index.ts b/packages/angular/build/src/builders/karma/index.ts index 1e5f5613e3a3..f2db8d56c598 100644 --- a/packages/angular/build/src/builders/karma/index.ts +++ b/packages/angular/build/src/builders/karma/index.ts @@ -13,14 +13,12 @@ import { createBuilder, } from '@angular-devkit/architect'; import type { ConfigOptions } from 'karma'; -import { createRequire } from 'node:module'; -import path from 'node:path'; + import type { Schema as KarmaBuilderOptions } from './schema'; -export type KarmaConfigOptions = ConfigOptions & { - buildWebpack?: unknown; - configFile?: string; -}; +export interface KarmaBuilderTransformsOptions { + karmaOptions?: (options: ConfigOptions) => ConfigOptions | Promise; +} /** * @experimental Direct usage of this function is considered experimental. @@ -28,108 +26,11 @@ export type KarmaConfigOptions = ConfigOptions & { export async function* execute( options: KarmaBuilderOptions, context: BuilderContext, - transforms: { - // The karma options transform cannot be async without a refactor of the builder implementation - karmaOptions?: (options: KarmaConfigOptions) => KarmaConfigOptions; - } = {}, + transforms?: KarmaBuilderTransformsOptions, ): AsyncIterable { const { execute } = await import('./application_builder'); - const karmaOptions = getBaseKarmaOptions(options, context); - - yield* execute(options, context, karmaOptions, transforms); -} - -function getBaseKarmaOptions( - options: KarmaBuilderOptions, - context: BuilderContext, -): KarmaConfigOptions { - let singleRun: boolean | undefined; - if (options.watch !== undefined) { - singleRun = !options.watch; - } - - // Determine project name from builder context target - const projectName = context.target?.project; - if (!projectName) { - throw new Error(`The 'karma' builder requires a target to be specified.`); - } - - const karmaOptions: KarmaConfigOptions = options.karmaConfig - ? {} - : getBuiltInKarmaConfig(context.workspaceRoot, projectName); - - karmaOptions.singleRun = singleRun; - - // Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default - // for single run executions. Not clearing context for multi-run (watched) builds allows the - // Jasmine Spec Runner to be visible in the browser after test execution. - karmaOptions.client ??= {}; - karmaOptions.client.clearContext ??= singleRun ?? false; // `singleRun` defaults to `false` per Karma docs. - - // Convert browsers from a string to an array - if (typeof options.browsers === 'string' && options.browsers) { - karmaOptions.browsers = options.browsers.split(',').map((browser) => browser.trim()); - } else if (options.browsers === false) { - karmaOptions.browsers = []; - } - - if (options.reporters) { - // Split along commas to make it more natural, and remove empty strings. - const reporters = options.reporters - .reduce((acc, curr) => acc.concat(curr.split(',')), []) - .filter((x) => !!x); - - if (reporters.length > 0) { - karmaOptions.reporters = reporters; - } - } - - return karmaOptions; -} - -function getBuiltInKarmaConfig( - workspaceRoot: string, - projectName: string, -): ConfigOptions & Record { - let coverageFolderName = projectName.charAt(0) === '@' ? projectName.slice(1) : projectName; - coverageFolderName = coverageFolderName.toLowerCase(); - - const workspaceRootRequire = createRequire(workspaceRoot + '/'); - // Any changes to the config here need to be synced to: packages/schematics/angular/config/files/karma.conf.js.template - return { - basePath: '', - frameworks: ['jasmine'], - plugins: [ - 'karma-jasmine', - 'karma-chrome-launcher', - 'karma-jasmine-html-reporter', - 'karma-coverage', - ].map((p) => workspaceRootRequire(p)), - jasmineHtmlReporter: { - suppressAll: true, // removes the duplicated traces - }, - coverageReporter: { - dir: path.join(workspaceRoot, 'coverage', coverageFolderName), - subdir: '.', - reporters: [{ type: 'html' }, { type: 'text-summary' }], - }, - reporters: ['progress', 'kjhtml'], - browsers: ['Chrome'], - customLaunchers: { - // Chrome configured to run in a bazel sandbox. - // Disable the use of the gpu and `/dev/shm` because it causes Chrome to - // crash on some environments. - // See: - // https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#tips - // https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t - ChromeHeadlessNoSandbox: { - base: 'ChromeHeadless', - flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage'], - }, - }, - restartOnFileChange: true, - }; + yield* execute(options, context, transforms); } export type { KarmaBuilderOptions }; diff --git a/packages/angular/build/src/builders/karma/karma-config.ts b/packages/angular/build/src/builders/karma/karma-config.ts new file mode 100644 index 000000000000..08e39887bcb1 --- /dev/null +++ b/packages/angular/build/src/builders/karma/karma-config.ts @@ -0,0 +1,93 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderContext } from '@angular-devkit/architect'; +import type { ConfigOptions } from 'karma'; +import { createRequire } from 'node:module'; +import path from 'node:path'; +import type { NormalizedKarmaBuilderOptions } from './options'; + +export function getBaseKarmaOptions( + options: NormalizedKarmaBuilderOptions, + context: BuilderContext, +): ConfigOptions { + // Determine project name from builder context target + const projectName = context.target?.project; + if (!projectName) { + throw new Error(`The 'karma' builder requires a target to be specified.`); + } + + const karmaOptions: ConfigOptions = options.karmaConfig + ? {} + : getBuiltInKarmaConfig(context.workspaceRoot, projectName); + + const singleRun = !options.watch; + karmaOptions.singleRun = singleRun; + + // Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default + // for single run executions. Not clearing context for multi-run (watched) builds allows the + // Jasmine Spec Runner to be visible in the browser after test execution. + karmaOptions.client ??= {}; + karmaOptions.client.clearContext ??= singleRun; + + // Convert browsers from a string to an array + if (options.browsers) { + karmaOptions.browsers = options.browsers; + } + + if (options.reporters) { + karmaOptions.reporters = options.reporters; + } + + return karmaOptions; +} + +function getBuiltInKarmaConfig( + workspaceRoot: string, + projectName: string, +): ConfigOptions & Record { + let coverageFolderName = projectName.charAt(0) === '@' ? projectName.slice(1) : projectName; + coverageFolderName = coverageFolderName.toLowerCase(); + + const workspaceRootRequire = createRequire(workspaceRoot + '/'); + + // Any changes to the config here need to be synced to: packages/schematics/angular/config/files/karma.conf.js.template + return { + basePath: '', + frameworks: ['jasmine'], + plugins: [ + 'karma-jasmine', + 'karma-chrome-launcher', + 'karma-jasmine-html-reporter', + 'karma-coverage', + ].map((p) => workspaceRootRequire(p)), + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces + }, + coverageReporter: { + dir: path.join(workspaceRoot, 'coverage', coverageFolderName), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + customLaunchers: { + // Chrome configured to run in a bazel sandbox. + // Disable the use of the gpu and `/dev/shm` because it causes Chrome to + // crash on some environments. + // See: + // https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#tips + // https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage'], + }, + }, + restartOnFileChange: true, + }; +} diff --git a/packages/angular/build/src/builders/karma/options.ts b/packages/angular/build/src/builders/karma/options.ts new file mode 100644 index 000000000000..03ba443702c3 --- /dev/null +++ b/packages/angular/build/src/builders/karma/options.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderContext } from '@angular-devkit/architect'; +import { resolve } from 'node:path'; +import { Schema as KarmaBuilderOptions } from './schema'; + +export type NormalizedKarmaBuilderOptions = ReturnType; + +export function normalizeOptions(context: BuilderContext, options: KarmaBuilderOptions) { + const { + sourceMap, + karmaConfig, + browsers, + watch = true, + include = [], + exclude = [], + reporters = [], + ...rest + } = options; + + let normalizedBrowsers: string[] | undefined; + if (typeof options.browsers === 'string' && options.browsers) { + normalizedBrowsers = options.browsers.split(',').map((browser) => browser.trim()); + } else if (options.browsers === false) { + normalizedBrowsers = []; + } + + // Split along commas to make it more natural, and remove empty strings. + const normalizedReporters = reporters + .reduce((acc, curr) => acc.concat(curr.split(',')), []) + .filter((x) => !!x); + + // Sourcemaps are always needed when code coverage is enabled. + const normalizedSourceMap = options.codeCoverage + ? { + scripts: true, + styles: true, + vendor: true, + } + : sourceMap; + + return { + ...rest, + sourceMap: normalizedSourceMap, + karmaConfig: karmaConfig ? resolve(context.workspaceRoot, karmaConfig) : undefined, + reporters: normalizedReporters.length ? normalizedReporters : undefined, + browsers: normalizedBrowsers, + watch, + include, + exclude, + }; +} diff --git a/packages/angular/build/src/builders/karma/polyfills-plugin.ts b/packages/angular/build/src/builders/karma/polyfills-plugin.ts new file mode 100644 index 000000000000..5cf1022766ec --- /dev/null +++ b/packages/angular/build/src/builders/karma/polyfills-plugin.ts @@ -0,0 +1,86 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { FilePattern, InlinePluginDef } from 'karma'; +import { createRequire } from 'node:module'; + +const localResolve = createRequire(__filename).resolve; + +export class AngularPolyfillsPlugin { + static readonly $inject = ['config.files']; + + static readonly NAME = 'angular-polyfills'; + + static createPlugin( + polyfillsFile: FilePattern, + jasmineCleanupFiles: FilePattern, + scriptsFiles: FilePattern[], + ): InlinePluginDef { + return { + // This has to be a "reporter" because reporters run _after_ frameworks + // and karma-jasmine-html-reporter injects additional scripts that may + // depend on Jasmine but aren't modules - which means that they would run + // _before_ all module code (including jasmine). + [`reporter:${AngularPolyfillsPlugin.NAME}`]: [ + 'factory', + Object.assign((files: (string | FilePattern)[]) => { + // The correct order is zone.js -> jasmine -> zone.js/testing. + // Jasmine has to see the patched version of the global `setTimeout` + // function so it doesn't cache the unpatched version. And /testing + // needs to see the global `jasmine` object so it can patch it. + const polyfillsIndex = 0; + files.splice(polyfillsIndex, 0, polyfillsFile); + + // Insert just before test_main.js. + const zoneTestingIndex = files.findIndex((f) => { + if (typeof f === 'string') { + return false; + } + + return f.pattern.endsWith('/test_main.js'); + }); + if (zoneTestingIndex === -1) { + throw new Error('Could not find test entrypoint file.'); + } + files.splice(zoneTestingIndex, 0, jasmineCleanupFiles); + + // We need to ensure that all files are served as modules, otherwise + // the order in the files list gets really confusing: Karma doesn't + // set defer on scripts, so all scripts with type=js will run first, + // even if type=module files appeared earlier in `files`. + for (const f of files) { + if (typeof f === 'string') { + throw new Error(`Unexpected string-based file: "${f}"`); + } + if (f.included === false) { + // Don't worry about files that aren't included on the initial + // page load. `type` won't affect them. + continue; + } + if (f.pattern.endsWith('.js') && 'js' === (f.type ?? 'js')) { + f.type = 'module'; + } + } + + // Add "scripts" option files as classic scripts + files.unshift(...scriptsFiles); + + // Add browser sourcemap support as a classic script + files.unshift({ + pattern: localResolve('source-map-support/browser-source-map-support.js'), + included: true, + watched: false, + }); + + // Karma needs a return value for a factory and Karma's multi-reporter expects an `adapters` array + return { adapters: [] }; + }, AngularPolyfillsPlugin), + ], + }; + } +} diff --git a/packages/angular/build/src/builders/karma/progress-reporter.ts b/packages/angular/build/src/builders/karma/progress-reporter.ts new file mode 100644 index 000000000000..908f1c856e6d --- /dev/null +++ b/packages/angular/build/src/builders/karma/progress-reporter.ts @@ -0,0 +1,108 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderOutput } from '@angular-devkit/architect'; +import type { Config, ConfigOptions } from 'karma'; +import type { ReadableStreamController } from 'node:stream/web'; +import { writeTestFiles } from '../../utils/test-files'; +import type { ApplicationBuilderInternalOptions } from '../application/options'; +import type { Result } from '../application/results'; +import { ResultKind } from '../application/results'; +import type { LatestBuildFiles } from './assets-middleware'; + +const LATEST_BUILD_FILES_TOKEN = 'angularLatestBuildFiles'; + +interface BuildOptions extends ApplicationBuilderInternalOptions { + // We know that it's always a string since we set it. + outputPath: string; +} + +export function injectKarmaReporter( + buildOptions: BuildOptions, + buildIterator: AsyncIterator, + karmaConfig: Config & ConfigOptions, + controller: ReadableStreamController, +): void { + const reporterName = 'angular-progress-notifier'; + + interface RunCompleteInfo { + exitCode: number; + } + + interface KarmaEmitter { + refreshFiles(): void; + } + + class ProgressNotifierReporter { + static $inject = ['emitter', LATEST_BUILD_FILES_TOKEN]; + // Needed for the karma reporter interface, see https://github.com/angular/angular-cli/issues/31629 + adapters = []; + + constructor( + private readonly emitter: KarmaEmitter, + private readonly latestBuildFiles: LatestBuildFiles, + ) { + this.startWatchingBuild(); + } + + private startWatchingBuild() { + void (async () => { + // This is effectively "for await of but skip what's already consumed". + let isDone = false; // to mark the loop condition as "not constant". + while (!isDone) { + const { done, value: buildOutput } = await buildIterator.next(); + if (done) { + isDone = true; + break; + } + + if (buildOutput.kind === ResultKind.Failure) { + controller.enqueue({ success: false, message: 'Build failed' }); + } else if ( + buildOutput.kind === ResultKind.Incremental || + buildOutput.kind === ResultKind.Full + ) { + if (buildOutput.kind === ResultKind.Full) { + this.latestBuildFiles.files = buildOutput.files; + } else { + this.latestBuildFiles.files = { + ...this.latestBuildFiles.files, + ...buildOutput.files, + }; + } + await writeTestFiles(buildOutput.files, buildOptions.outputPath); + this.emitter.refreshFiles(); + } + } + })(); + } + + onRunComplete = function (_browsers: unknown, results: RunCompleteInfo): void { + if (results.exitCode === 0) { + controller.enqueue({ success: true }); + } else { + controller.enqueue({ success: false }); + } + }; + } + + karmaConfig.reporters ??= []; + karmaConfig.reporters.push(reporterName); + + karmaConfig.plugins ??= []; + karmaConfig.plugins.push({ + [`reporter:${reporterName}`]: [ + 'factory', + Object.assign( + (...args: ConstructorParameters) => + new ProgressNotifierReporter(...args), + ProgressNotifierReporter, + ), + ], + }); +} diff --git a/packages/angular/build/src/builders/karma/schema.json b/packages/angular/build/src/builders/karma/schema.json index cf7125217846..325f4298f779 100644 --- a/packages/angular/build/src/builders/karma/schema.json +++ b/packages/angular/build/src/builders/karma/schema.json @@ -163,10 +163,10 @@ "default": [] }, "loader": { - "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.", + "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` inlines the content as a Base64-encoded string; `empty` considers the content to be empty and not include it in bundles.", "type": "object", "patternProperties": { - "^\\.\\S+$": { "enum": ["text", "binary", "file", "empty"] } + "^\\.\\S+$": { "enum": ["text", "binary", "file", "dataurl", "base64", "empty"] } } }, "define": { @@ -229,7 +229,8 @@ }, "watch": { "type": "boolean", - "description": "Run build when files change." + "description": "Re-run tests when source files change.", + "default": true }, "poll": { "type": "number", diff --git a/packages/angular/build/src/builders/karma/tests/behavior/code-coverage_spec.ts b/packages/angular/build/src/builders/karma/tests/behavior/code-coverage_spec.ts index 835f48724dbe..9882af429b76 100644 --- a/packages/angular/build/src/builders/karma/tests/behavior/code-coverage_spec.ts +++ b/packages/angular/build/src/builders/karma/tests/behavior/code-coverage_spec.ts @@ -7,7 +7,6 @@ */ import { setTimeout } from 'node:timers/promises'; -import { tags } from '@angular-devkit/core'; import { last, tap } from 'rxjs'; import { execute } from '../../index'; import { BASE_OPTIONS, KARMA_BUILDER_INFO, describeKarmaBuilder } from '../setup'; @@ -96,12 +95,12 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { await harness.modifyFile('src/app/app.component.ts', (content) => { return content.replace( `title = 'app'`, - tags.stripIndents` - title = 'app'; + ` +title = 'app'; - async foo() { - return 'foo'; - } +async foo() { + return 'foo'; +} `, ); }); diff --git a/packages/angular/build/src/builders/karma/tests/behavior/fake-async_spec.ts b/packages/angular/build/src/builders/karma/tests/behavior/fake-async_spec.ts index 355ddda8ed43..16da8daf2f55 100644 --- a/packages/angular/build/src/builders/karma/tests/behavior/fake-async_spec.ts +++ b/packages/angular/build/src/builders/karma/tests/behavior/fake-async_spec.ts @@ -35,12 +35,14 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { } }`, './src/app/app.component.spec.ts': ` + import { provideZoneChangeDetection } from '@angular/core'; import { TestBed, fakeAsync, tick } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(() => TestBed.configureTestingModule({ + providers: [provideZoneChangeDetection()], declarations: [AppComponent] })); diff --git a/packages/angular/build/src/builders/karma/tests/behavior/module-cjs_spec.ts b/packages/angular/build/src/builders/karma/tests/behavior/module-cjs_spec.ts index d5c1c7b3d134..646ee6b605ee 100644 --- a/packages/angular/build/src/builders/karma/tests/behavior/module-cjs_spec.ts +++ b/packages/angular/build/src/builders/karma/tests/behavior/module-cjs_spec.ts @@ -22,6 +22,7 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { await harness.modifyFile('src/tsconfig.spec.json', (content) => { const tsConfig = JSON.parse(content); + tsConfig.compilerOptions.moduleResolution = 'bundler'; tsConfig.compilerOptions.module = 'commonjs'; return JSON.stringify(tsConfig); diff --git a/packages/angular/build/src/builders/karma/tests/behavior/rebuilds_spec.ts b/packages/angular/build/src/builders/karma/tests/behavior/rebuilds_spec.ts index 6ec02c2c28f1..a03dbf235982 100644 --- a/packages/angular/build/src/builders/karma/tests/behavior/rebuilds_spec.ts +++ b/packages/angular/build/src/builders/karma/tests/behavior/rebuilds_spec.ts @@ -6,10 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import { concatMap, count, debounceTime, distinctUntilChanged, take, timeout } from 'rxjs'; import { execute } from '../../index'; import { BASE_OPTIONS, KARMA_BUILDER_INFO, describeKarmaBuilder } from '../setup'; -import { BuilderOutput } from '@angular-devkit/architect'; import { randomBytes } from 'node:crypto'; describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { @@ -26,48 +24,29 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { const goodFile = await harness.readFile('src/app/app.component.spec.ts'); - interface OutputCheck { - (result: BuilderOutput | undefined): Promise; - } - - const expectedSequence: OutputCheck[] = [ - async (result) => { - // Karma run should succeed. - // Add a compilation error. - expect(result?.success).withContext('Initial test run should succeed').toBeTrue(); - // Add an syntax error to a non-main file. - await harness.appendToFile('src/app/app.component.spec.ts', `error`); - }, - async (result) => { - expect(result?.success) - .withContext('Test should fail after build error was introduced') - .toBeFalse(); - await harness.writeFile('src/app/app.component.spec.ts', goodFile); - }, - async (result) => { - expect(result?.success) - .withContext('Test should succeed again after build error was fixed') - .toBeTrue(); - }, - ]; - - const buildCount = await harness - .execute({ outputLogsOnFailure: false }) - .pipe( - timeout(60000), - debounceTime(500), - // There may be a sequence of {success:true} events that should be - // de-duplicated. - distinctUntilChanged((prev, current) => prev.result?.success === current.result?.success), - concatMap(async ({ result }, index) => { - await expectedSequence[index](result); - }), - take(expectedSequence.length), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(expectedSequence.length); + await harness.executeWithCases( + [ + async ({ result }) => { + // Karma run should succeed. + // Add a compilation error. + expect(result?.success).withContext('Initial test run should succeed').toBeTrue(); + // Add an syntax error to a non-main file. + await harness.appendToFile('src/app/app.component.spec.ts', `error`); + }, + async ({ result }) => { + expect(result?.success) + .withContext('Test should fail after build error was introduced') + .toBeFalse(); + await harness.writeFile('src/app/app.component.spec.ts', goodFile); + }, + ({ result }) => { + expect(result?.success) + .withContext('Test should succeed again after build error was fixed') + .toBeTrue(); + }, + ], + { outputLogsOnFailure: false }, + ); }); it('correctly serves binary assets on rebuilds', async () => { @@ -89,12 +68,8 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { assets: ['src/random.bin'], }); - interface OutputCheck { - (result: BuilderOutput | undefined): Promise; - } - - const expectedSequence: OutputCheck[] = [ - async (result) => { + await harness.executeWithCases([ + async ({ result }) => { // Karma run should succeed. expect(result?.success).withContext('Initial test run should succeed').toBeTrue(); // Modify test file to trigger a rebuild @@ -103,25 +78,10 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { `\n;console.log('modified');`, ); }, - async (result) => { + ({ result }) => { expect(result?.success).withContext('Test should succeed again').toBeTrue(); }, - ]; - - const buildCount = await harness - .execute({ outputLogsOnFailure: true }) - .pipe( - timeout(60000), - debounceTime(500), - concatMap(async ({ result }, index) => { - await expectedSequence[index](result); - }), - take(expectedSequence.length), - count(), - ) - .toPromise(); - - expect(buildCount).toBe(expectedSequence.length); + ]); }); }); }); diff --git a/packages/angular/build/src/builders/karma/tests/options/scripts_spec.ts b/packages/angular/build/src/builders/karma/tests/options/scripts_spec.ts new file mode 100644 index 000000000000..483a05929e1c --- /dev/null +++ b/packages/angular/build/src/builders/karma/tests/options/scripts_spec.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { BASE_OPTIONS, KARMA_BUILDER_INFO, describeKarmaBuilder } from '../setup'; + +describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => { + describe('Option: "scripts"', () => { + beforeEach(async () => { + await setupTarget(harness); + }); + + it(`should be able to access non injected script`, async () => { + await harness.writeFiles({ + 'src/test.js': `console.log('hello from test script.')`, + 'src/app/app.component.ts': ` + import { Component } from '@angular/core'; + + @Component({ + selector: 'app-root', + standalone: false, + template: '

Hello World

' + }) + export class AppComponent { + loadScript() { + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.onload = () => resolve(); + script.onerror = reject; + script.src = 'test.js'; + document.body.appendChild(script); + }); + } + } + `, + 'src/app/app.component.spec.ts': ` + import { TestBed } from '@angular/core/testing'; + import { AppComponent } from './app.component'; + + describe('AppComponent', () => { + beforeEach(() => TestBed.configureTestingModule({ + declarations: [AppComponent] + })); + + it('should load script', async () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + + await expectAsync(fixture.componentInstance.loadScript()).toBeResolved(); + }); + });`, + }); + + harness.useTarget('test', { + ...BASE_OPTIONS, + scripts: [ + { + input: 'src/test.js', + bundleName: 'test', + inject: false, + }, + ], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + }); +}); diff --git a/packages/angular/build/src/builders/karma/utils.ts b/packages/angular/build/src/builders/karma/utils.ts new file mode 100644 index 000000000000..6ce8e33ed9aa --- /dev/null +++ b/packages/angular/build/src/builders/karma/utils.ts @@ -0,0 +1,91 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderContext } from '@angular-devkit/architect'; +import { createRequire } from 'node:module'; +import { BuildOutputFileType } from '../../tools/esbuild/bundler-context'; +import { getProjectRootPaths } from '../../utils/project-metadata'; +import { findTests, getTestEntrypoints } from './find-tests'; +import type { NormalizedKarmaBuilderOptions } from './options'; + +const localResolve = createRequire(__filename).resolve; + +export async function getProjectSourceRoot(context: BuilderContext): Promise { + // We have already validated that the project name is set before calling this function. + const projectName = context.target?.project; + if (!projectName) { + return context.workspaceRoot; + } + + const projectMetadata = await context.getProjectMetadata(projectName); + const { projectSourceRoot } = getProjectRootPaths(context.workspaceRoot, projectMetadata); + + return projectSourceRoot; +} + +export function normalizePolyfills( + polyfills: string[] = [], +): [polyfills: string[], jasmineCleanup: string[]] { + const jasmineGlobalEntryPoint = localResolve('./polyfills/jasmine_global.js'); + const jasmineGlobalCleanupEntrypoint = localResolve('./polyfills/jasmine_global_cleanup.js'); + const sourcemapEntrypoint = localResolve('./polyfills/init_sourcemaps.js'); + + const zoneTestingEntryPoint = 'zone.js/testing'; + const polyfillsExludingZoneTesting = polyfills.filter((p) => p !== zoneTestingEntryPoint); + + return [ + polyfillsExludingZoneTesting.concat([jasmineGlobalEntryPoint, sourcemapEntrypoint]), + polyfillsExludingZoneTesting.length === polyfills.length + ? [jasmineGlobalCleanupEntrypoint] + : [jasmineGlobalCleanupEntrypoint, zoneTestingEntryPoint], + ]; +} + +export async function collectEntrypoints( + options: NormalizedKarmaBuilderOptions, + context: BuilderContext, + projectSourceRoot: string, +): Promise> { + // Glob for files to test. + const testFiles = await findTests( + options.include, + options.exclude, + context.workspaceRoot, + projectSourceRoot, + ); + + return getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot: context.workspaceRoot }); +} + +export function hasChunkOrWorkerFiles(files: Record): boolean { + return Object.keys(files).some((filename) => { + return /(?:^|\/)(?:worker|chunk)[^/]+\.js$/.test(filename); + }); +} + +/** Returns the first item yielded by the given generator and cancels the execution. */ +export async function first( + generator: AsyncIterable, + { cancel }: { cancel: boolean }, +): Promise<[T, AsyncIterator | null]> { + if (!cancel) { + const iterator: AsyncIterator = generator[Symbol.asyncIterator](); + const firstValue = await iterator.next(); + if (firstValue.done) { + throw new Error('Expected generator to emit at least once.'); + } + + return [firstValue.value, iterator]; + } + + for await (const value of generator) { + return [value, null]; + } + + throw new Error('Expected generator to emit at least once.'); +} diff --git a/packages/angular/build/src/builders/unit-test/builder.ts b/packages/angular/build/src/builders/unit-test/builder.ts index 9eb1a552bdd6..122039595bd9 100644 --- a/packages/angular/build/src/builders/unit-test/builder.ts +++ b/packages/angular/build/src/builders/unit-test/builder.ts @@ -6,225 +6,332 @@ * found in the LICENSE file at https://angular.dev/license */ -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; +import { + type BuilderContext, + type BuilderOutput, + targetStringFromTarget, +} from '@angular-devkit/architect'; import assert from 'node:assert'; -import { randomUUID } from 'node:crypto'; -import { createRequire } from 'node:module'; +import { rm } from 'node:fs/promises'; import path from 'node:path'; import { createVirtualModulePlugin } from '../../tools/esbuild/virtual-module-plugin'; -import { loadEsmModule } from '../../utils/load-esm'; +import { assertIsError } from '../../utils/error'; +import { writeTestFiles } from '../../utils/test-files'; import { buildApplicationInternal } from '../application'; import type { ApplicationBuilderExtensions, ApplicationBuilderInternalOptions, } from '../application/options'; import { ResultKind } from '../application/results'; -import { OutputHashing } from '../application/schema'; -import { writeTestFiles } from '../karma/application_builder'; -import { findTests, getTestEntrypoints } from '../karma/find-tests'; -import { useKarmaBuilder } from './karma-bridge'; import { normalizeOptions } from './options'; -import type { Schema as UnitTestOptions } from './schema'; +import type { TestRunner } from './runners/api'; +import { MissingDependenciesError } from './runners/dependency-checker'; +import type { Schema as UnitTestBuilderOptions } from './schema'; +import { findTests } from './test-discovery'; + +export type { UnitTestBuilderOptions }; + +async function loadTestRunner(runnerName: string): Promise { + // Harden against directory traversal + if (!/^[a-zA-Z0-9-]+$/.test(runnerName)) { + throw new Error( + `Invalid runner name "${runnerName}". Runner names can only contain alphanumeric characters and hyphens.`, + ); + } + + let runnerModule; + try { + runnerModule = await import(`./runners/${runnerName}/index`); + } catch (e) { + assertIsError(e); + if (e.code === 'ERR_MODULE_NOT_FOUND') { + throw new Error(`Unknown test runner "${runnerName}".`); + } + throw new Error( + `Failed to load the '${runnerName}' test runner. The package may be corrupted or improperly installed.\n` + + `Error: ${e.message}`, + ); + } + + const runner = runnerModule.default; + if ( + !runner || + typeof runner.getBuildOptions !== 'function' || + typeof runner.createExecutor !== 'function' + ) { + throw new Error( + `The loaded test runner '${runnerName}' does not appear to be a valid TestRunner implementation.`, + ); + } + + return runner; +} + +function prepareBuildExtensions( + virtualFiles: Record | undefined, + projectSourceRoot: string, + extensions?: ApplicationBuilderExtensions, +): ApplicationBuilderExtensions | undefined { + if (!virtualFiles) { + return extensions; + } + + extensions ??= {}; + extensions.codePlugins ??= []; + for (const [namespace, contents] of Object.entries(virtualFiles)) { + extensions.codePlugins.push( + createVirtualModulePlugin({ + namespace, + loadContent: () => { + return { + contents, + loader: 'js', + resolveDir: projectSourceRoot, + }; + }, + }), + ); + } + + return extensions; +} -export type { UnitTestOptions }; +async function* runBuildAndTest( + executor: import('./runners/api').TestExecutor, + applicationBuildOptions: ApplicationBuilderInternalOptions, + context: BuilderContext, + dumpDirectory: string | undefined, + extensions: ApplicationBuilderExtensions | undefined, +): AsyncIterable { + let consecutiveErrorCount = 0; + for await (const buildResult of buildApplicationInternal( + applicationBuildOptions, + context, + extensions, + )) { + if (buildResult.kind === ResultKind.Failure) { + yield { success: false }; + continue; + } else if ( + buildResult.kind !== ResultKind.Full && + buildResult.kind !== ResultKind.Incremental + ) { + assert.fail( + 'A full and/or incremental build result is required from the application builder.', + ); + } + + assert(buildResult.files, 'Builder did not provide result files.'); + + if (dumpDirectory) { + if (buildResult.kind === ResultKind.Full) { + // Full build, so clean the directory + await rm(dumpDirectory, { recursive: true, force: true }); + } else { + // Incremental build, so delete removed files + for (const file of buildResult.removed) { + await rm(path.join(dumpDirectory, file.path), { force: true }); + } + } + await writeTestFiles(buildResult.files, dumpDirectory); + context.logger.info(`Build output files successfully dumped to '${dumpDirectory}'.`); + } + + // Pass the build artifacts to the executor + try { + yield* executor.execute(buildResult); + + // Successful execution resets the failure counter + consecutiveErrorCount = 0; + } catch (e) { + assertIsError(e); + context.logger.error(`An exception occurred during test execution:\n${e.stack ?? e.message}`); + if (e instanceof AggregateError) { + e.errors.forEach((inner) => { + assertIsError(inner); + context.logger.error(inner.stack ?? inner.message); + }); + } + + yield { success: false }; + consecutiveErrorCount++; + } + + if (consecutiveErrorCount >= 3) { + context.logger.error( + 'Test runner process has failed multiple times in a row. Please fix the configuration and restart the process.', + ); + + return; + } + } +} /** * @experimental Direct usage of this function is considered experimental. */ export async function* execute( - options: UnitTestOptions, + options: UnitTestBuilderOptions, context: BuilderContext, - extensions: ApplicationBuilderExtensions = {}, + extensions?: ApplicationBuilderExtensions, ): AsyncIterable { // Determine project name from builder context target const projectName = context.target?.project; if (!projectName) { - context.logger.error( - `The "${context.builder.builderName}" builder requires a target to be specified.`, - ); - - return; - } - - context.logger.warn( - `NOTE: The "${context.builder.builderName}" builder is currently EXPERIMENTAL and not ready for production use.`, - ); - - const normalizedOptions = await normalizeOptions(context, projectName, options); - const { projectSourceRoot, workspaceRoot, runnerName } = normalizedOptions; - - // Translate options and use karma builder directly if specified - if (runnerName === 'karma') { - const karmaBridge = await useKarmaBuilder(context, normalizedOptions); - yield* karmaBridge; + context.logger.error(`The builder requires a target to be specified.`); return; } - if (runnerName !== 'vitest') { - context.logger.error('Unknown test runner: ' + runnerName); + // Initialize the test runner and normalize options + let runner; + let normalizedOptions; + try { + normalizedOptions = await normalizeOptions(context, projectName, options); + runner = await loadTestRunner(normalizedOptions.runnerName); + await runner.validateDependencies?.(normalizedOptions); + } catch (e) { + assertIsError(e); + if (e instanceof MissingDependenciesError) { + context.logger.error(e.message); + } else { + context.logger.error( + `An exception occurred during initialization of the test runner:\n${e.stack ?? e.message}`, + ); + } + yield { success: false }; return; } - // Find test files - const testFiles = await findTests( - normalizedOptions.include, - normalizedOptions.exclude, - workspaceRoot, - projectSourceRoot, - ); - - if (testFiles.length === 0) { - context.logger.error('No tests found.'); - - return { success: false }; - } - - const entryPoints = getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot }); - entryPoints.set('init-testbed', 'angular:test-bed-init'); + if (normalizedOptions.listTests) { + const testFiles = await findTests( + normalizedOptions.include, + normalizedOptions.exclude ?? [], + normalizedOptions.workspaceRoot, + normalizedOptions.projectSourceRoot, + ); - const { startVitest } = await loadEsmModule('vitest/node'); + context.logger.info('Discovered test files:'); + for (const file of testFiles) { + context.logger.info(` ${path.relative(normalizedOptions.workspaceRoot, file)}`); + } - // Setup test file build options based on application build target options - const buildTargetOptions = (await context.validateOptions( - await context.getTargetOptions(normalizedOptions.buildTarget), - await context.getBuilderNameForTarget(normalizedOptions.buildTarget), - )) as unknown as ApplicationBuilderInternalOptions; + yield { success: true }; - if (buildTargetOptions.polyfills?.includes('zone.js')) { - buildTargetOptions.polyfills.push('zone.js/testing'); + return; } - const outputPath = path.join(context.workspaceRoot, 'dist/test-out', randomUUID()); - const buildOptions: ApplicationBuilderInternalOptions = { - ...buildTargetOptions, - watch: normalizedOptions.watch, - outputPath, - index: false, - browser: undefined, - server: undefined, - localize: false, - budgets: [], - serviceWorker: false, - appShell: false, - ssr: false, - prerender: false, - sourceMap: { scripts: true, vendor: false, styles: false }, - outputHashing: OutputHashing.None, - optimization: false, - tsConfig: normalizedOptions.tsConfig, - entryPoints, - externalDependencies: ['vitest', ...(buildTargetOptions.externalDependencies ?? [])], - }; - extensions ??= {}; - extensions.codePlugins ??= []; - const virtualTestBedInit = createVirtualModulePlugin({ - namespace: 'angular:test-bed-init', - loadContent: async () => { - const contents: string[] = [ - // Initialize the Angular testing environment - `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';`, - `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, - `import { beforeEach, afterEach } from 'vitest';`, - '', - // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29 - `beforeEach(getCleanupHook(false));`, - `afterEach(getCleanupHook(true));`, - '', - `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {`, - ` errorOnUnknownElements: true,`, - ` errorOnUnknownProperties: true,`, - '});', - ]; - - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: projectSourceRoot, - }; - }, - }); - extensions.codePlugins.unshift(virtualTestBedInit); - - let instance: import('vitest/node').Vitest | undefined; - - // Setup vitest browser options if configured - let browser: import('vitest/node').BrowserConfigOptions | undefined; - if (normalizedOptions.browsers) { - const provider = findBrowserProvider(projectSourceRoot); - if (!provider) { + if (runner.isStandalone) { + try { + await using executor = await runner.createExecutor(context, normalizedOptions, undefined); + yield* executor.execute({ + kind: ResultKind.Full, + files: {}, + }); + } catch (e) { + assertIsError(e); context.logger.error( - 'The "browsers" option requires either "playwright" or "webdriverio" to be installed within the project.' + - ' Please install one of these packages and rerun the test command.', + `An exception occurred during standalone test execution:\n${e.stack ?? e.message}`, ); - - return { success: false }; + yield { success: false }; } - browser = { - enabled: true, - provider, - instances: normalizedOptions.browsers.map((browserName) => ({ - browser: browserName, - })), - }; + return; } - for await (const result of buildApplicationInternal(buildOptions, context, extensions)) { - if (result.kind === ResultKind.Failure) { - continue; - } else if (result.kind !== ResultKind.Full) { - assert.fail('A full build result is required from the application builder.'); + // Get base build options from the buildTarget + let buildTargetOptions: ApplicationBuilderInternalOptions; + try { + const builderName = await context.getBuilderNameForTarget(normalizedOptions.buildTarget); + if ( + builderName !== '@angular/build:application' && + // TODO: Add comprehensive support for ng-packagr. + builderName !== '@angular/build:ng-packagr' + ) { + context.logger.warn( + `The 'buildTarget' is configured to use '${builderName}', which is not supported. ` + + `The 'unit-test' builder is designed to work with '@angular/build:application'. ` + + 'Unexpected behavior or build failures may occur.', + ); } - assert(result.files, 'Builder did not provide result files.'); - - await writeTestFiles(result.files, outputPath); - - const setupFiles = ['init-testbed.js']; - if (buildTargetOptions?.polyfills?.length) { - setupFiles.push('polyfills.js'); - } + buildTargetOptions = (await context.validateOptions( + await context.getTargetOptions(normalizedOptions.buildTarget), + builderName, + )) as unknown as ApplicationBuilderInternalOptions; + } catch (e) { + assertIsError(e); + context.logger.error( + `Could not load build target options for "${targetStringFromTarget( + normalizedOptions.buildTarget, + )}".\n` + + `Please check your 'angular.json' configuration.\n` + + `Error: ${e.message}`, + ); + yield { success: false }; - instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, { - test: { - root: outputPath, - setupFiles, - // Use `jsdom` if no browsers are explicitly configured. - // `node` is effectively no "environment" and the default. - environment: browser ? 'node' : 'jsdom', - watch: normalizedOptions.watch, - browser, - reporters: normalizedOptions.reporters ?? ['default'], - coverage: { - enabled: normalizedOptions.codeCoverage, - exclude: normalizedOptions.codeCoverageExclude, - excludeAfterRemap: true, - }, - }, - }); + return; + } - // Check if all the tests pass to calculate the result - const testModules = instance.state.getTestModules(); + // Get runner-specific build options + let runnerBuildOptions; + let virtualFiles; + let testEntryPointMappings; + try { + ({ + buildOptions: runnerBuildOptions, + virtualFiles, + testEntryPointMappings, + } = await runner.getBuildOptions(normalizedOptions, buildTargetOptions)); + } catch (e) { + assertIsError(e); + context.logger.error( + `An exception occurred while getting runner-specific build options:\n${e.stack ?? e.message}`, + ); + yield { success: false }; - yield { success: testModules.every((testModule) => testModule.ok()) }; + return; } -} -function findBrowserProvider( - projectSourceRoot: string, -): import('vitest/node').BrowserBuiltinProvider | undefined { - const projectResolver = createRequire(projectSourceRoot + '/').resolve; - - // These must be installed in the project to be used - const vitestBuiltinProviders = ['playwright', 'webdriverio'] as const; + try { + await using executor = await runner.createExecutor( + context, + normalizedOptions, + testEntryPointMappings, + ); - for (const providerName of vitestBuiltinProviders) { - try { - projectResolver(providerName); + const finalExtensions = prepareBuildExtensions( + virtualFiles, + normalizedOptions.projectSourceRoot, + extensions, + ); - return providerName; - } catch {} + // Prepare and run the application build + const applicationBuildOptions = { + ...buildTargetOptions, + ...runnerBuildOptions, + watch: normalizedOptions.watch, + progress: normalizedOptions.buildProgress ?? buildTargetOptions.progress, + ...(normalizedOptions.tsConfig ? { tsConfig: normalizedOptions.tsConfig } : {}), + } satisfies ApplicationBuilderInternalOptions; + + const dumpDirectory = normalizedOptions.dumpVirtualFiles + ? path.join(normalizedOptions.cacheOptions.path, 'unit-test', 'output-files') + : undefined; + + yield* runBuildAndTest( + executor, + applicationBuildOptions, + context, + dumpDirectory, + finalExtensions, + ); + } catch (e) { + assertIsError(e); + context.logger.error( + `An exception occurred while creating the test executor:\n${e.stack ?? e.message}`, + ); + yield { success: false }; } } diff --git a/packages/angular/build/src/builders/unit-test/index.ts b/packages/angular/build/src/builders/unit-test/index.ts index bd325ec661fa..47666cdc1067 100644 --- a/packages/angular/build/src/builders/unit-test/index.ts +++ b/packages/angular/build/src/builders/unit-test/index.ts @@ -7,10 +7,10 @@ */ import { type Builder, createBuilder } from '@angular-devkit/architect'; -import { type UnitTestOptions, execute } from './builder'; +import { type UnitTestBuilderOptions, execute } from './builder'; -export { type UnitTestOptions, execute }; +export { type UnitTestBuilderOptions, execute }; -const builder: Builder = createBuilder(execute); +const builder: Builder = createBuilder(execute); export default builder; diff --git a/packages/angular/build/src/builders/unit-test/karma-bridge.ts b/packages/angular/build/src/builders/unit-test/karma-bridge.ts deleted file mode 100644 index 1080e8ade73e..000000000000 --- a/packages/angular/build/src/builders/unit-test/karma-bridge.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import type { ApplicationBuilderInternalOptions } from '../application/options'; -import type { KarmaBuilderOptions } from '../karma'; -import type { NormalizedUnitTestOptions } from './options'; - -export async function useKarmaBuilder( - context: BuilderContext, - unitTestOptions: NormalizedUnitTestOptions, -): Promise> { - const buildTargetOptions = (await context.validateOptions( - await context.getTargetOptions(unitTestOptions.buildTarget), - await context.getBuilderNameForTarget(unitTestOptions.buildTarget), - )) as unknown as ApplicationBuilderInternalOptions; - - const options: KarmaBuilderOptions = { - tsConfig: unitTestOptions.tsConfig, - polyfills: buildTargetOptions.polyfills, - assets: buildTargetOptions.assets, - scripts: buildTargetOptions.scripts, - styles: buildTargetOptions.styles, - inlineStyleLanguage: buildTargetOptions.inlineStyleLanguage, - stylePreprocessorOptions: buildTargetOptions.stylePreprocessorOptions, - externalDependencies: buildTargetOptions.externalDependencies, - loader: buildTargetOptions.loader, - define: buildTargetOptions.define, - include: unitTestOptions.include, - exclude: unitTestOptions.exclude, - sourceMap: buildTargetOptions.sourceMap, - progress: buildTargetOptions.progress, - watch: unitTestOptions.watch, - poll: buildTargetOptions.poll, - preserveSymlinks: buildTargetOptions.preserveSymlinks, - browsers: unitTestOptions.browsers?.join(','), - codeCoverage: unitTestOptions.codeCoverage, - codeCoverageExclude: unitTestOptions.codeCoverageExclude, - fileReplacements: buildTargetOptions.fileReplacements, - reporters: unitTestOptions.reporters, - webWorkerTsConfig: buildTargetOptions.webWorkerTsConfig, - aot: buildTargetOptions.aot, - }; - - const { execute } = await import('../karma'); - - return execute(options, context); -} diff --git a/packages/angular/build/src/builders/unit-test/options.ts b/packages/angular/build/src/builders/unit-test/options.ts index 2cd09a3b03e9..7f8f8db182fe 100644 --- a/packages/angular/build/src/builders/unit-test/options.ts +++ b/packages/angular/build/src/builders/unit-test/options.ts @@ -7,17 +7,39 @@ */ import { type BuilderContext, targetFromTargetString } from '@angular-devkit/architect'; +import { constants, promises as fs } from 'node:fs'; import path from 'node:path'; import { normalizeCacheOptions } from '../../utils/normalize-cache'; import { getProjectRootPaths } from '../../utils/project-metadata'; -import type { Schema as UnitTestOptions } from './schema'; +import { isTTY } from '../../utils/tty'; +import { Runner, type Schema as UnitTestBuilderOptions } from './schema'; -export type NormalizedUnitTestOptions = Awaited>; +export type NormalizedUnitTestBuilderOptions = Awaited>; + +async function exists(path: string): Promise { + try { + await fs.access(path, constants.F_OK); + + return true; + } catch { + return false; + } +} + +function normalizeReporterOption( + reporters: unknown[] | undefined, +): [string, Record][] | undefined { + return reporters?.map((entry) => + typeof entry === 'string' + ? ([entry, {}] as [string, Record]) + : (entry as [string, Record]), + ); +} export async function normalizeOptions( context: BuilderContext, projectName: string, - options: UnitTestOptions, + options: UnitTestBuilderOptions, ) { // Setup base paths based on workspace root and project information const workspaceRoot = context.workspaceRoot; @@ -32,7 +54,35 @@ export async function normalizeOptions( const buildTargetSpecifier = options.buildTarget ?? `::development`; const buildTarget = targetFromTargetString(buildTargetSpecifier, projectName, 'build'); - const { codeCoverage, codeCoverageExclude, tsConfig, runner, reporters, browsers } = options; + const { runner, browsers, progress, filter, browserViewport, ui, runnerConfig } = options; + + if (ui && runner !== Runner.Vitest) { + throw new Error('The "ui" option is only available for the "vitest" runner.'); + } + + const [width, height] = browserViewport?.split('x').map(Number) ?? []; + + let tsConfig = options.tsConfig; + if (tsConfig) { + const fullTsConfigPath = path.join(workspaceRoot, tsConfig); + if (!(await exists(fullTsConfigPath))) { + throw new Error(`The specified tsConfig file '${tsConfig}' does not exist.`); + } + } else { + const tsconfigSpecPath = path.join(projectRoot, 'tsconfig.spec.json'); + if (await exists(tsconfigSpecPath)) { + // The application builder expects a path relative to the workspace root. + tsConfig = path.relative(workspaceRoot, tsconfigSpecPath); + } + } + + let watch = options.watch ?? isTTY(); + if (options.ui && options.watch === false) { + context.logger.warn( + `The '--ui' option requires watch mode. The '--no-watch' flag will be ignored.`, + ); + watch = true; + } return { // Project/workspace information @@ -43,29 +93,48 @@ export async function normalizeOptions( // Target/configuration specified options buildTarget, include: options.include ?? ['**/*.spec.ts'], - exclude: options.exclude ?? [], - runnerName: runner, - codeCoverage, - codeCoverageExclude, + exclude: options.exclude, + filter, + runnerName: runner ?? Runner.Vitest, + coverage: { + enabled: options.coverage, + exclude: options.coverageExclude, + include: options.coverageInclude, + reporters: normalizeReporterOption(options.coverageReporters), + thresholds: options.coverageThresholds, + // The schema generation tool doesn't support tuple types for items, but the schema validation + // does ensure that the array has exactly two numbers. + watermarks: options.coverageWatermarks as { + statements?: [number, number]; + branches?: [number, number]; + functions?: [number, number]; + lines?: [number, number]; + }, + }, tsConfig, - reporters, + buildProgress: progress, + reporters: normalizeReporterOption(options.reporters), + outputFile: options.outputFile, browsers, - // TODO: Implement watch support - watch: false, + browserViewport: width && height ? { width, height } : undefined, + watch, + debug: options.debug ?? false, + ui: process.env['CI'] ? false : ui, + providersFile: options.providersFile && path.join(workspaceRoot, options.providersFile), + setupFiles: options.setupFiles + ? options.setupFiles.map((setupFile) => path.join(workspaceRoot, setupFile)) + : [], + dumpVirtualFiles: options.dumpVirtualFiles, + listTests: options.listTests, + runnerConfig: + typeof runnerConfig === 'string' + ? runnerConfig.length === 0 + ? true + : path.resolve(workspaceRoot, runnerConfig) + : runnerConfig, }; } -/** - * Normalize a directory path string. - * Currently only removes a trailing slash if present. - * @param path A path string. - * @returns A normalized path string. - */ -function normalizeDirectoryPath(path: string): string { - const last = path[path.length - 1]; - if (last === '/' || last === '\\') { - return path.slice(0, -1); - } - - return path; +export function injectTestingPolyfills(polyfills: string[] = []): string[] { + return polyfills.includes('zone.js') ? [...polyfills, 'zone.js/testing'] : polyfills; } diff --git a/packages/angular/build/src/builders/unit-test/runners/api.ts b/packages/angular/build/src/builders/unit-test/runners/api.ts new file mode 100644 index 000000000000..43f65ef68adc --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/api.ts @@ -0,0 +1,82 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; +import type { ApplicationBuilderInternalOptions } from '../../application/options'; +import type { FullResult, IncrementalResult } from '../../application/results'; +import type { NormalizedUnitTestBuilderOptions } from '../options'; + +/** + * Represents the options for a test runner. + */ +export interface RunnerOptions { + /** + * Partial options for the application builder. + * These will be merged with the options from the build target. + */ + buildOptions: Partial; + + /** + * A record of virtual files to be added to the build. + * The key is the file path and the value is the file content. + */ + virtualFiles?: Record; + + /** + * A map of test entry points to their corresponding test files. + * This is used to avoid re-discovering the test files in the executor. + */ + testEntryPointMappings?: Map; +} + +/** + * Represents a stateful test execution session. + * An instance of this is created for each `ng test` command. + */ +export interface TestExecutor { + /** + * Executes tests using the artifacts from a specific build. + * This method can be called multiple times in watch mode. + * + * @param buildResult The output from the application builder. + * @returns An async iterable builder output stream. + */ + execute(buildResult: FullResult | IncrementalResult): AsyncIterable; + + [Symbol.asyncDispose](): Promise; +} + +/** + * Represents the metadata and hooks for a specific test runner. + */ +export interface TestRunner { + readonly name: string; + readonly isStandalone?: boolean; + + validateDependencies?(options: NormalizedUnitTestBuilderOptions): void | Promise; + + getBuildOptions( + options: NormalizedUnitTestBuilderOptions, + baseBuildOptions: Partial, + ): RunnerOptions | Promise; + + /** + * Creates a stateful executor for a test session. + * This is called once at the start of the `ng test` command. + * + * @param context The Architect builder context. + * @param options The normalized unit test options. + * @param testEntryPointMappings A map of test entry points to their corresponding test files. + * @returns A TestExecutor instance that will handle the test runs. + */ + createExecutor( + context: BuilderContext, + options: NormalizedUnitTestBuilderOptions, + testEntryPointMappings: Map | undefined, + ): Promise; +} diff --git a/packages/angular/build/src/builders/unit-test/runners/dependency-checker.ts b/packages/angular/build/src/builders/unit-test/runners/dependency-checker.ts new file mode 100644 index 000000000000..3072bb038464 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/dependency-checker.ts @@ -0,0 +1,89 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { createRequire } from 'node:module'; + +/** + * A custom error class to represent missing dependency errors. + * This is used to avoid printing a stack trace for this expected error. + */ +export class MissingDependenciesError extends Error { + constructor(message: string) { + super(message); + this.name = 'MissingDependenciesError'; + } +} + +type Resolver = (packageName: string) => string; + +export class DependencyChecker { + private readonly resolver: Resolver; + private readonly missingDependencies = new Set(); + + constructor(projectSourceRoot: string) { + this.resolver = createRequire(projectSourceRoot + '/').resolve; + } + + /** + * Checks if a package is installed. + * @param packageName The name of the package to check. + * @returns True if the package is found, false otherwise. + */ + private isInstalled(packageName: string): boolean { + try { + this.resolver(packageName); + + return true; + } catch { + return false; + } + } + + /** + * Verifies that a package is installed and adds it to a list of missing + * dependencies if it is not. + * @param packageName The name of the package to check. + */ + check(packageName: string): void { + if (!this.isInstalled(packageName)) { + this.missingDependencies.add(packageName); + } + } + + /** + * Verifies that at least one of a list of packages is installed. If none are + * installed, a custom error message is added to the list of errors. + * @param packageNames An array of package names to check. + * @param customErrorMessage The error message to use if none of the packages are found. + */ + checkAny(packageNames: string[], customErrorMessage: string): void { + if (packageNames.every((name) => !this.isInstalled(name))) { + // This is a custom error, so we add it directly. + // Using a Set avoids duplicate custom messages. + this.missingDependencies.add(customErrorMessage); + } + } + + /** + * Throws a `MissingDependenciesError` if any dependencies were found to be missing. + * The error message is a formatted list of all missing packages. + */ + report(): void { + if (this.missingDependencies.size === 0) { + return; + } + + let message = 'The following packages are required but were not found:\n'; + for (const name of this.missingDependencies) { + message += ` - ${name}\n`; + } + message += 'Please install the missing packages and rerun the test command.'; + + throw new MissingDependenciesError(message); + } +} diff --git a/packages/angular/build/src/builders/unit-test/runners/karma/executor.ts b/packages/angular/build/src/builders/unit-test/runners/karma/executor.ts new file mode 100644 index 000000000000..0cee5e11cd6f --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/karma/executor.ts @@ -0,0 +1,154 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; +import fs from 'node:fs/promises'; +import path from 'node:path'; +import type { ApplicationBuilderInternalOptions } from '../../../application/options'; +import type { KarmaBuilderOptions, KarmaBuilderTransformsOptions } from '../../../karma'; +import { type NormalizedUnitTestBuilderOptions, injectTestingPolyfills } from '../../options'; +import type { TestExecutor } from '../api'; + +export class KarmaExecutor implements TestExecutor { + constructor( + private context: BuilderContext, + private options: NormalizedUnitTestBuilderOptions, + ) {} + + async *execute(): AsyncIterable { + const { context, options: unitTestOptions } = this; + + if (unitTestOptions.browserViewport) { + context.logger.warn( + 'The "karma" test runner does not support the "browserViewport" option. The option will be ignored.', + ); + } + + if (unitTestOptions.debug) { + context.logger.warn( + 'The "karma" test runner does not support the "debug" option. The option will be ignored.', + ); + } + + if (unitTestOptions.setupFiles.length) { + context.logger.warn( + 'The "karma" test runner does not support the "setupFiles" option. The option will be ignored.', + ); + } + + if (unitTestOptions.coverage?.include) { + context.logger.warn( + 'The "karma" test runner does not support the "coverageInclude" option. The option will be ignored.', + ); + } + + const buildTargetOptions = (await context.validateOptions( + await context.getTargetOptions(unitTestOptions.buildTarget), + await context.getBuilderNameForTarget(unitTestOptions.buildTarget), + )) as unknown as ApplicationBuilderInternalOptions; + + let karmaConfig: string | undefined; + if (typeof unitTestOptions.runnerConfig === 'string') { + karmaConfig = unitTestOptions.runnerConfig; + context.logger.info(`Using Karma configuration file: ${karmaConfig}`); + } else if (unitTestOptions.runnerConfig) { + const potentialPath = path.join(unitTestOptions.projectRoot, 'karma.conf.js'); + try { + await fs.access(potentialPath); + karmaConfig = potentialPath; + context.logger.info(`Using Karma configuration file: ${karmaConfig}`); + } catch { + context.logger.info('No Karma configuration file found. Using default configuration.'); + } + } + + const karmaOptions: KarmaBuilderOptions = { + karmaConfig, + tsConfig: unitTestOptions.tsConfig ?? buildTargetOptions.tsConfig, + polyfills: injectTestingPolyfills(buildTargetOptions.polyfills), + assets: buildTargetOptions.assets, + scripts: buildTargetOptions.scripts, + styles: buildTargetOptions.styles, + inlineStyleLanguage: buildTargetOptions.inlineStyleLanguage, + stylePreprocessorOptions: buildTargetOptions.stylePreprocessorOptions, + externalDependencies: buildTargetOptions.externalDependencies, + loader: buildTargetOptions.loader, + define: buildTargetOptions.define, + include: unitTestOptions.include, + exclude: unitTestOptions.exclude, + sourceMap: buildTargetOptions.sourceMap, + progress: unitTestOptions.buildProgress ?? buildTargetOptions.progress, + watch: unitTestOptions.watch, + poll: buildTargetOptions.poll, + preserveSymlinks: buildTargetOptions.preserveSymlinks, + browsers: unitTestOptions.browsers?.join(','), + codeCoverage: unitTestOptions.coverage.enabled, + codeCoverageExclude: unitTestOptions.coverage.exclude, + fileReplacements: buildTargetOptions.fileReplacements, + reporters: unitTestOptions.reporters?.map((reporter) => { + // Karma only supports string reporters. + if (Object.keys(reporter[1]).length > 0) { + context.logger.warn( + `The "karma" test runner does not support options for the "${reporter[0]}" reporter. The options will be ignored.`, + ); + } + + return reporter[0]; + }), + webWorkerTsConfig: buildTargetOptions.webWorkerTsConfig, + aot: buildTargetOptions.aot, + }; + + const transformOptions = { + karmaOptions: (options) => { + if (unitTestOptions.filter) { + let filter = unitTestOptions.filter; + if (filter[0] === '/' && filter.at(-1) === '/') { + this.context.logger.warn( + 'The `--filter` option is always a regular expression.' + + 'Leading and trailing `/` are not required and will be ignored.', + ); + } else { + filter = `/${filter}/`; + } + + options.client ??= {}; + options.client.args ??= []; + options.client.args.push('--grep', filter); + } + + // Add coverage options + if (unitTestOptions.coverage.enabled) { + const { thresholds, watermarks } = unitTestOptions.coverage; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const coverageReporter = ((options as any).coverageReporter ??= {}); + + if (thresholds) { + coverageReporter.check = thresholds.perFile + ? { each: thresholds } + : { global: thresholds }; + } + + if (watermarks) { + coverageReporter.watermarks = watermarks; + } + } + + return options; + }, + } satisfies KarmaBuilderTransformsOptions; + + const { execute } = await import('../../../karma'); + + yield* execute(karmaOptions, context, transformOptions); + } + + async [Symbol.asyncDispose](): Promise { + // The Karma builder handles its own teardown + } +} diff --git a/packages/angular/build/src/builders/unit-test/runners/karma/index.ts b/packages/angular/build/src/builders/unit-test/runners/karma/index.ts new file mode 100644 index 000000000000..36eadb255c47 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/karma/index.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { TestRunner } from '../api'; +import { DependencyChecker } from '../dependency-checker'; +import { KarmaExecutor } from './executor'; + +/** + * A declarative definition of the Karma test runner. + */ +const KarmaTestRunner: TestRunner = { + name: 'karma', + isStandalone: true, + + validateDependencies(options) { + const checker = new DependencyChecker(options.projectSourceRoot); + checker.check('karma'); + checker.check('karma-jasmine'); + + // Check for browser launchers + if (options.browsers?.length) { + for (const browser of options.browsers) { + const launcherName = `karma-${browser.toLowerCase().split('headless')[0]}-launcher`; + checker.check(launcherName); + } + } + + if (options.coverage) { + checker.check('karma-coverage'); + } + + checker.report(); + }, + + getBuildOptions() { + return { + buildOptions: {}, + }; + }, + + async createExecutor(context, options) { + return new KarmaExecutor(context, options); + }, +}; + +export default KarmaTestRunner; diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider.ts new file mode 100644 index 000000000000..3aeeb7afe474 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider.ts @@ -0,0 +1,147 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { createRequire } from 'node:module'; +import type { BrowserBuiltinProvider, BrowserConfigOptions } from 'vitest/node'; +import { assertIsError } from '../../../../utils/error'; + +export interface BrowserConfiguration { + browser?: BrowserConfigOptions; + errors?: string[]; +} + +function findBrowserProvider( + projectResolver: NodeJS.RequireResolve, +): BrowserBuiltinProvider | undefined { + const requiresPreview = !!process.versions.webcontainer; + + // One of these must be installed in the project to use browser testing + const vitestBuiltinProviders = requiresPreview + ? (['preview'] as const) + : (['playwright', 'webdriverio', 'preview'] as const); + + for (const providerName of vitestBuiltinProviders) { + try { + projectResolver(`@vitest/browser-${providerName}`); + + return providerName; + } catch {} + } + + return undefined; +} + +function normalizeBrowserName(browserName: string): { browser: string; headless: boolean } { + // Normalize browser names to match Vitest's expectations for headless but also supports karma's names + // e.g., 'ChromeHeadless' -> 'chrome', 'FirefoxHeadless' -> 'firefox' + // and 'Chrome' -> 'chrome', 'Firefox' -> 'firefox'. + const normalized = browserName.toLowerCase(); + const headless = normalized.endsWith('headless'); + + return { + browser: headless ? normalized.slice(0, -8) : normalized, + headless: headless, + }; +} + +export async function setupBrowserConfiguration( + browsers: string[] | undefined, + debug: boolean, + projectSourceRoot: string, + viewport: { width: number; height: number } | undefined, +): Promise { + if (browsers === undefined) { + return {}; + } + + const projectResolver = createRequire(projectSourceRoot + '/').resolve; + let errors: string[] | undefined; + + const providerName = findBrowserProvider(projectResolver); + if (!providerName) { + errors ??= []; + errors.push( + 'The "browsers" option requires either "playwright" or "webdriverio" to be installed within the project.' + + ' Please install one of these packages and rerun the test command.', + ); + } + + let provider: import('vitest/node').BrowserProviderOption | undefined; + if (providerName) { + const providerPackage = `@vitest/browser-${providerName}`; + try { + const providerModule = await import(projectResolver(providerPackage)); + + // Validate that the imported module has the expected structure + const providerFactory = providerModule[providerName]; + if (typeof providerFactory === 'function') { + if ( + providerName === 'playwright' && + process.env['CHROME_BIN']?.includes('rules_browsers') + ) { + // Use the Chrome binary from the 'rules_browsers' toolchain (via CHROME_BIN) + // for Playwright when available to ensure hermetic testing, preventing reliance + // on locally installed or NPM-managed browser versions. + provider = providerFactory({ + launchOptions: { + executablePath: process.env.CHROME_BIN, + }, + }); + } else { + provider = providerFactory(); + } + } else { + errors ??= []; + errors.push( + `The "${providerPackage}" package does not have a valid browser provider export.`, + ); + } + } catch (e) { + assertIsError(e); + errors ??= []; + // Check for a module not found error to provide a more specific message + if (e.code === 'ERR_MODULE_NOT_FOUND') { + errors.push( + `The "browsers" option with "${providerName}" requires the "${providerPackage}" package.` + + ' Please install this package and rerun the test command.', + ); + } else { + // Handle other potential errors during import + errors.push( + `An error occurred while loading the "${providerPackage}" browser provider:\n ${e.message}`, + ); + } + } + } + + if (errors) { + return { errors }; + } + + const isCI = !!process.env['CI']; + const instances = browsers.map(normalizeBrowserName); + if (providerName === 'preview') { + instances.forEach((instance) => { + instance.headless = false; + }); + } else if (isCI) { + instances.forEach((instance) => { + instance.headless = true; + }); + } + + const browser = { + enabled: true, + provider, + ui: !isCI && instances.some((instance) => !instance.headless), + viewport, + instances, + } satisfies BrowserConfigOptions; + + return { browser }; +} diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider_spec.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider_spec.ts new file mode 100644 index 000000000000..2162ffa6ed5e --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider_spec.ts @@ -0,0 +1,163 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { setupBrowserConfiguration } from './browser-provider'; + +describe('setupBrowserConfiguration', () => { + let workspaceRoot: string; + + beforeEach(async () => { + // Create a temporary workspace root + workspaceRoot = await mkdtemp(join(tmpdir(), 'angular-cli-test-')); + await writeFile(join(workspaceRoot, 'package.json'), '{}'); + + // Create a mock @vitest/browser-playwright package + const playwrightPkgPath = join(workspaceRoot, 'node_modules/@vitest/browser-playwright'); + await mkdir(playwrightPkgPath, { recursive: true }); + await writeFile( + join(playwrightPkgPath, 'package.json'), + JSON.stringify({ name: '@vitest/browser-playwright', main: 'index.js' }), + ); + await writeFile( + join(playwrightPkgPath, 'index.js'), + 'module.exports = { playwright: () => ({ name: "playwright" }) };', + ); + }); + + afterEach(async () => { + await rm(workspaceRoot, { recursive: true, force: true }); + }); + + it('should configure headless mode for specific browsers based on name', async () => { + const { browser } = await setupBrowserConfiguration( + ['ChromeHeadless', 'Firefox'], + false, + workspaceRoot, + undefined, + ); + + expect(browser?.enabled).toBeTrue(); + expect(browser?.instances).toEqual([ + { browser: 'chrome', headless: true }, + { browser: 'firefox', headless: false }, + ]); + }); + + it('should force headless mode in CI environment', async () => { + const originalCI = process.env['CI']; + process.env['CI'] = 'true'; + + try { + const { browser } = await setupBrowserConfiguration( + ['Chrome', 'FirefoxHeadless'], + false, + workspaceRoot, + undefined, + ); + + expect(browser?.instances).toEqual([ + { browser: 'chrome', headless: true }, + { browser: 'firefox', headless: true }, + ]); + } finally { + if (originalCI === undefined) { + delete process.env['CI']; + } else { + process.env['CI'] = originalCI; + } + } + }); + + it('should set ui property based on headless instances (local)', async () => { + // Local run (not CI) + const originalCI = process.env['CI']; + delete process.env['CI']; + + try { + // Case 1: All headless -> UI false + let result = await setupBrowserConfiguration( + ['ChromeHeadless'], + false, + workspaceRoot, + undefined, + ); + expect(result.browser?.ui).toBeFalse(); + + // Case 2: Mixed -> UI true + result = await setupBrowserConfiguration( + ['ChromeHeadless', 'Firefox'], + false, + workspaceRoot, + undefined, + ); + expect(result.browser?.ui).toBeTrue(); + } finally { + if (originalCI !== undefined) { + process.env['CI'] = originalCI; + } + } + }); + + it('should disable UI in CI even if headed browsers are requested', async () => { + const originalCI = process.env['CI']; + process.env['CI'] = 'true'; + + try { + const { browser } = await setupBrowserConfiguration( + ['Chrome'], + false, + workspaceRoot, + undefined, + ); + + expect(browser?.ui).toBeFalse(); + // And verify instances are forced to headless + expect(browser?.instances?.[0].headless).toBeTrue(); + } finally { + if (originalCI === undefined) { + delete process.env['CI']; + } else { + process.env['CI'] = originalCI; + } + } + }); + + it('should support Preview provider forcing headless false', async () => { + // Create mock preview package + const previewPkgPath = join(workspaceRoot, 'node_modules/@vitest/browser-preview'); + await mkdir(previewPkgPath, { recursive: true }); + await writeFile( + join(previewPkgPath, 'package.json'), + JSON.stringify({ name: '@vitest/browser-preview', main: 'index.js' }), + ); + await writeFile( + join(previewPkgPath, 'index.js'), + 'module.exports = { preview: () => ({ name: "preview" }) };', + ); + + // Remove playwright mock for this test to force usage of preview + await rm(join(workspaceRoot, 'node_modules/@vitest/browser-playwright'), { + recursive: true, + force: true, + }); + + const { browser } = await setupBrowserConfiguration( + ['ChromeHeadless'], + false, + workspaceRoot, + undefined, + ); + + expect(browser?.provider).toBeDefined(); + // Preview forces headless false + expect(browser?.instances?.[0].headless).toBeFalse(); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/build-options.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/build-options.ts new file mode 100644 index 000000000000..1c65d6fc4d50 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/build-options.ts @@ -0,0 +1,146 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import path from 'node:path'; +import { toPosixPath } from '../../../../utils/path'; +import type { ApplicationBuilderInternalOptions } from '../../../application/options'; +import { OutputHashing } from '../../../application/schema'; +import { NormalizedUnitTestBuilderOptions, injectTestingPolyfills } from '../../options'; +import { findTests, getTestEntrypoints } from '../../test-discovery'; +import { RunnerOptions } from '../api'; + +function createTestBedInitVirtualFile( + providersFile: string | undefined, + projectSourceRoot: string, + polyfills: string[] = [], +): string { + const usesZoneJS = polyfills.includes('zone.js'); + let providersImport = 'const providers = [];'; + if (providersFile) { + const relativePath = path.relative(projectSourceRoot, providersFile); + const { dir, name } = path.parse(relativePath); + const importPath = toPosixPath(path.join(dir, name)); + providersImport = `import providers from './${importPath}';`; + } + + return ` + // Initialize the Angular testing environment + import { NgModule${usesZoneJS ? ', provideZoneChangeDetection' : ''} } from '@angular/core'; + import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing'; + import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing'; + import { afterEach, beforeEach } from 'vitest'; + ${providersImport} + + // The beforeEach and afterEach hooks are registered outside the globalThis guard. + // This ensures that the hooks are always applied, even in non-isolated browser environments. + // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/srcs/test_hooks.ts#L21-L29 + beforeEach(getCleanupHook(false)); + afterEach(getCleanupHook(true)); + + const ANGULAR_TESTBED_SETUP = Symbol.for('@angular/cli/testbed-setup'); + if (!globalThis[ANGULAR_TESTBED_SETUP]) { + globalThis[ANGULAR_TESTBED_SETUP] = true; + + // The Angular TestBed needs to be initialized before any tests are run. + // In a non-isolated environment, this setup file can be executed multiple times. + // The guard condition above ensures that the setup is only performed once. + + @NgModule({ + providers: [${usesZoneJS ? 'provideZoneChangeDetection(), ' : ''}...providers], + }) + class TestModule {} + + getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), { + errorOnUnknownElements: true, + errorOnUnknownProperties: true, + }); + } + `; +} + +function adjustOutputHashing(hashing?: OutputHashing): OutputHashing { + switch (hashing) { + case OutputHashing.All: + case OutputHashing.Media: + // Ensure media is continued to be hashed to avoid overwriting of output media files + return OutputHashing.Media; + default: + return OutputHashing.None; + } +} + +export async function getVitestBuildOptions( + options: NormalizedUnitTestBuilderOptions, + baseBuildOptions: Partial, +): Promise { + const { workspaceRoot, projectSourceRoot, include, exclude = [], watch, providersFile } = options; + + // Find test files + const testFiles = await findTests(include, exclude, workspaceRoot, projectSourceRoot); + if (testFiles.length === 0) { + throw new Error( + 'No tests found matching the following patterns:\n' + + `- Included: ${include.join(', ')}\n` + + (exclude.length ? `- Excluded: ${exclude.join(', ')}\n` : '') + + `\nPlease check the 'test' target configuration in your project's 'angular.json' file.`, + ); + } + + const entryPoints = getTestEntrypoints(testFiles, { + projectSourceRoot, + workspaceRoot, + removeTestExtension: true, + }); + entryPoints.set('init-testbed', 'angular:test-bed-init'); + + // The 'vitest' package is always external for testing purposes + const externalDependencies = ['vitest']; + if (baseBuildOptions.externalDependencies) { + externalDependencies.push(...baseBuildOptions.externalDependencies); + } + + const buildOptions: Partial = { + ...baseBuildOptions, + watch, + incrementalResults: watch, + index: false, + browser: undefined, + server: undefined, + outputMode: undefined, + localize: false, + budgets: [], + serviceWorker: false, + appShell: false, + ssr: false, + prerender: false, + sourceMap: { scripts: true, vendor: false, styles: false }, + outputHashing: adjustOutputHashing(baseBuildOptions.outputHashing), + optimization: false, + entryPoints, + // Enable support for vitest browser prebundling. Excludes can be controlled with a runnerConfig + // and the `optimizeDeps.exclude` option. + externalPackages: true, + externalDependencies, + }; + + buildOptions.polyfills = injectTestingPolyfills(buildOptions.polyfills); + + const testBedInitContents = createTestBedInitVirtualFile( + providersFile, + projectSourceRoot, + buildOptions.polyfills, + ); + + return { + buildOptions, + virtualFiles: { + 'angular:test-bed-init': testBedInitContents, + }, + testEntryPointMappings: entryPoints, + }; +} diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/configuration.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/configuration.ts new file mode 100644 index 000000000000..6df583350e07 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/configuration.ts @@ -0,0 +1,55 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview + * This file contains utility functions for finding the Vitest base configuration file. + */ + +import { readdir } from 'node:fs/promises'; +import path from 'node:path'; + +/** + * A list of potential Vitest configuration filenames. + * The order of the files is important as the first one found will be used. + */ +const POTENTIAL_CONFIGS = [ + 'vitest-base.config.ts', + 'vitest-base.config.mts', + 'vitest-base.config.cts', + 'vitest-base.config.js', + 'vitest-base.config.mjs', + 'vitest-base.config.cjs', +]; + +/** + * Finds the Vitest configuration file in the given search directories. + * + * @param searchDirs An array of directories to search for the configuration file. + * @returns The path to the configuration file, or `false` if no file is found. + * Returning `false` is used to disable Vitest's default configuration file search. + */ +export async function findVitestBaseConfig(searchDirs: string[]): Promise { + const uniqueDirs = new Set(searchDirs); + for (const dir of uniqueDirs) { + try { + const entries = await readdir(dir, { withFileTypes: true }); + const files = new Set(entries.filter((e) => e.isFile()).map((e) => e.name)); + + for (const potential of POTENTIAL_CONFIGS) { + if (files.has(potential)) { + return path.join(dir, potential); + } + } + } catch { + // Ignore directories that cannot be read + } + } + + return false; +} diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/executor.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/executor.ts new file mode 100644 index 000000000000..00782d1704cf --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/executor.ts @@ -0,0 +1,253 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { BuilderOutput } from '@angular-devkit/architect'; +import assert from 'node:assert'; +import path, { join } from 'node:path'; +import type { Vitest } from 'vitest/node'; +import { + DevServerExternalResultMetadata, + updateExternalMetadata, +} from '../../../../tools/vite/utils'; +import { assertIsError } from '../../../../utils/error'; +import { + type FullResult, + type IncrementalResult, + type ResultFile, + ResultKind, +} from '../../../application/results'; +import { NormalizedUnitTestBuilderOptions } from '../../options'; +import type { TestExecutor } from '../api'; +import { setupBrowserConfiguration } from './browser-provider'; +import { findVitestBaseConfig } from './configuration'; +import { createVitestConfigPlugin, createVitestPlugins } from './plugins'; + +export class VitestExecutor implements TestExecutor { + private vitest: Vitest | undefined; + private normalizePath: ((id: string) => string) | undefined; + private readonly projectName: string; + private readonly options: NormalizedUnitTestBuilderOptions; + private readonly buildResultFiles = new Map(); + private readonly externalMetadata: DevServerExternalResultMetadata = { + implicitBrowser: [], + implicitServer: [], + explicitBrowser: [], + explicitServer: [], + }; + + // This is a reverse map of the entry points created in `build-options.ts`. + // It is used by the in-memory provider plugin to map the requested test file + // path back to its bundled output path. + // Example: `Map<'/path/to/src/app.spec.ts', 'spec-src-app-spec'>` + private readonly testFileToEntryPoint = new Map(); + private readonly entryPointToTestFile = new Map(); + + constructor( + projectName: string, + options: NormalizedUnitTestBuilderOptions, + testEntryPointMappings: Map | undefined, + ) { + this.projectName = projectName; + this.options = options; + + if (testEntryPointMappings) { + for (const [entryPoint, testFile] of testEntryPointMappings) { + this.testFileToEntryPoint.set(testFile, entryPoint); + this.entryPointToTestFile.set(entryPoint + '.js', testFile); + } + } + } + + async *execute(buildResult: FullResult | IncrementalResult): AsyncIterable { + this.normalizePath ??= (await import('vite')).normalizePath; + + if (buildResult.kind === ResultKind.Full) { + this.buildResultFiles.clear(); + for (const [path, file] of Object.entries(buildResult.files)) { + this.buildResultFiles.set(this.normalizePath(path), file); + } + } else { + for (const file of buildResult.removed) { + this.buildResultFiles.delete(this.normalizePath(file.path)); + } + for (const [path, file] of Object.entries(buildResult.files)) { + this.buildResultFiles.set(this.normalizePath(path), file); + } + } + + updateExternalMetadata(buildResult, this.externalMetadata, undefined, true); + + // Initialize Vitest if not already present. + this.vitest ??= await this.initializeVitest(); + const vitest = this.vitest; + + let testResults; + if (buildResult.kind === ResultKind.Incremental) { + // To rerun tests, Vitest needs the original test file paths, not the output paths. + const modifiedSourceFiles = new Set(); + for (const modifiedFile of [...buildResult.modified, ...buildResult.added]) { + // The `modified` files in the build result are the output paths. + // We need to find the original source file path to pass to Vitest. + const source = this.entryPointToTestFile.get(modifiedFile); + if (source) { + modifiedSourceFiles.add(source); + } + vitest.invalidateFile( + this.normalizePath(path.join(this.options.workspaceRoot, modifiedFile)), + ); + } + + const specsToRerun = []; + for (const file of modifiedSourceFiles) { + vitest.invalidateFile(file); + const specs = vitest.getModuleSpecifications(file); + if (specs) { + specsToRerun.push(...specs); + } + } + + if (specsToRerun.length > 0) { + testResults = await vitest.rerunTestSpecifications(specsToRerun); + } + } + + // Check if all the tests pass to calculate the result + const testModules = testResults?.testModules ?? this.vitest.state.getTestModules(); + + yield { success: testModules.every((testModule) => testModule.ok()) }; + } + + async [Symbol.asyncDispose](): Promise { + await this.vitest?.close(); + } + + private prepareSetupFiles(): string[] { + const { setupFiles } = this.options; + // Add setup file entries for TestBed initialization and project polyfills + const testSetupFiles = ['init-testbed.js', ...setupFiles]; + + // TODO: Provide additional result metadata to avoid needing to extract based on filename + if (this.buildResultFiles.has('polyfills.js')) { + testSetupFiles.unshift('polyfills.js'); + } + + return testSetupFiles; + } + + private async initializeVitest(): Promise { + const { + coverage, + reporters, + outputFile, + workspaceRoot, + browsers, + debug, + watch, + browserViewport, + ui, + projectRoot, + runnerConfig, + projectSourceRoot, + cacheOptions, + } = this.options; + const projectName = this.projectName; + + let vitestNodeModule; + try { + vitestNodeModule = await import('vitest/node'); + } catch (error: unknown) { + assertIsError(error); + if (error.code !== 'ERR_MODULE_NOT_FOUND') { + throw error; + } + throw new Error( + 'The `vitest` package was not found. Please install the package and rerun the test command.', + ); + } + const { startVitest } = vitestNodeModule; + + // Setup vitest browser options if configured + const browserOptions = await setupBrowserConfiguration( + browsers, + debug, + projectSourceRoot, + browserViewport, + ); + if (browserOptions.errors?.length) { + throw new Error(browserOptions.errors.join('\n')); + } + + assert( + this.buildResultFiles.size > 0, + 'buildResult must be available before initializing vitest', + ); + + const testSetupFiles = this.prepareSetupFiles(); + const projectPlugins = createVitestPlugins({ + workspaceRoot, + projectSourceRoot, + projectName, + buildResultFiles: this.buildResultFiles, + testFileToEntryPoint: this.testFileToEntryPoint, + }); + + const debugOptions = debug + ? { + inspectBrk: true, + isolate: false, + fileParallelism: false, + } + : {}; + + const externalConfigPath = + runnerConfig === true + ? await findVitestBaseConfig([projectRoot, workspaceRoot]) + : runnerConfig; + + return startVitest( + 'test', + undefined, + { + config: externalConfigPath, + root: workspaceRoot, + project: projectName, + outputFile, + cache: cacheOptions.enabled ? undefined : false, + testNamePattern: this.options.filter, + watch, + ...(typeof ui === 'boolean' ? { ui } : {}), + ...debugOptions, + }, + { + // Note `.vitest` is auto appended to the path. + cacheDir: cacheOptions.path, + server: { + // Disable the actual file watcher. The boolean watch option above should still + // be enabled as it controls other internal behavior related to rerunning tests. + watch: null, + }, + plugins: [ + await createVitestConfigPlugin({ + browser: browserOptions.browser, + coverage, + projectName, + projectSourceRoot, + optimizeDepsInclude: this.externalMetadata.implicitBrowser, + reporters, + setupFiles: testSetupFiles, + projectPlugins, + include: [...this.testFileToEntryPoint.keys()].filter( + // Filter internal entries + (entry) => !entry.startsWith('angular:'), + ), + }), + ], + }, + ); + } +} diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts new file mode 100644 index 000000000000..fed814bdd78e --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import assert from 'node:assert'; +import type { TestRunner } from '../api'; +import { DependencyChecker } from '../dependency-checker'; +import { getVitestBuildOptions } from './build-options'; +import { VitestExecutor } from './executor'; + +/** + * A declarative definition of the Vitest test runner. + */ +const VitestTestRunner: TestRunner = { + name: 'vitest', + + validateDependencies(options) { + const checker = new DependencyChecker(options.projectSourceRoot); + checker.check('vitest'); + + if (options.browsers?.length) { + if (process.versions.webcontainer) { + checker.check('@vitest/browser-preview'); + } else { + checker.checkAny( + ['@vitest/browser-playwright', '@vitest/browser-webdriverio', '@vitest/browser-preview'], + 'The "browsers" option requires either ' + + '"@vitest/browser-playwright", "@vitest/browser-webdriverio", or "@vitest/browser-preview" to be installed.', + ); + } + } else { + // DOM emulation is used when no browsers are specified + checker.checkAny( + ['jsdom', 'happy-dom'], + 'A DOM environment is required for non-browser tests. Please install either "jsdom" or "happy-dom".', + ); + } + + if (options.coverage.enabled) { + checker.check('@vitest/coverage-v8'); + } + + checker.report(); + }, + + getBuildOptions(options, baseBuildOptions) { + return getVitestBuildOptions(options, baseBuildOptions); + }, + + async createExecutor(context, options, testEntryPointMappings) { + const projectName = context.target?.project; + assert(projectName, 'The builder requires a target.'); + + if (!!process.versions.webcontainer && options.browsers?.length) { + context.logger.info( + `Webcontainer environment detected. Using '@vitest/browser-preview' for browser-based tests.`, + ); + } + + if (typeof options.runnerConfig === 'string') { + context.logger.info(`Using Vitest configuration file: ${options.runnerConfig}`); + } else if (options.runnerConfig) { + context.logger.info('Automatically searching for and using Vitest configuration file.'); + } + + return new VitestExecutor(projectName, options, testEntryPointMappings); + }, +}; + +export default VitestTestRunner; diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts new file mode 100644 index 000000000000..b92c6e7f872d --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts @@ -0,0 +1,350 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import assert from 'node:assert'; +import { readFile } from 'node:fs/promises'; +import { createRequire } from 'node:module'; +import { platform } from 'node:os'; +import path from 'node:path'; +import type { + BrowserConfigOptions, + InlineConfig, + UserWorkspaceConfig, + VitestPlugin, +} from 'vitest/node'; +import { createBuildAssetsMiddleware } from '../../../../tools/vite/middlewares/assets-middleware'; +import { toPosixPath } from '../../../../utils/path'; +import type { ResultFile } from '../../../application/results'; +import type { NormalizedUnitTestBuilderOptions } from '../../options'; + +type VitestPlugins = Awaited>; + +interface PluginOptions { + workspaceRoot: string; + projectSourceRoot: string; + projectName: string; + buildResultFiles: ReadonlyMap; + testFileToEntryPoint: ReadonlyMap; +} + +type VitestCoverageOption = Exclude; + +interface VitestConfigPluginOptions { + browser: BrowserConfigOptions | undefined; + coverage: NormalizedUnitTestBuilderOptions['coverage']; + projectName: string; + projectSourceRoot: string; + reporters?: string[] | [string, object][]; + setupFiles: string[]; + projectPlugins: Exclude; + include: string[]; + optimizeDepsInclude: string[]; +} + +async function findTestEnvironment( + projectResolver: NodeJS.RequireResolve, +): Promise<'jsdom' | 'happy-dom'> { + try { + projectResolver('happy-dom'); + + return 'happy-dom'; + } catch { + // happy-dom is not installed, fallback to jsdom + return 'jsdom'; + } +} + +export async function createVitestConfigPlugin( + options: VitestConfigPluginOptions, +): Promise { + const { + include, + browser, + projectName, + reporters, + setupFiles, + projectPlugins, + projectSourceRoot, + } = options; + + const { mergeConfig } = await import('vitest/config'); + + return { + name: 'angular:vitest-configuration', + async config(config) { + const testConfig = config.test; + + if (testConfig?.projects?.length) { + this.warn( + 'The "test.projects" option in the Vitest configuration file is not supported. ' + + 'The Angular CLI Test system will construct its own project configuration.', + ); + delete testConfig.projects; + } + + if (testConfig?.include) { + this.warn( + 'The "test.include" option in the Vitest configuration file is not supported. ' + + 'The Angular CLI Test system will manage test file discovery.', + ); + delete testConfig.include; + } + + // Merge user-defined plugins from the Vitest config with the CLI's internal plugins. + if (config.plugins) { + const userPlugins = config.plugins.filter( + (plugin) => + // Only inspect objects with a `name` property as these would be the internal injected plugins + !plugin || + typeof plugin !== 'object' || + !('name' in plugin) || + (!plugin.name.startsWith('angular:') && !plugin.name.startsWith('vitest')), + ); + + if (userPlugins.length > 0) { + projectPlugins.push(...userPlugins); + } + delete config.plugins; + } + + const projectResolver = createRequire(projectSourceRoot + '/').resolve; + + const projectDefaults: UserWorkspaceConfig = { + test: { + setupFiles, + globals: true, + // Default to `false` to align with the Karma/Jasmine experience. + isolate: false, + sequence: { setupFiles: 'list' }, + }, + optimizeDeps: { + noDiscovery: true, + include: options.optimizeDepsInclude, + }, + resolve: { + mainFields: ['es2020', 'module', 'main'], + conditions: ['es2015', 'es2020', 'module', ...(browser ? ['browser'] : [])], + }, + }; + + const { optimizeDeps, resolve } = config; + const projectOverrides: UserWorkspaceConfig = { + test: { + name: projectName, + include, + // CLI provider browser options override, if present + ...(browser ? { browser } : {}), + // If the user has not specified an environment, use a smart default. + ...(!testConfig?.environment + ? { environment: await findTestEnvironment(projectResolver) } + : {}), + }, + plugins: projectPlugins, + optimizeDeps, + resolve, + }; + + const projectBase = mergeConfig(projectDefaults, testConfig ? { test: testConfig } : {}); + const projectConfig = mergeConfig(projectBase, projectOverrides); + + return { + test: { + coverage: await generateCoverageOption( + options.coverage, + testConfig?.coverage, + projectName, + ), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...(reporters ? ({ reporters } as any) : {}), + projects: [projectConfig], + }, + }; + }, + }; +} + +async function loadResultFile(file: ResultFile): Promise { + if (file.origin === 'memory') { + return new TextDecoder('utf-8').decode(file.contents); + } + + return readFile(file.inputPath, 'utf-8'); +} + +export function createVitestPlugins(pluginOptions: PluginOptions): VitestPlugins { + const { workspaceRoot, buildResultFiles, testFileToEntryPoint } = pluginOptions; + const isWindows = platform() === 'win32'; + + return [ + { + name: 'angular:test-in-memory-provider', + enforce: 'pre', + resolveId: (id, importer) => { + // Fast path for test entry points. + if (testFileToEntryPoint.has(id)) { + return id; + } + + // Workaround for Vitest in Windows when a fully qualified absolute path is provided with + // a superfluous leading slash. This can currently occur with the `@vitest/coverage-v8` provider + // when it uses `removeStartsWith(url, FILE_PROTOCOL)` to convert a file URL resulting in + // `/D:/tmp_dir/...` instead of `D:/tmp_dir/...`. + if (id[0] === '/' && isWindows) { + const slicedId = id.slice(1); + if (path.isAbsolute(slicedId)) { + return slicedId; + } + } + + if (importer && (id[0] === '.' || id[0] === '/')) { + let fullPath; + if (testFileToEntryPoint.has(importer)) { + fullPath = toPosixPath(path.join(workspaceRoot, id)); + } else { + fullPath = toPosixPath(path.join(path.dirname(importer), id)); + } + + const relativePath = path.relative(workspaceRoot, fullPath); + if (buildResultFiles.has(toPosixPath(relativePath))) { + return fullPath; + } + } + + // Determine the base directory for resolution. + let baseDir: string; + if (importer) { + // If the importer is a test entry point, resolve relative to the workspace root. + // Otherwise, resolve relative to the importer's directory. + baseDir = testFileToEntryPoint.has(importer) ? workspaceRoot : path.dirname(importer); + } else { + // If there's no importer, assume the id is relative to the workspace root. + baseDir = workspaceRoot; + } + + // Construct the full, absolute path and normalize it to POSIX format. + const fullPath = toPosixPath(path.join(baseDir, id)); + + // Check if the resolved path corresponds to a known build artifact. + const relativePath = path.relative(workspaceRoot, fullPath); + if (buildResultFiles.has(toPosixPath(relativePath))) { + return fullPath; + } + + // If the module cannot be resolved from the build artifacts, let other plugins handle it. + return undefined; + }, + load: async (id) => { + assert(buildResultFiles.size > 0, 'buildResult must be available for in-memory loading.'); + + // Attempt to load as a source test file. + const entryPoint = testFileToEntryPoint.get(id); + let outputPath; + if (entryPoint) { + outputPath = entryPoint + '.js'; + + // To support coverage exclusion of the actual test file, the virtual + // test entry point only references the built and bundled intermediate file. + return { + code: `import "./${outputPath}";`, + }; + } else { + // Attempt to load as a built artifact. + const relativePath = path.relative(workspaceRoot, id); + outputPath = toPosixPath(relativePath); + } + + const outputFile = buildResultFiles.get(outputPath); + if (outputFile) { + const code = await loadResultFile(outputFile); + const sourceMapPath = outputPath + '.map'; + const sourceMapFile = buildResultFiles.get(sourceMapPath); + const sourceMapText = sourceMapFile ? await loadResultFile(sourceMapFile) : undefined; + + // Vitest will include files in the coverage report if the sourcemap contains no sources. + // For builder-internal generated code chunks, which are typically helper functions, + // a virtual source is added to the sourcemap to prevent them from being incorrectly + // included in the final coverage report. + const map = sourceMapText ? JSON.parse(sourceMapText) : undefined; + if (map) { + if (!map.sources?.length && !map.sourcesContent?.length && !map.mappings) { + map.sources = ['virtual:builder']; + } + } + + return { + code, + map, + }; + } + }, + configureServer: (server) => { + server.middlewares.use(createBuildAssetsMiddleware(server.config.base, buildResultFiles)); + }, + }, + { + name: 'angular:html-index', + transformIndexHtml: () => { + // Add all global stylesheets + if (buildResultFiles.has('styles.css')) { + return [ + { + tag: 'link', + attrs: { href: 'styles.css', rel: 'stylesheet' }, + injectTo: 'head', + }, + ]; + } + + return []; + }, + }, + ]; +} + +async function generateCoverageOption( + optionsCoverage: NormalizedUnitTestBuilderOptions['coverage'], + configCoverage: VitestCoverageOption | undefined, + projectName: string, +): Promise { + let defaultExcludes: string[] = []; + if (optionsCoverage.exclude) { + try { + const vitestConfig = await import('vitest/config'); + defaultExcludes = vitestConfig.coverageConfigDefaults.exclude; + } catch {} + } + + return { + excludeAfterRemap: true, + reportsDirectory: + configCoverage?.reportsDirectory ?? toPosixPath(path.join('coverage', projectName)), + ...(optionsCoverage.enabled !== undefined ? { enabled: optionsCoverage.enabled } : {}), + // Vitest performs a pre-check and a post-check for sourcemaps. + // The pre-check uses the bundled files, so specific bundled entry points and chunks need to be included. + // The post-check uses the original source files, so the user's include is used. + ...(optionsCoverage.include + ? { include: ['spec-*.js', 'chunk-*.js', ...optionsCoverage.include] } + : {}), + thresholds: optionsCoverage.thresholds, + watermarks: optionsCoverage.watermarks, + // Special handling for `exclude`/`reporters` due to an undefined value causing upstream failures + ...(optionsCoverage.exclude + ? { + exclude: [ + // Augment the default exclude https://vitest.dev/config/#coverage-exclude + // with the user defined exclusions + ...optionsCoverage.exclude, + ...defaultExcludes, + ], + } + : {}), + ...(optionsCoverage.reporters + ? ({ reporter: optionsCoverage.reporters } satisfies VitestCoverageOption) + : {}), + }; +} diff --git a/packages/angular/build/src/builders/unit-test/schema.json b/packages/angular/build/src/builders/unit-test/schema.json index 223aa149bcdf..2a3cf27719e8 100644 --- a/packages/angular/build/src/builders/unit-test/schema.json +++ b/packages/angular/build/src/builders/unit-test/schema.json @@ -6,67 +6,271 @@ "properties": { "buildTarget": { "type": "string", - "description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.", + "description": "Specifies the build target to use for the unit test build in the format `project:target[:configuration]`. This defaults to the `build` target of the current project with the `development` configuration. You can also pass a comma-separated list of configurations. Example: `project:target:production,staging`.", "pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$" }, "tsConfig": { "type": "string", - "description": "The name of the TypeScript configuration file." + "description": "The path to the TypeScript configuration file, relative to the workspace root. Defaults to `tsconfig.spec.json` in the project root if it exists. If not specified and the default does not exist, the `tsConfig` from the specified `buildTarget` will be used." }, "runner": { "type": "string", - "description": "The name of the test runner to use for test execution.", + "description": "Specifies the test runner to use for test execution.", + "default": "vitest", "enum": ["karma", "vitest"] }, + "runnerConfig": { + "type": ["string", "boolean"], + "description": "Specifies the configuration file for the selected test runner. If a string is provided, it will be used as the path to the configuration file. If `true`, the builder will search for a default configuration file (e.g., `vitest.config.ts` or `karma.conf.js`). If `false`, no external configuration file will be used.\\nFor Vitest, this enables advanced options and the use of custom plugins. Please note that while the file is loaded, the Angular team does not provide direct support for its specific contents or any third-party plugins used within it.", + "default": false + }, "browsers": { - "description": "A list of browsers to use for test execution. If undefined, jsdom on Node.js will be used instead of a browser.", + "description": "Specifies the browsers to use for test execution. When not specified, tests are run in a Node.js environment using jsdom. For both Vitest and Karma, browser names ending with 'Headless' (e.g., 'ChromeHeadless') will enable headless mode.", "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "browserViewport": { + "description": "Specifies the browser viewport dimensions for browser-based tests in the format `widthxheight`.", + "type": "string", + "pattern": "^\\d+x\\d+$" + }, "include": { "type": "array", "items": { "type": "string" }, - "default": ["**/*.spec.ts"], - "description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead." + "default": ["**/*.spec.ts", "**/*.test.ts"], + "description": "Specifies glob patterns of files to include for testing, relative to the project root. This option also has special handling for directory paths (includes all test files within) and file paths (includes the corresponding test file if one exists)." }, "exclude": { "type": "array", "items": { "type": "string" }, - "default": [], - "description": "Globs of files to exclude, relative to the project root." + "description": "Specifies glob patterns of files to exclude from testing, relative to the project root." + }, + "filter": { + "type": "string", + "description": "Specifies a regular expression pattern to match against test suite and test names. Only tests with a name matching the pattern will be executed. For example, `^App` will run only tests in suites beginning with 'App'." }, "watch": { "type": "boolean", - "description": "Run build when files change." + "description": "Enables watch mode, which re-runs tests when source files change. Defaults to `true` in TTY environments and `false` otherwise." + }, + "debug": { + "type": "boolean", + "description": "Enables debugging mode for tests, allowing the use of the Node Inspector.", + "default": false + }, + "ui": { + "type": "boolean", + "description": "Enables the Vitest UI for interactive test execution. This option is only available for the Vitest runner." }, - "codeCoverage": { + "coverage": { "type": "boolean", - "description": "Output a code coverage report.", + "description": "Enables coverage reporting for tests.", "default": false }, - "codeCoverageExclude": { + "coverageInclude": { "type": "array", - "description": "Globs to exclude from code coverage.", + "description": "Specifies glob patterns of files to include in the coverage report.", "items": { "type": "string" + } + }, + "coverageExclude": { + "type": "array", + "description": "Specifies glob patterns of files to exclude from the coverage report.", + "items": { + "type": "string" + } + }, + "coverageReporters": { + "type": "array", + "description": "Specifies the reporters to use for coverage results. Each reporter can be a string representing its name, or a tuple containing the name and an options object. Built-in reporters include 'html', 'lcov', 'lcovonly', 'text', 'text-summary', 'cobertura', 'json', and 'json-summary'.", + "items": { + "oneOf": [ + { + "enum": [ + "html", + "lcov", + "lcovonly", + "text", + "text-summary", + "cobertura", + "json", + "json-summary" + ] + }, + { + "type": "array", + "minItems": 1, + "maxItems": 2, + "items": [ + { + "enum": [ + "html", + "lcov", + "lcovonly", + "text", + "text-summary", + "cobertura", + "json", + "json-summary" + ] + }, + { + "type": "object" + } + ] + } + ] + } + }, + "coverageThresholds": { + "type": "object", + "description": "Specifies minimum coverage thresholds that must be met. If thresholds are not met, the builder will exit with an error.", + "properties": { + "perFile": { + "type": "boolean", + "description": "When true, thresholds are enforced for each file individually." + }, + "statements": { + "type": "number", + "description": "Minimum percentage of statements covered." + }, + "branches": { + "type": "number", + "description": "Minimum percentage of branches covered." + }, + "functions": { + "type": "number", + "description": "Minimum percentage of functions covered." + }, + "lines": { + "type": "number", + "description": "Minimum percentage of lines covered." + } + }, + "additionalProperties": false + }, + "coverageWatermarks": { + "type": "object", + "description": "Specifies coverage watermarks for the HTML reporter. These determine the color coding for high, medium, and low coverage.", + "properties": { + "statements": { + "type": "array", + "description": "The high and low watermarks for statements coverage. `[low, high]`", + "items": { "type": "number" }, + "minItems": 2, + "maxItems": 2 + }, + "branches": { + "type": "array", + "description": "The high and low watermarks for branches coverage. `[low, high]`", + "items": { "type": "number" }, + "minItems": 2, + "maxItems": 2 + }, + "functions": { + "type": "array", + "description": "The high and low watermarks for functions coverage. `[low, high]`", + "items": { "type": "number" }, + "minItems": 2, + "maxItems": 2 + }, + "lines": { + "type": "array", + "description": "The high and low watermarks for lines coverage. `[low, high]`", + "items": { "type": "number" }, + "minItems": 2, + "maxItems": 2 + } }, - "default": [] + "additionalProperties": false }, "reporters": { "type": "array", - "description": "Test runner reporters to use. Directly passed to the test runner.", + "description": "Specifies the reporters to use during test execution. Each reporter can be a string representing its name, or a tuple containing the name and an options object. Built-in reporters include 'default', 'verbose', 'dots', 'json', 'junit', 'tap', 'tap-flat', and 'html'. You can also provide a path to a custom reporter.", "items": { - "type": "string" + "oneOf": [ + { + "anyOf": [ + { + "type": "string" + }, + { + "enum": ["default", "verbose", "dots", "json", "junit", "tap", "tap-flat", "html"] + } + ] + }, + { + "type": "array", + "minItems": 1, + "maxItems": 2, + "items": [ + { + "anyOf": [ + { + "type": "string" + }, + { + "enum": [ + "default", + "verbose", + "dots", + "json", + "junit", + "tap", + "tap-flat", + "html" + ] + } + ] + }, + { + "type": "object" + } + ] + } + ] } + }, + "outputFile": { + "type": "string", + "description": "Specifies a file path for the test report, applying only to the first reporter. To configure output files for multiple reporters, use the tuple format `['reporter-name', { outputFile: '...' }]` within the `reporters` option. When not provided, output is written to the console." + }, + "providersFile": { + "type": "string", + "description": "Specifies the path to a TypeScript file that provides an array of Angular providers for the test environment. The file must contain a default export of the provider array.", + "minLength": 1 + }, + "setupFiles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of paths to global setup files that are executed before the test files. The application's polyfills and the Angular TestBed are always initialized before these files." + }, + "progress": { + "type": "boolean", + "description": "Shows build progress information in the console. Defaults to the `progress` setting of the specified `buildTarget`." + }, + "listTests": { + "type": "boolean", + "description": "Lists all discovered test files and exits the process without building or executing the tests.", + "default": false + }, + "dumpVirtualFiles": { + "type": "boolean", + "description": "Dumps build output files to the `.angular/cache` directory for debugging purposes.", + "default": false, + "visible": false } }, "additionalProperties": false, - "required": ["buildTarget", "tsConfig", "runner"] + "required": [] } diff --git a/packages/angular/build/src/builders/unit-test/test-discovery.ts b/packages/angular/build/src/builders/unit-test/test-discovery.ts new file mode 100644 index 000000000000..d4f097b388f7 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/test-discovery.ts @@ -0,0 +1,321 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { createHash } from 'node:crypto'; +import { type PathLike, constants, promises as fs } from 'node:fs'; +import os from 'node:os'; +import { basename, dirname, extname, isAbsolute, join, relative } from 'node:path'; +import { glob, isDynamicPattern } from 'tinyglobby'; +import { toPosixPath } from '../../utils/path'; + +/** + * An array of file infix notations that identify a file as a test file. + * For example, `.spec` in `app.component.spec.ts`. + */ +const TEST_FILE_INFIXES = ['.spec', '.test']; + +/** Maximum length for a generated test entrypoint name. */ +const MAX_FILENAME_LENGTH = 128; + +/** + * Finds all test files in the project. This function implements a special handling + * for static paths (non-globs) to improve developer experience. For example, if a + * user provides a path to a component, this function will find the corresponding + * test file. If a user provides a path to a directory, it will find all test + * files within that directory. + * + * @param include Glob patterns of files to include. + * @param exclude Glob patterns of files to exclude. + * @param workspaceRoot The absolute path to the workspace root. + * @param projectSourceRoot The absolute path to the project's source root. + * @returns A unique set of absolute paths to all test files. + */ +export async function findTests( + include: string[], + exclude: string[], + workspaceRoot: string, + projectSourceRoot: string, +): Promise { + const resolvedTestFiles = new Set(); + const dynamicPatterns: string[] = []; + + const projectRootPrefix = toPosixPath(relative(workspaceRoot, projectSourceRoot) + '/'); + const normalizedExcludes = exclude.map((p) => normalizePattern(p, projectRootPrefix)); + + // 1. Separate static and dynamic patterns + for (const pattern of include) { + const normalized = normalizePattern(pattern, projectRootPrefix); + if (isDynamicPattern(pattern)) { + dynamicPatterns.push(normalized); + } else { + const { resolved, unresolved } = await resolveStaticPattern(normalized, projectSourceRoot); + resolved.forEach((file) => resolvedTestFiles.add(file)); + unresolved.forEach((p) => dynamicPatterns.push(p)); + } + } + + // 2. Execute a single glob for all dynamic patterns + if (dynamicPatterns.length > 0) { + const globMatches = await glob(dynamicPatterns, { + cwd: projectSourceRoot, + absolute: true, + expandDirectories: false, + ignore: ['**/node_modules/**', ...normalizedExcludes], + }); + + for (const match of globMatches) { + resolvedTestFiles.add(toPosixPath(match)); + } + } + + // 3. Combine and de-duplicate results + return [...resolvedTestFiles]; +} + +interface TestEntrypointsOptions { + projectSourceRoot: string; + workspaceRoot: string; + removeTestExtension?: boolean; +} + +/** + * Generates unique, dash-delimited bundle names for a set of test files. + * This is used to create distinct output files for each test. + * + * @param testFiles An array of absolute paths to test files. + * @param options Configuration options for generating entry points. + * @returns A map where keys are the generated unique bundle names and values are the original file paths. + */ +export function getTestEntrypoints( + testFiles: string[], + { projectSourceRoot, workspaceRoot, removeTestExtension }: TestEntrypointsOptions, +): Map { + const seen = new Set(); + const roots = [projectSourceRoot, workspaceRoot]; + + return new Map( + Array.from(testFiles, (testFile) => { + const fileName = generateNameFromPath(testFile, roots, !!removeTestExtension); + const baseName = `spec-${fileName}`; + let uniqueName = baseName; + let suffix = 2; + while (seen.has(uniqueName)) { + uniqueName = `${baseName}-${suffix}`.replace(/([^\w](?:spec|test))-([\d]+)$/, '-$2$1'); + ++suffix; + } + seen.add(uniqueName); + + return [uniqueName, testFile]; + }), + ); +} + +/** + * Generates a unique, dash-delimited name from a file path. This is used to + * create a consistent and readable bundle name for a given test file. + * + * @param testFile The absolute path to the test file. + * @param roots An array of root paths to remove from the beginning of the test file path. + * @param removeTestExtension Whether to remove the test file infix and extension from the result. + * @returns A dash-cased name derived from the relative path of the test file. + */ +export function generateNameFromPath( + testFile: string, + roots: string[], + removeTestExtension: boolean, +): string { + const relativePath = removeRoots(testFile, roots); + + let startIndex = 0; + // Skip leading dots and slashes + while (startIndex < relativePath.length && /^[./\\]$/.test(relativePath[startIndex])) { + startIndex++; + } + + let endIndex = relativePath.length; + if (removeTestExtension) { + const infixes = TEST_FILE_INFIXES.map((p) => p.substring(1)).join('|'); + const match = relativePath.match(new RegExp(`\\.(${infixes})\\.[^.]+$`)); + + if (match?.index) { + endIndex = match.index; + } + } else { + const extIndex = relativePath.lastIndexOf('.'); + if (extIndex > startIndex) { + endIndex = extIndex; + } + } + + // Build the final string in a single pass + let result = ''; + for (let i = startIndex; i < endIndex; i++) { + const char = relativePath[i]; + result += char === '/' || char === '\\' ? '-' : char; + } + + return truncateName(result, relativePath); +} + +/** + * Truncates a generated name if it exceeds the maximum allowed filename length. + * If truncation occurs, the name will be shortened by replacing a middle segment + * with an 8-character SHA256 hash of the original full path to maintain uniqueness. + * + * @param name The generated name to potentially truncate. + * @param originalPath The original full path from which the name was derived. Used for hashing. + * @returns The original name if within limits, or a truncated name with a hash. + */ +function truncateName(name: string, originalPath: string): string { + if (name.length <= MAX_FILENAME_LENGTH) { + return name; + } + + const hash = createHash('sha256').update(originalPath).digest('hex').substring(0, 8); + const availableLength = MAX_FILENAME_LENGTH - hash.length - 2; // 2 for '-' separators + const prefixLength = Math.floor(availableLength / 2); + const suffixLength = availableLength - prefixLength; + + return `${name.substring(0, prefixLength)}-${hash}-${name.substring(name.length - suffixLength)}`; +} + +/** + * Whether the current operating system's filesystem is case-insensitive. + */ +const isCaseInsensitiveFilesystem = os.platform() === 'win32' || os.platform() === 'darwin'; + +/** + * Removes a prefix from the beginning of a string, with conditional case-insensitivity + * based on the operating system's filesystem characteristics. + * + * @param text The string to remove the prefix from. + * @param prefix The prefix to remove. + * @returns The string with the prefix removed, or the original string if the prefix was not found. + */ +function removePrefix(text: string, prefix: string): string { + if (isCaseInsensitiveFilesystem) { + if (text.toLowerCase().startsWith(prefix.toLowerCase())) { + return text.substring(prefix.length); + } + } else { + if (text.startsWith(prefix)) { + return text.substring(prefix.length); + } + } + + return text; +} + +/** + * Removes potential root paths from a file path, returning a relative path. + * If no root path matches, it returns the file's basename. + * + * @param path The file path to process. + * @param roots An array of root paths to attempt to remove. + * @returns A relative path. + */ +function removeRoots(path: string, roots: string[]): string { + for (const root of roots) { + const result = removePrefix(path, root); + // If the prefix was removed, the result will be a different string. + if (result !== path) { + return result; + } + } + + return basename(path); +} + +/** + * Normalizes a glob pattern by converting it to a POSIX path, removing leading + * slashes, and making it relative to the project source root. + * + * @param pattern The glob pattern to normalize. + * @param projectRootPrefix The POSIX-formatted prefix of the project's source root relative to the workspace root. + * @returns A normalized glob pattern. + */ +function normalizePattern(pattern: string, projectRootPrefix: string): string { + const posixPattern = toPosixPath(pattern); + + // Do not modify absolute paths. The globber will handle them correctly. + if (isAbsolute(posixPattern)) { + return posixPattern; + } + + // For relative paths, ensure they are correctly relative to the project source root. + // This involves removing the project root prefix if the user provided a workspace-relative path. + const normalizedRelative = removePrefix(posixPattern, projectRootPrefix); + + return normalizedRelative; +} + +/** + * Resolves a static (non-glob) path. + * + * If the path is a directory, it returns a glob pattern to find all test files + * within that directory. + * + * If the path is a file, it attempts to find a corresponding test file by + * checking for files with the same name and a test infix (e.g., `.spec.ts`). + * + * If no corresponding test file is found, the original path is returned as an + * unresolved pattern. + * + * @param pattern The static path pattern. + * @param projectSourceRoot The absolute path to the project's source root. + * @returns A promise that resolves to an object containing resolved spec files and unresolved patterns. + */ +async function resolveStaticPattern( + pattern: string, + projectSourceRoot: string, +): Promise<{ resolved: string[]; unresolved: string[] }> { + const fullPath = isAbsolute(pattern) ? pattern : join(projectSourceRoot, pattern); + if (await isDirectory(fullPath)) { + const infixes = TEST_FILE_INFIXES.map((p) => p.substring(1)).join('|'); + + return { resolved: [], unresolved: [`${pattern}/**/*.@(${infixes}).@(ts|tsx)`] }; + } + + const fileExt = extname(fullPath); + const baseName = basename(fullPath, fileExt); + + for (const infix of TEST_FILE_INFIXES) { + const potentialSpec = join(dirname(fullPath), `${baseName}${infix}${fileExt}`); + if (await exists(potentialSpec)) { + return { resolved: [toPosixPath(potentialSpec)], unresolved: [] }; + } + } + + if (await exists(fullPath)) { + return { resolved: [toPosixPath(fullPath)], unresolved: [] }; + } + + return { resolved: [], unresolved: [toPosixPath(pattern)] }; +} + +/** Checks if a path exists and is a directory. */ +async function isDirectory(path: PathLike): Promise { + try { + const stats = await fs.stat(path); + + return stats.isDirectory(); + } catch { + return false; + } +} + +/** Checks if a path exists on the file system. */ +async function exists(path: PathLike): Promise { + try { + await fs.access(path, constants.F_OK); + + return true; + } catch { + return false; + } +} diff --git a/packages/angular/build/src/builders/unit-test/test-discovery_spec.ts b/packages/angular/build/src/builders/unit-test/test-discovery_spec.ts new file mode 100644 index 000000000000..617839868d50 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/test-discovery_spec.ts @@ -0,0 +1,91 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { generateNameFromPath } from './test-discovery'; + +describe('generateNameFromPath', () => { + const roots = ['/project/src/', '/project/']; + + it('should generate a dash-cased name from a simple path', () => { + const testFile = '/project/src/app/components/my-component.spec.ts'; + const result = generateNameFromPath(testFile, roots, true); + expect(result).toBe('app-components-my-component'); + }); + + it('should handle Windows-style paths', () => { + const testFile = 'C:\\project\\src\\app\\components\\my-component.spec.ts'; + const result = generateNameFromPath(testFile, ['C:\\project\\src\\'], true); + expect(result).toBe('app-components-my-component'); + }); + + it('should remove test extensions when removeTestExtension is true', () => { + const testFile = '/project/src/app/utils/helpers.test.ts'; + const result = generateNameFromPath(testFile, roots, true); + expect(result).toBe('app-utils-helpers'); + }); + + it('should not remove test extensions when removeTestExtension is false', () => { + const testFile = '/project/src/app/utils/helpers.test.ts'; + const result = generateNameFromPath(testFile, roots, false); + expect(result).toBe('app-utils-helpers.test'); + }); + + it('should handle paths with leading dots and slashes', () => { + const testFile = '/project/src/./app/services/api.service.spec.ts'; + const result = generateNameFromPath(testFile, roots, true); + expect(result).toBe('app-services-api.service'); + }); + + it('should return the basename if no root matches', () => { + const testFile = '/unrelated/path/to/some/file.spec.ts'; + const result = generateNameFromPath(testFile, roots, true); + expect(result).toBe('file'); + }); + + it('should truncate a long file name', () => { + const longPath = + 'a/very/long/path/that/definitely/exceeds/the/maximum/allowed/length/for/a/filename/in/order/to/trigger/the/truncation/logic/in/the/function.spec.ts'; // eslint-disable-line max-len + const testFile = `/project/src/${longPath}`; + const result = generateNameFromPath(testFile, roots, true); + + expect(result.length).toBeLessThanOrEqual(128); + expect(result).toBe( + 'a-very-long-path-that-definitely-exceeds-the-maximum-allowe-9cf40291-me-in-order-to-trigger-the-truncation-logic-in-the-function', + ); // eslint-disable-line max-len + }); + + it('should generate different hashes for different paths with similar truncated names', () => { + const longPath1 = + 'a/very/long/path/that/definitely/exceeds/the/maximum/allowed/length/for/a/filename/in/order/to/trigger/the/truncation/logic/variant-a.spec.ts'; // eslint-disable-line max-len + const longPath2 = + 'a/very/long/path/that/definitely/exceeds/the/maximum/allowed/length/for/a/filename/in/order/to/trigger/the/truncation/logic/variant-b.spec.ts'; // eslint-disable-line max-len + + const testFile1 = `/project/src/${longPath1}`; + const testFile2 = `/project/src/${longPath2}`; + + const result1 = generateNameFromPath(testFile1, roots, true); + const result2 = generateNameFromPath(testFile2, roots, true); + + expect(result1).not.toBe(result2); + // The hash is always 8 characters long and is surrounded by hyphens. + const hashRegex = /-[a-f0-9]{8}-/; + const hash1 = result1.match(hashRegex)?.[0]; + const hash2 = result2.match(hashRegex)?.[0]; + + expect(hash1).toBeDefined(); + expect(hash2).toBeDefined(); + expect(hash1).not.toBe(hash2); + }); + + it('should not truncate a filename that is exactly the max length', () => { + const name = 'a'.repeat(128); + const testFile = `/project/src/${name}.spec.ts`; + const result = generateNameFromPath(testFile, roots, true); + expect(result).toBe(name); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/behavior/runner-config-vitest_spec.ts b/packages/angular/build/src/builders/unit-test/tests/behavior/runner-config-vitest_spec.ts new file mode 100644 index 000000000000..603c69f533ea --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/behavior/runner-config-vitest_spec.ts @@ -0,0 +1,403 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +const VITEST_CONFIG_CONTENT = ` +import { defineConfig } from 'vitest/config'; +export default defineConfig({ + test: { + reporters: [['junit', { outputFile: './vitest-results.xml' }]], + }, +}); +`; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Behavior: "runnerConfig with Vitest runner"', () => { + beforeEach(() => { + setupApplicationTarget(harness); + }); + + it('should use custom reporters defined in runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile('vitest.config.ts', VITEST_CONFIG_CONTENT); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toExist(); + }); + + it('should use custom reportsDirectory defined in runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + coverage: true, + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + coverage: { + reportsDirectory: './custom-coverage-reports', + }, + }, + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('custom-coverage-reports/coverage-final.json').toExist(); + }); + + it('should use default reportsDirectory when not defined in runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + coverage: {}, + }, + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('coverage/test/coverage-final.json').toExist(); + }); + + it('should exclude test files based on runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + exclude: ['src/app/app.component.spec.ts'], + reporters: ['default', ['json', { outputFile: 'vitest-results.json' }]], + }, + }); + `, + ); + + // Create a second test file that should be executed + harness.writeFile( + 'src/app/app-second.spec.ts', + ` + import { TestBed } from '@angular/core/testing'; + import { AppComponent } from './app.component'; + + describe('AppComponent', () => { + beforeEach(() => TestBed.configureTestingModule({ + declarations: [AppComponent], + })); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + + const results = JSON.parse(harness.readFile('vitest-results.json')); + expect(results.numPassedTests).toBe(1); + }); + + it('should allow overriding globals to false via runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + globals: false, + }, + }); + `, + ); + + // This test will fail if globals are enabled, because `test` will not be defined. + harness.writeFile( + 'src/app/app.component.spec.ts', + ` + import { expect } from 'vitest'; + test('should pass', () => { + expect(true).toBe(true); + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeFalse(); + }); + + it('should initialize environment even when globals are disabled in runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + globals: false, + }, + }); + `, + ); + + harness.writeFile( + 'src/app/app.component.spec.ts', + ` + import { test, expect } from 'vitest'; + test('should pass', () => { + expect(true).toBe(true); + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it('should fail when a DOM-dependent test is run in a node environment', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + environment: 'node', + }, + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeFalse(); + }); + + it('should warn and ignore "test.projects" option from runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + projects: ['./foo.config.ts'], + }, + }); + `, + ); + + const { result, logs } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + + // TODO: Re-enable once Vite logs are remapped through build system + // expect(logs).toContain( + // jasmine.objectContaining({ + // level: 'warn', + // message: jasmine.stringMatching( + // 'The "test.projects" option in the Vitest configuration file is not supported.', + // ), + // }), + // ); + }); + + it('should warn and ignore "test.include" option from runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + include: ['src/app/non-existent.spec.ts'], + }, + }); + `, + ); + + const { result, logs } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + + // TODO: Re-enable once Vite logs are remapped through build system + // expect(logs).toContain( + // jasmine.objectContaining({ + // level: 'warn', + // message: jasmine.stringMatching( + // 'The "test.include" option in the Vitest configuration file is not supported.', + // ), + // }), + // ); + }); + + it(`should append "test.setupFiles" (string) from runnerConfig to the CLI's setup`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + setupFiles: './src/app/custom-setup.ts', + }, + }); + `, + ); + + harness.writeFile('src/app/custom-setup.ts', `(globalThis as any).customSetupLoaded = true;`); + + harness.writeFile( + 'src/app/app.component.spec.ts', + ` + import { test, expect } from 'vitest'; + test('should have custom setup loaded', () => { + expect((globalThis as any).customSetupLoaded).toBe(true); + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it(`should append "test.setupFiles" (array) from runnerConfig to the CLI's setup`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + setupFiles: ['./src/app/custom-setup-1.ts', './src/app/custom-setup-2.ts'], + }, + }); + `, + ); + + harness.writeFile('src/app/custom-setup-1.ts', `(globalThis as any).customSetup1 = true;`); + harness.writeFile('src/app/custom-setup-2.ts', `(globalThis as any).customSetup2 = true;`); + + harness.writeFile( + 'src/app/app.component.spec.ts', + ` + import { test, expect } from 'vitest'; + test('should have custom setups loaded', () => { + expect((globalThis as any).customSetup1).toBe(true); + expect((globalThis as any).customSetup2).toBe(true); + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it('should merge and apply custom Vite plugins from runnerConfig file', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'vitest.config.ts', + }); + + harness.writeFile( + 'vitest.config.ts', + ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + plugins: [ + { + name: 'my-custom-transform-plugin', + transform(code, id) { + if (code.includes('__PLACEHOLDER__')) { + return code.replace('__PLACEHOLDER__', 'transformed by custom plugin'); + } + }, + }, + ], + }); + `, + ); + + harness.writeFile( + 'src/app/app.component.spec.ts', + ` + import { test, expect } from 'vitest'; + test('should have been transformed by custom plugin', () => { + const placeholder = '__PLACEHOLDER__'; + expect(placeholder).toBe('transformed by custom plugin'); + }); + `, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/behavior/watch_rebuild_spec.ts b/packages/angular/build/src/builders/unit-test/tests/behavior/watch_rebuild_spec.ts new file mode 100644 index 000000000000..6ff753c7eac7 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/behavior/watch_rebuild_spec.ts @@ -0,0 +1,68 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Watch Mode Behavior', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should run tests when a compilation error is fixed and a test failure is introduced simultaneously', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + watch: true, + }); + + await harness.executeWithCases([ + // 1. Initial success + ({ result }) => { + expect(result?.success).toBeTrue(); + + // 2. Introduce compilation error + harness.writeFiles({ + 'src/app/app.component.spec.ts': ` + import { describe, expect, test } from 'vitest' + describe('AppComponent', () => { + test('should create the app', () => { + expect(true).toBe(true); // Syntax error incoming + const x: string = 1; // Type error + }); + });`, + }); + }, + // 3. Expect compilation error + ({ result }) => { + expect(result?.success).toBeFalse(); + + // 4. Fix compilation error BUT introduce test failure + harness.writeFiles({ + 'src/app/app.component.spec.ts': ` + import { describe, expect, test } from 'vitest' + describe('AppComponent', () => { + test('should create the app', () => { + expect(true).toBe(false); // Logic failure + }); + });`, + }); + }, + // 5. Expect test failure (NOT success, which would happen if the test was skipped) + ({ result }) => { + expect(result?.success).toBeFalse(); + }, + ]); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/browsers_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/browsers_spec.ts new file mode 100644 index 000000000000..afb7aee20d22 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/browsers_spec.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, + expectLog, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "browsers"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should use DOM emulation when browsers is not provided', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + browsers: undefined, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it('should fail when a browser is requested but no provider is installed', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + browsers: ['chrome'], + }); + + const { result, logs } = await harness.executeOnce(); + expect(result?.success).toBeFalse(); + expectLog( + logs, + `The "browsers" option requires either "@vitest/browser-playwright", "@vitest/browser-webdriverio", or "@vitest/browser-preview" to be installed`, + ); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/build-target_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/build-target_spec.ts new file mode 100644 index 000000000000..1af56e060e3d --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/build-target_spec.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + xdescribe('Option: "buildTarget"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should fail when buildTarget is not provided', async () => { + const { buildTarget, ...rest } = BASE_OPTIONS; + harness.useTarget('test', rest as any); + + await expectAsync(harness.executeOnce()).toBeRejectedWithError(/"buildTarget" is required/); + }); + + it('should fail when buildTarget is empty', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + buildTarget: '', + }); + + await expectAsync(harness.executeOnce()).toBeRejectedWithError( + /must match "\^\S+:\S+(:\S+)?\$"/, + ); + }); + + it('should fail when buildTarget does not have a project name', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + buildTarget: ':build', + }); + + await expectAsync(harness.executeOnce()).toBeRejectedWithError( + /must match "\^\S+:\S+(:\S+)?\$"/, + ); + }); + + it('should fail when buildTarget does not have a target name', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + buildTarget: 'app:', + }); + + await expectAsync(harness.executeOnce()).toBeRejectedWithError( + /must match "\^\S+:\S+(:\S+)?\$"/, + ); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-exclude_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-exclude_spec.ts new file mode 100644 index 000000000000..b92e709d2f12 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-exclude_spec.ts @@ -0,0 +1,53 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "coverageExclude"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + await harness.writeFiles({ + 'src/app/error.ts': `export const a = 1;`, + }); + }); + + it('should not exclude any files from coverage when not provided', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + coverageInclude: ['**/*.ts'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + const summary = harness.readFile('coverage/test/coverage-final.json'); + expect(summary).toContain('src/app/error.ts"'); + }); + + it('should exclude files from coverage that match the glob pattern', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + coverageInclude: ['**/*.ts'], + coverageExclude: ['**/error.ts'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + const summary = harness.readFile('coverage/test/coverage-final.json'); + expect(summary).not.toContain('src/app/error.ts"'); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-include_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-include_spec.ts new file mode 100644 index 000000000000..6cdbc8bfa23b --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-include_spec.ts @@ -0,0 +1,82 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "coverageInclude"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + await harness.writeFiles({ + 'src/app/included.ts': `export const a = 1;`, + 'src/app/included.spec.ts': ` + import { a } from './included'; + describe('included', () => { + it('should work', () => { + expect(a).toBe(1); + }); + }); + `, + 'src/app/excluded.ts': `export const b = 2;`, + }); + }); + + it('should only include and report coverage for files that match the glob pattern', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + coverageInclude: ['**/included.ts'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + + const summary = JSON.parse(harness.readFile('coverage/test/coverage-final.json')); + const summaryKeys = Object.keys(summary); + + const includedKey = summaryKeys.find((key) => key.endsWith('src/app/included.ts')); + const excludedKey = summaryKeys.find((key) => key.endsWith('src/app/excluded.ts')); + + // Check that the included file is in the report and the excluded one is not. + expect(includedKey).toBeDefined(); + expect(excludedKey).toBeUndefined(); + + // Check that the coverage data for the included file is valid. + const includedCoverage = summary[includedKey!]; + // The file has one statement, and it should have been executed once. + expect(includedCoverage.s['0']).toBe(1); + }); + + it('should only include referenced files when no include pattern is provided', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + // coverageInclude is not provided, so only referenced files should be included. + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + const summary = JSON.parse(harness.readFile('coverage/test/coverage-final.json')); + const summaryKeys = Object.keys(summary); + + const includedKey = summaryKeys.find((key) => key.endsWith('src/app/included.ts')); + const excludedKey = summaryKeys.find((key) => key.endsWith('src/app/excluded.ts')); + + // The included file is referenced by its spec and should be in the report. + expect(includedKey).toBeDefined(); + // The excluded file is not referenced and should NOT be in the report. + expect(excludedKey).toBeUndefined(); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-reporters_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-reporters_spec.ts new file mode 100644 index 000000000000..edebb9e28167 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage-reporters_spec.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "coverageReporters"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should generate a json summary report when specified', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + coverageReporters: ['json-summary'] as any, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + expect(harness.hasFile('coverage/test/coverage-summary.json')).toBeTrue(); + }); + + it('should generate multiple reports when specified', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + coverageReporters: ['json-summary', 'lcov'] as any, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + expect(harness.hasFile('coverage/test/coverage-summary.json')).toBeTrue(); + expect(harness.hasFile('coverage/test/lcov.info')).toBeTrue(); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/code-coverage_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage_spec.ts new file mode 100644 index 000000000000..f8a8acb60591 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/code-coverage_spec.ts @@ -0,0 +1,57 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "coverage"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should not generate a code coverage report when coverage is false', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: false, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('coverage/test/index.html').toNotExist(); + }); + + it('should generate a code coverage report when coverage is true', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('coverage/test/index.html').toExist(); + }); + + it('should generate a code coverage report when coverage is true', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + coverage: true, + coverageReporters: ['json'] as any, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('coverage/test/coverage-final.json').content.toContain('app.component.ts'); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/debug_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/debug_spec.ts new file mode 100644 index 000000000000..9028ee0eb5fd --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/debug_spec.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, + expectLog, + expectNoLog, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + xdescribe('Option: "debug"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should not enter debug mode when debug is false', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + debug: false, + }); + + const { result, logs } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + expectNoLog(logs, /Node.js inspector/); + }); + + it('should enter debug mode when debug is true', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + debug: true, + }); + + const { result, logs } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + expectLog(logs, /Node.js inspector is active/); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/exclude_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/exclude_spec.ts index 036adf8be63f..2c21f7680716 100644 --- a/packages/angular/build/src/builders/unit-test/tests/options/exclude_spec.ts +++ b/packages/angular/build/src/builders/unit-test/tests/options/exclude_spec.ts @@ -15,7 +15,7 @@ import { } from '../setup'; describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { - xdescribe('Option: "exclude"', () => { + describe('Option: "exclude"', () => { beforeEach(async () => { setupApplicationTarget(harness); }); @@ -59,15 +59,5 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { const { result } = await harness.executeOnce(); expect(result?.success).toBeTrue(); }); - - it(`should exclude spec that matches the 'exclude' pattern prefixed with a slash`, async () => { - harness.useTarget('test', { - ...BASE_OPTIONS, - exclude: ['/src/app/error.spec.ts'], - }); - - const { result } = await harness.executeOnce(); - expect(result?.success).toBeTrue(); - }); }); }); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/filter_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/filter_spec.ts new file mode 100644 index 000000000000..abcfe5976f94 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/filter_spec.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../builder'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "filter"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + + await harness.writeFiles({ + 'src/app/pass.spec.ts': ` + describe('Passing Suite', () => { + it('should pass', () => { + expect(true).toBe(true); + }); + }); + `, + 'src/app/fail.spec.ts': ` + describe('Failing Suite', () => { + it('should fail', () => { + expect(true).toBe(false); + }); + }); + `, + }); + }); + + it('should only run tests that match the filter regex', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + // This filter should only match the 'should pass' test + filter: 'pass$', + }); + + const { result } = await harness.executeOnce(); + // The overall result should be success because the failing test was filtered out. + expect(result?.success).toBe(true); + }); + + it('should run all tests when no filter is provided', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + }); + + const { result } = await harness.executeOnce(); + // The overall result should be failure because the failing test was included. + expect(result?.success).toBe(false); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/include_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/include_spec.ts index be759449d8bc..f1cdd4a14f0b 100644 --- a/packages/angular/build/src/builders/unit-test/tests/options/include_spec.ts +++ b/packages/angular/build/src/builders/unit-test/tests/options/include_spec.ts @@ -15,7 +15,7 @@ import { } from '../setup'; describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { - xdescribe('Option: "include"', () => { + describe('Option: "include"', () => { beforeEach(async () => { setupApplicationTarget(harness); }); @@ -35,18 +35,10 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { test: 'relative path from workspace to spec', input: ['src/app/app.component.spec.ts'], }, - { - test: 'relative path from workspace to file', - input: ['src/app/app.component.ts'], - }, { test: 'relative path from project root to spec', input: ['app/services/test.service.spec.ts'], }, - { - test: 'relative path from project root to file', - input: ['app/services/test.service.ts'], - }, { test: 'relative path from workspace to directory', input: ['src/app/services'], @@ -59,10 +51,6 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { test: 'glob with spec suffix', input: ['**/*.pipe.spec.ts', '**/*.pipe.spec.ts', '**/*test.service.spec.ts'], }, - { - test: 'glob with forward slash and spec suffix', - input: ['/**/*test.service.spec.ts'], - }, ].forEach((options, index) => { it(`should work with ${options.test} (${index})`, async () => { await harness.writeFiles({ diff --git a/packages/angular/build/src/builders/unit-test/tests/options/list-tests_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/list-tests_spec.ts new file mode 100644 index 000000000000..ade399d1936f --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/list-tests_spec.ts @@ -0,0 +1,89 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "listTests"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + + await harness.writeFiles({ + 'src/app/app.component.spec.ts': + 'describe("AppComponent", () => { it("should...", () => {}); });', + 'src/app/other.spec.ts': 'describe("Other", () => { it("should...", () => {}); });', + 'src/app/ignored.ts': 'export const a = 1;', + }); + }); + + it('should list all discovered tests and exit when true', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + listTests: true, + }); + + const { result, logs } = await harness.executeOnce(); + + // Should succeed and exit without running tests + expect(result?.success).toBe(true); + + // Should log the discovered test files + expect(logs).toContain( + jasmine.objectContaining({ message: jasmine.stringMatching(/Discovered test files:/) }), + ); + expect(logs).toContain( + jasmine.objectContaining({ + message: jasmine.stringMatching(/.*app\.component\.spec\.ts/), + }), + ); + expect(logs).toContain( + jasmine.objectContaining({ message: jasmine.stringMatching(/.*other\.spec\.ts/) }), + ); + expect(logs).not.toContain( + jasmine.objectContaining({ message: jasmine.stringMatching(/.*ignore\.ts/) }), + ); + + // Should NOT log output from the test runner (since it shouldn't run) + expect(logs).not.toContain( + jasmine.objectContaining({ + message: jasmine.stringMatching(/Application bundle generation complete/), + }), + ); + }); + + it('should not list tests and should run them as normal when false', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + listTests: false, + }); + + const { result, logs } = await harness.executeOnce(); + + // Should succeed because the tests pass + expect(result?.success).toBe(true); + + // Should NOT log the discovered test files + expect(logs).not.toContain( + jasmine.objectContaining({ message: jasmine.stringMatching(/Discovered test files:/) }), + ); + + // Should log output from the test runner + expect(logs).toContain( + jasmine.objectContaining({ + message: jasmine.stringMatching(/Application bundle generation complete/), + }), + ); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/providers-file_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/providers-file_spec.ts new file mode 100644 index 000000000000..d69f6480c54d --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/providers-file_spec.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "providersFile"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should fail when providersFile does not exist', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + providersFile: 'src/my.providers.ts', + }); + + const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); + expect(result?.success).toBeFalse(); + expect(logs).toContain( + jasmine.objectContaining({ + message: jasmine.stringMatching('Could not resolve "./my.providers"'), + }), + ); + }); + + it('should use providers from the specified file', async () => { + await harness.writeFiles({ + 'src/my.providers.ts': ` + import { importProvidersFrom } from '@angular/core'; + import { CommonModule } from '@angular/common'; + export default [importProvidersFrom(CommonModule)]; + `, + }); + + await harness.modifyFile('src/tsconfig.spec.json', (content) => { + const tsConfig = JSON.parse(content); + tsConfig.files ??= []; + tsConfig.files.push('my.providers.ts'); + + return JSON.stringify(tsConfig); + }); + + harness.useTarget('test', { + ...BASE_OPTIONS, + providersFile: 'src/my.providers.ts', + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/reporter_and_output_file_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/reporter_and_output_file_spec.ts new file mode 100644 index 000000000000..31fc1a7bfe95 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/reporter_and_output_file_spec.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Options: "reporter" and "outputFile"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it(`should output a JSON report`, async () => { + await harness.removeFile('src/app/app.component.spec.ts'); + await harness.writeFiles({ + 'src/app/services/test.service.spec.ts': ` + describe('TestService', () => { + it('should succeed', () => { + expect(true).toBe(true); + }); + });`, + }); + + harness.useTarget('test', { + ...BASE_OPTIONS, + reporters: ['json'], + outputFile: 'test-report.json', + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + const reportContent = await harness.readFile('test-report.json'); + expect(reportContent).toContain('TestService'); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/reporters_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/reporters_spec.ts new file mode 100644 index 000000000000..89ac5804e37e --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/reporters_spec.ts @@ -0,0 +1,80 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "reporters"', () => { + beforeEach(() => { + setupApplicationTarget(harness); + }); + + it(`should support a single reporter`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + reporters: ['json'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it(`should support multiple reporters`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + reporters: ['json', 'verbose'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it(`should support a single reporter with options`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + reporters: [['json', { outputFile: 'a.json' }]], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('a.json').toExist(); + }); + + it(`should support multiple reporters with options`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + reporters: [ + ['json', { outputFile: 'a.json' }], + ['junit', { outputFile: 'a.xml' }], + ], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('a.json').toExist(); + harness.expectFile('a.xml').toExist(); + }); + + it(`should support multiple reporters with and without options`, async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + reporters: [['json', { outputFile: 'a.json' }], 'verbose', 'default'], + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + harness.expectFile('a.json').toExist(); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/runner-config_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/runner-config_spec.ts new file mode 100644 index 000000000000..b061b88e990c --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/runner-config_spec.ts @@ -0,0 +1,129 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +const VITEST_CONFIG_CONTENT = ` +import { defineConfig } from 'vitest/config'; +export default defineConfig({ + test: { + reporters: [['junit', { outputFile: './vitest-results.xml' }]], + }, +}); +`; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "runnerConfig"', () => { + beforeEach(() => { + setupApplicationTarget(harness); + }); + + describe('Vitest Runner', () => { + it('should use a specified config file path', async () => { + harness.writeFile('custom-vitest.config.ts', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: 'custom-vitest.config.ts', + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toExist(); + }); + + it('should search for a config file when `true`', async () => { + harness.writeFile('vitest-base.config.ts', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: true, + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toExist(); + }); + + it('should ignore config file when `false`', async () => { + harness.writeFile('vitest-base.config.ts', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: false, + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toNotExist(); + }); + + it('should ignore config file by default', async () => { + harness.writeFile('vitest-base.config.ts', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toNotExist(); + }); + + it('should find and use a `vitest-base.config.mts` in the project root', async () => { + harness.writeFile('vitest-base.config.mts', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: true, + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toExist(); + }); + + it('should find and use a `vitest-base.config.js` in the workspace root', async () => { + // This file should be ignored because the new logic looks for `vitest-base.config.*`. + harness.writeFile('vitest.config.ts', VITEST_CONFIG_CONTENT); + // The workspace root is the directory containing the project root in the test harness. + harness.writeFile('vitest-base.config.js', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: true, + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toExist(); + }); + + it('should fallback to in-memory config when no base config is found', async () => { + // This file should be ignored because the new logic looks for `vitest-base.config.*` + // and when `runnerConfig` is true, it should not fall back to the default search. + harness.writeFile('vitest.config.ts', VITEST_CONFIG_CONTENT); + harness.useTarget('test', { + ...BASE_OPTIONS, + runnerConfig: true, + }); + + const { result } = await harness.executeOnce(); + + expect(result?.success).toBeTrue(); + harness.expectFile('vitest-results.xml').toNotExist(); + }); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/runner_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/runner_spec.ts new file mode 100644 index 000000000000..77479149784c --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/runner_spec.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + xdescribe('Option: "runner"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should fail when runner is not provided', async () => { + const { runner, ...rest } = BASE_OPTIONS; + harness.useTarget('test', rest as any); + + await expectAsync(harness.executeOnce()).toBeRejectedWithError(/"runner" is required/); + }); + + it('should fail when runner is invalid', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + runner: 'invalid' as any, + }); + + await expectAsync(harness.executeOnce()).toBeRejectedWithError( + /must be one of the following values: "karma", "vitest"/, + ); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/setup-files_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/setup-files_spec.ts new file mode 100644 index 000000000000..5f888ed7ff64 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/setup-files_spec.ts @@ -0,0 +1,57 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, + expectLog, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + xdescribe('Option: "setupFiles"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should fail when a setup file does not exist', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + setupFiles: ['src/setup.ts'], + }); + + const { result, error } = await harness.executeOnce({ outputLogsOnFailure: false }); + expect(result).toBeUndefined(); + expect(error?.message).toMatch(`The specified setup file "src/setup.ts" does not exist.`); + }); + + it('should include the setup files', async () => { + await harness.writeFiles({ + 'src/setup.ts': `console.log('Hello from setup.ts');`, + 'src/app/app.component.spec.ts': ` + import { describe, expect, test } from 'vitest' + describe('AppComponent', () => { + test('should create the app', () => { + expect(true).toBe(true); + }); + });`, + }); + + harness.useTarget('test', { + ...BASE_OPTIONS, + setupFiles: ['src/setup.ts'], + }); + + const { result, logs } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + expectLog(logs, 'Hello from setup.ts'); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/tsconfig_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/tsconfig_spec.ts new file mode 100644 index 000000000000..101f07c1d12e --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/tsconfig_spec.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, + expectLog, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "tsConfig"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should use "tsconfig.spec.json" by default when it exists', async () => { + const { tsConfig, ...rest } = BASE_OPTIONS; + harness.useTarget('test', rest); + + // Create tsconfig.spec.json + await harness.writeFile( + 'tsconfig.spec.json', + `{ "extends": "./tsconfig.json", "compilerOptions": { "types": ["jasmine"] }, "include": ["src/**/*.ts"] }`, + ); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + // TODO: Add expectation that the file was used. + }); + + it('should use build target tsConfig when "tsconfig.spec.json" does not exist', async () => { + const { tsConfig, ...rest } = BASE_OPTIONS; + harness.useTarget('test', rest); + + // The build target tsconfig is not setup to build the tests and should fail + const { result } = await harness.executeOnce(); + expect(result?.success).toBeFalse(); + }); + + it('should fail when user specified tsConfig does not exist', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + tsConfig: 'random/tsconfig.spec.json', + }); + + const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false }); + expect(result?.success).toBeFalse(); + expectLog(logs, `The specified tsConfig file 'random/tsconfig.spec.json' does not exist.`); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/options/watch_spec.ts b/packages/angular/build/src/builders/unit-test/tests/options/watch_spec.ts new file mode 100644 index 000000000000..d1840beb4a96 --- /dev/null +++ b/packages/angular/build/src/builders/unit-test/tests/options/watch_spec.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { execute } from '../../index'; +import { + BASE_OPTIONS, + describeBuilder, + UNIT_TEST_BUILDER_INFO, + setupApplicationTarget, +} from '../setup'; + +describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => { + describe('Option: "watch"', () => { + beforeEach(async () => { + setupApplicationTarget(harness); + }); + + it('should run tests once when watch is false', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + watch: false, + }); + + const { result } = await harness.executeOnce(); + expect(result?.success).toBeTrue(); + }); + + it('should re-run tests when a file changes when watch is true', async () => { + harness.useTarget('test', { + ...BASE_OPTIONS, + watch: true, + }); + + await harness.executeWithCases([ + async ({ result }) => { + expect(result?.success).toBeTrue(); + + await harness.writeFiles({ + 'src/app/app.component.spec.ts': ` + import { describe, expect, test } from 'vitest' + describe('AppComponent', () => { + test('should create the app', () => { + expect(true).toBe(false); + }); + });`, + }); + }, + ({ result }) => { + expect(result?.success).toBeFalse(); + }, + ]); + }); + }); +}); diff --git a/packages/angular/build/src/builders/unit-test/tests/setup.ts b/packages/angular/build/src/builders/unit-test/tests/setup.ts index 80e0426ec3e4..e6770e115789 100644 --- a/packages/angular/build/src/builders/unit-test/tests/setup.ts +++ b/packages/angular/build/src/builders/unit-test/tests/setup.ts @@ -11,10 +11,10 @@ import { readFileSync } from 'node:fs'; import path from 'node:path'; import { BuilderHarness } from '../../../../../../../modules/testing/builder/src'; import { - ApplicationBuilderOptions as AppilicationSchema, + ApplicationBuilderOptions as ApplicationSchema, buildApplication, } from '../../../builders/application'; -import { Schema } from '../schema'; +import { Runner, Schema } from '../schema'; // TODO: Consider using package.json imports field instead of relative path // after the switch to rules_js. @@ -33,7 +33,7 @@ export const APPLICATION_BUILDER_INFO = Object.freeze({ * Contains all required application builder fields. * Also disables progress reporting to minimize logging output. */ -export const APPLICATION_BASE_OPTIONS = Object.freeze({ +export const APPLICATION_BASE_OPTIONS = Object.freeze({ index: 'src/index.html', browser: 'src/main.ts', outputPath: 'dist', @@ -61,7 +61,7 @@ export const UNIT_TEST_BUILDER_INFO = Object.freeze({ export const BASE_OPTIONS = Object.freeze({ buildTarget: 'test:build', tsConfig: 'src/tsconfig.spec.json', - runner: 'vitest' as any, + runner: Runner.Vitest, }); /** @@ -84,7 +84,7 @@ let applicationSchema: json.schema.JsonSchema | undefined; */ export function setupApplicationTarget( harness: BuilderHarness, - extraOptions?: Partial, + extraOptions?: Partial, ): void { applicationSchema ??= JSON.parse( readFileSync(APPLICATION_BUILDER_INFO.schemaPath, 'utf8'), @@ -95,6 +95,7 @@ export function setupApplicationTarget( buildApplication, { ...APPLICATION_BASE_OPTIONS, + polyfills: ['zone.js', '@angular/localize/init'], ...extraOptions, }, { diff --git a/packages/angular/build/src/index.ts b/packages/angular/build/src/index.ts index a27e1f5ae9d2..2831f59a38f4 100644 --- a/packages/angular/build/src/index.ts +++ b/packages/angular/build/src/index.ts @@ -26,3 +26,9 @@ export { execute as executeNgPackagrBuilder, type NgPackagrBuilderOptions, } from './builders/ng-packagr'; +export { + execute as executeUnitTestBuilder, + type UnitTestBuilderOptions, +} from './builders/unit-test'; + +export { execute as executeKarmaBuilder, type KarmaBuilderOptions } from './builders/karma'; diff --git a/packages/angular/build/src/private.ts b/packages/angular/build/src/private.ts index 25eb48f22a86..c55d7482bb2c 100644 --- a/packages/angular/build/src/private.ts +++ b/packages/angular/build/src/private.ts @@ -25,8 +25,7 @@ import { BundleStylesheetOptions } from './tools/esbuild/stylesheets/bundle-opti export { buildApplicationInternal } from './builders/application'; export type { ApplicationBuilderInternalOptions } from './builders/application/options'; export { type Result, type ResultFile, ResultKind } from './builders/application/results'; -export { serveWithVite } from './builders/dev-server/vite-server'; -export { execute as executeKarmaInternal } from './builders/karma/application_builder'; +export { serveWithVite } from './builders/dev-server/vite'; // Tools export * from './tools/babel/plugins'; @@ -36,6 +35,7 @@ export { transformSupportedBrowsersToTargets } from './tools/esbuild/utils'; export { SassWorkerImplementation } from './tools/sass/sass-service'; export { SourceFileCache } from './tools/esbuild/angular/source-file-cache'; +export { Cache } from './tools/esbuild/cache'; export { createJitResourceTransformer } from './tools/angular/transformers/jit-resource-transformer'; export { JavaScriptTransformer } from './tools/esbuild/javascript-transformer'; @@ -59,6 +59,11 @@ export function createCompilerPlugin( ); } +export type { AngularCompilation } from './tools/angular/compilation'; +export { DiagnosticModes } from './tools/angular/compilation'; +export { createAngularCompilation }; +export { ComponentStylesheetBundler } from './tools/esbuild/angular/component-stylesheets'; + // Utilities export * from './utils/bundle-calculator'; export { checkPort } from './utils/check-port'; @@ -84,3 +89,8 @@ export { type BundleStats, generateBuildStatsTable } from './utils/stats-table'; export { getSupportedBrowsers } from './utils/supported-browsers'; export { assertCompatibleAngularVersion } from './utils/version'; export { findTests, getTestEntrypoints } from './builders/karma/find-tests'; +export { + findTailwindConfiguration, + generateSearchDirectories, + loadPostcssConfiguration, +} from './utils/postcss-configuration'; diff --git a/packages/angular/build/src/tools/angular/angular-host.ts b/packages/angular/build/src/tools/angular/angular-host.ts index 38c096f67674..e98ebf49f3eb 100644 --- a/packages/angular/build/src/tools/angular/angular-host.ts +++ b/packages/angular/build/src/tools/angular/angular-host.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import type ng from '@angular/compiler-cli'; +import type * as ng from '@angular/compiler-cli'; import assert from 'node:assert'; import { createHash } from 'node:crypto'; import nodePath from 'node:path'; diff --git a/packages/angular/build/src/tools/angular/compilation/angular-compilation.ts b/packages/angular/build/src/tools/angular/compilation/angular-compilation.ts index bea3c65e1b8a..00a17ccc453e 100644 --- a/packages/angular/build/src/tools/angular/compilation/angular-compilation.ts +++ b/packages/angular/build/src/tools/angular/compilation/angular-compilation.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import type ng from '@angular/compiler-cli'; +import type * as ng from '@angular/compiler-cli'; import type { PartialMessage } from 'esbuild'; import type ts from 'typescript'; -import { loadEsmModule } from '../../../utils/load-esm'; import { convertTypeScriptDiagnostic } from '../../esbuild/angular/diagnostics'; import { profileAsync, profileSync } from '../../esbuild/profiling'; import type { AngularHostOptions } from '../angular-host'; @@ -33,10 +32,7 @@ export abstract class AngularCompilation { static #typescriptModule?: typeof ts; static async loadCompilerCli(): Promise { - // This uses a wrapped dynamic import to load `@angular/compiler-cli` which is ESM. - // Once TypeScript provides support for retaining dynamic imports this workaround can be dropped. - AngularCompilation.#angularCompilerCliModule ??= - await loadEsmModule('@angular/compiler-cli'); + AngularCompilation.#angularCompilerCliModule ??= await import('@angular/compiler-cli'); return AngularCompilation.#angularCompilerCliModule; } @@ -80,6 +76,7 @@ export abstract class AngularCompilation { referencedFiles: readonly string[]; externalStylesheets?: ReadonlyMap; templateUpdates?: ReadonlyMap; + componentResourcesDependencies?: ReadonlyMap; }>; abstract emitAffectedFiles(): Iterable | Promise>; diff --git a/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts b/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts index a340d602577e..06a3f6e8c8d6 100644 --- a/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts +++ b/packages/angular/build/src/tools/angular/compilation/aot-compilation.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import type ng from '@angular/compiler-cli'; +import type * as ng from '@angular/compiler-cli'; import assert from 'node:assert'; import { relative } from 'node:path'; import ts from 'typescript'; @@ -62,6 +62,7 @@ export class AotCompilation extends AngularCompilation { referencedFiles: readonly string[]; externalStylesheets?: ReadonlyMap; templateUpdates?: ReadonlyMap; + componentResourcesDependencies?: ReadonlyMap; }> { // Dynamically load the Angular compiler CLI package const { NgtscProgram, OptimizeFor } = await AngularCompilation.loadCompilerCli(); @@ -175,13 +176,15 @@ export class AotCompilation extends AngularCompilation { findAffectedFiles(typeScriptProgram, angularCompiler, usingBuildInfo), ); + const componentResourcesDependencies = new Map(); + // Get all files referenced in the TypeScript/Angular program including component resources const referencedFiles = typeScriptProgram .getSourceFiles() .filter((sourceFile) => !angularCompiler.ignoreForEmit.has(sourceFile)) .flatMap((sourceFile) => { const resourceDependencies = angularCompiler.getResourceDependencies(sourceFile); - + componentResourcesDependencies.set(sourceFile.fileName, resourceDependencies); // Also invalidate Angular diagnostics for a source file if component resources are modified if (this.#state && hostOptions.modifiedFiles?.size) { for (const resourceDependency of resourceDependencies) { @@ -212,6 +215,7 @@ export class AotCompilation extends AngularCompilation { referencedFiles, externalStylesheets: hostOptions.externalStylesheets, templateUpdates, + componentResourcesDependencies, }; } diff --git a/packages/angular/build/src/tools/angular/compilation/factory.ts b/packages/angular/build/src/tools/angular/compilation/factory.ts index 91447dea24cf..ebfa7aa7edc4 100644 --- a/packages/angular/build/src/tools/angular/compilation/factory.ts +++ b/packages/angular/build/src/tools/angular/compilation/factory.ts @@ -20,8 +20,9 @@ import type { AngularCompilation } from './angular-compilation'; export async function createAngularCompilation( jit: boolean, browserOnlyBuild: boolean, + parallel: boolean = useParallelTs, ): Promise { - if (useParallelTs) { + if (parallel) { const { ParallelCompilation } = await import('./parallel-compilation'); return new ParallelCompilation(jit, browserOnlyBuild); diff --git a/packages/angular/build/src/tools/angular/compilation/hmr-candidates.ts b/packages/angular/build/src/tools/angular/compilation/hmr-candidates.ts index e10b935907c0..cba0b18e7414 100644 --- a/packages/angular/build/src/tools/angular/compilation/hmr-candidates.ts +++ b/packages/angular/build/src/tools/angular/compilation/hmr-candidates.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import type ng from '@angular/compiler-cli'; +import type * as ng from '@angular/compiler-cli'; import assert from 'node:assert'; import ts from 'typescript'; diff --git a/packages/angular/build/src/tools/angular/compilation/jit-compilation.ts b/packages/angular/build/src/tools/angular/compilation/jit-compilation.ts index a811cb50ec0a..4c529df0db08 100644 --- a/packages/angular/build/src/tools/angular/compilation/jit-compilation.ts +++ b/packages/angular/build/src/tools/angular/compilation/jit-compilation.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import type ng from '@angular/compiler-cli'; +import type * as ng from '@angular/compiler-cli'; import assert from 'node:assert'; import ts from 'typescript'; -import { loadEsmModule } from '../../../utils/load-esm'; import { profileSync } from '../../esbuild/profiling'; import { AngularHostOptions, createAngularCompilerHost } from '../angular-host'; import { createJitResourceTransformer } from '../transformers/jit-resource-transformer'; @@ -44,9 +43,9 @@ export class JitCompilation extends AngularCompilation { referencedFiles: readonly string[]; }> { // Dynamically load the Angular compiler CLI package - const { constructorParametersDownlevelTransform } = await loadEsmModule< - typeof import('@angular/compiler-cli/private/tooling') - >('@angular/compiler-cli/private/tooling'); + const { constructorParametersDownlevelTransform } = await import( + '@angular/compiler-cli/private/tooling' + ); // Load the compiler configuration and transform as needed const { diff --git a/packages/angular/build/src/tools/angular/compilation/noop-compilation.ts b/packages/angular/build/src/tools/angular/compilation/noop-compilation.ts index a683271b287f..e2c597b4d315 100644 --- a/packages/angular/build/src/tools/angular/compilation/noop-compilation.ts +++ b/packages/angular/build/src/tools/angular/compilation/noop-compilation.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import type ng from '@angular/compiler-cli'; +import type * as ng from '@angular/compiler-cli'; import type ts from 'typescript'; import { AngularHostOptions } from '../angular-host'; import { AngularCompilation } from './angular-compilation'; diff --git a/packages/angular/build/src/tools/angular/compilation/parallel-worker.ts b/packages/angular/build/src/tools/angular/compilation/parallel-worker.ts index d67fbb9bd06c..b6eccf20e3db 100644 --- a/packages/angular/build/src/tools/angular/compilation/parallel-worker.ts +++ b/packages/angular/build/src/tools/angular/compilation/parallel-worker.ts @@ -45,58 +45,63 @@ export async function initialize(request: InitRequest) { } }); - const { compilerOptions, referencedFiles, externalStylesheets, templateUpdates } = - await compilation.initialize( - request.tsconfig, - { - fileReplacements: request.fileReplacements, - sourceFileCache, - modifiedFiles: sourceFileCache.modifiedFiles, - transformStylesheet(data, containingFile, stylesheetFile, order, className) { - const requestId = randomUUID(); - const resultPromise = new Promise((resolve, reject) => - stylesheetRequests.set(requestId, [resolve, reject]), - ); - - request.stylesheetPort.postMessage({ - requestId, - data, - containingFile, - stylesheetFile, - order, - className, - }); - - return resultPromise; - }, - processWebWorker(workerFile, containingFile) { - Atomics.store(request.webWorkerSignal, 0, 0); - request.webWorkerPort.postMessage({ workerFile, containingFile }); - - Atomics.wait(request.webWorkerSignal, 0, 0); - const result = receiveMessageOnPort(request.webWorkerPort)?.message; - - if (result?.error) { - throw result.error; - } - - return result?.workerCodeFile ?? workerFile; - }, + const { + compilerOptions, + referencedFiles, + externalStylesheets, + templateUpdates, + componentResourcesDependencies, + } = await compilation.initialize( + request.tsconfig, + { + fileReplacements: request.fileReplacements, + sourceFileCache, + modifiedFiles: sourceFileCache.modifiedFiles, + transformStylesheet(data, containingFile, stylesheetFile, order, className) { + const requestId = randomUUID(); + const resultPromise = new Promise((resolve, reject) => + stylesheetRequests.set(requestId, [resolve, reject]), + ); + + request.stylesheetPort.postMessage({ + requestId, + data, + containingFile, + stylesheetFile, + order, + className, + }); + + return resultPromise; }, - (compilerOptions) => { - Atomics.store(request.optionsSignal, 0, 0); - request.optionsPort.postMessage(compilerOptions); + processWebWorker(workerFile, containingFile) { + Atomics.store(request.webWorkerSignal, 0, 0); + request.webWorkerPort.postMessage({ workerFile, containingFile }); - Atomics.wait(request.optionsSignal, 0, 0); - const result = receiveMessageOnPort(request.optionsPort)?.message; + Atomics.wait(request.webWorkerSignal, 0, 0); + const result = receiveMessageOnPort(request.webWorkerPort)?.message; if (result?.error) { throw result.error; } - return result?.transformedOptions ?? compilerOptions; + return result?.workerCodeFile ?? workerFile; }, - ); + }, + (compilerOptions) => { + Atomics.store(request.optionsSignal, 0, 0); + request.optionsPort.postMessage(compilerOptions); + + Atomics.wait(request.optionsSignal, 0, 0); + const result = receiveMessageOnPort(request.optionsPort)?.message; + + if (result?.error) { + throw result.error; + } + + return result?.transformedOptions ?? compilerOptions; + }, + ); return { externalStylesheets, @@ -109,6 +114,7 @@ export async function initialize(request: InitRequest) { sourceMap: compilerOptions.sourceMap, inlineSourceMap: compilerOptions.inlineSourceMap, }, + componentResourcesDependencies, }; } diff --git a/packages/angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.ts b/packages/angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.ts index 89b96244b765..d1d0a76df85d 100644 --- a/packages/angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.ts +++ b/packages/angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.ts @@ -32,7 +32,7 @@ export function replaceBootstrap( bootstrapImport = nodeFactory.createImportDeclaration( undefined, nodeFactory.createImportClause( - false, + undefined, undefined, nodeFactory.createNamespaceImport(bootstrapNamespace), ), diff --git a/packages/angular/build/src/tools/angular/transformers/jit-resource-transformer.ts b/packages/angular/build/src/tools/angular/transformers/jit-resource-transformer.ts index 3d7878378537..2a064ba63cb5 100644 --- a/packages/angular/build/src/tools/angular/transformers/jit-resource-transformer.ts +++ b/packages/angular/build/src/tools/angular/transformers/jit-resource-transformer.ts @@ -254,7 +254,7 @@ function createResourceImport( resourceImportDeclarations.push( nodeFactory.createImportDeclaration( undefined, - nodeFactory.createImportClause(false, importName, undefined), + nodeFactory.createImportClause(undefined, importName, undefined), urlLiteral, ), ); diff --git a/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions.ts b/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions.ts index ce47977a74e3..5aec104a38d2 100644 --- a/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions.ts +++ b/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions.ts @@ -6,12 +6,17 @@ * found in the LICENSE file at https://angular.dev/license */ -import type { PluginObj } from '@babel/core'; +import type { NodePath, PluginObj, PluginPass, types } from '@babel/core'; import annotateAsPure from '@babel/helper-annotate-as-pure'; import * as tslib from 'tslib'; /** - * A cached set of TypeScript helper function names used by the helper name matcher utility function. + * A set of constructor names that are considered to be side-effect free. + */ +const sideEffectFreeConstructors = new Set(['InjectionToken']); + +/** + * A set of TypeScript helper function names used by the helper name matcher utility function. */ const tslibHelpers = new Set(Object.keys(tslib).filter((h) => h.startsWith('__'))); @@ -44,15 +49,23 @@ function isBabelHelperName(name: string): boolean { return babelHelpers.has(name); } +interface ExtendedPluginPass extends PluginPass { + opts: { topLevelSafeMode?: boolean }; +} + /** * A babel plugin factory function for adding the PURE annotation to top-level new and call expressions. - * * @returns A babel plugin object instance. */ export default function (): PluginObj { return { visitor: { - CallExpression(path) { + CallExpression(path: NodePath, state: ExtendedPluginPass) { + const { topLevelSafeMode = false } = state.opts; + if (topLevelSafeMode) { + return; + } + // If the expression has a function parent, it is not top-level if (path.getFunctionParent()) { return; @@ -65,6 +78,7 @@ export default function (): PluginObj { ) { return; } + // Do not annotate TypeScript helpers emitted by the TypeScript compiler or Babel helpers. // They are intended to cause side effects. if ( @@ -76,9 +90,22 @@ export default function (): PluginObj { annotateAsPure(path); }, - NewExpression(path) { + NewExpression(path: NodePath, state: ExtendedPluginPass) { // If the expression has a function parent, it is not top-level - if (!path.getFunctionParent()) { + if (path.getFunctionParent()) { + return; + } + + const { topLevelSafeMode = false } = state.opts; + + if (!topLevelSafeMode) { + annotateAsPure(path); + + return; + } + + const callee = path.get('callee'); + if (callee.isIdentifier() && sideEffectFreeConstructors.has(callee.node.name)) { annotateAsPure(path); } }, diff --git a/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions_spec.ts b/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions_spec.ts index 891f794f43d5..0966a67d068a 100644 --- a/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions_spec.ts +++ b/packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions_spec.ts @@ -7,23 +7,24 @@ */ import { transformSync } from '@babel/core'; -// eslint-disable-next-line import/no-extraneous-dependencies import { format } from 'prettier'; import pureTopLevelPlugin from './pure-toplevel-functions'; function testCase({ input, expected, + options, }: { input: string; expected: string; + options?: { topLevelSafeMode: boolean }; }): jasmine.ImplementationCallback { return async () => { const result = transformSync(input, { configFile: false, babelrc: false, compact: true, - plugins: [pureTopLevelPlugin], + plugins: [[pureTopLevelPlugin, options]], }); if (!result?.code) { fail('Expected babel to return a transform result.'); @@ -152,4 +153,33 @@ describe('pure-toplevel-functions Babel plugin', () => { }; `), ); + + describe('topLevelSafeMode: true', () => { + it( + 'annotates top-level `new InjectionToken` expressions', + testCase({ + input: `const result = new InjectionToken('abc');`, + expected: `const result = /*#__PURE__*/ new InjectionToken('abc');`, + options: { topLevelSafeMode: true }, + }), + ); + + it( + 'does not annotate other top-level `new` expressions', + testCase({ + input: 'const result = new SomeClass();', + expected: 'const result = new SomeClass();', + options: { topLevelSafeMode: true }, + }), + ); + + it( + 'does not annotate top-level function calls', + testCase({ + input: 'const result = someCall();', + expected: 'const result = someCall();', + options: { topLevelSafeMode: true }, + }), + ); + }); }); diff --git a/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts b/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts index 72131901ae94..af4dcaea01fb 100644 --- a/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts +++ b/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts @@ -13,11 +13,13 @@ import type { OnStartResult, OutputFile, PartialMessage, + PartialNote, Plugin, PluginBuild, } from 'esbuild'; import assert from 'node:assert'; import { createHash } from 'node:crypto'; +import { readFile } from 'node:fs/promises'; import * as path from 'node:path'; import { maxWorkers, useTypeChecking } from '../../../utils/environment-options'; import { AngularHostOptions } from '../../angular/angular-host'; @@ -29,12 +31,20 @@ import { SharedTSCompilationState, getSharedCompilationState } from './compilati import { ComponentStylesheetBundler } from './component-stylesheets'; import { FileReferenceTracker } from './file-reference-tracker'; import { setupJitPluginCallbacks } from './jit-plugin-callbacks'; +import { rewriteForBazel } from './rewrite-bazel-paths'; import { SourceFileCache } from './source-file-cache'; export interface CompilerPluginOptions { sourcemap: boolean | 'external'; tsconfig: string; jit?: boolean; + + /** + * Include class metadata and JIT information in built code. + * The Angular TestBed APIs require additional metadata for the Angular aspects of the application + * such as Components, Modules, Pipes, etc. + * TestBed may also leverage JIT capabilities during testing (e.g., overrideComponent). + */ includeTestMetadata?: boolean; advancedOptimizations?: boolean; @@ -63,11 +73,11 @@ export function createCompilerPlugin( // Initialize a worker pool for JavaScript transformations. // Webcontainers currently do not support this persistent cache store. - let cacheStore: import('../lmdb-cache-store').LmbdCacheStore | undefined; + let cacheStore: import('../lmdb-cache-store').LmdbCacheStore | undefined; if (pluginOptions.sourceFileCache?.persistentCachePath && !process.versions.webcontainer) { try { - const { LmbdCacheStore } = await import('../lmdb-cache-store'); - cacheStore = new LmbdCacheStore( + const { LmdbCacheStore } = await import('../lmdb-cache-store'); + cacheStore = new LmdbCacheStore( path.join(pluginOptions.sourceFileCache.persistentCachePath, 'angular-compiler.db'), ); } catch (e) { @@ -89,7 +99,7 @@ export function createCompilerPlugin( sourcemap: !!pluginOptions.sourcemap, thirdPartySourcemaps: pluginOptions.thirdPartySourcemaps, advancedOptimizations: pluginOptions.advancedOptimizations, - jit: pluginOptions.jit, + jit: pluginOptions.jit || pluginOptions.includeTestMetadata, }, maxWorkers, cacheStore?.createCache('jstransformer'), @@ -404,8 +414,8 @@ export function createCompilerPlugin( }); build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, async (args) => { - const request = path.normalize( - pluginOptions.fileReplacements?.[path.normalize(args.path)] ?? args.path, + const request = rewriteForBazel( + path.normalize(pluginOptions.fileReplacements?.[path.normalize(args.path)] ?? args.path), ); const isJS = /\.[cm]?js$/.test(request); @@ -433,11 +443,23 @@ export function createCompilerPlugin( return undefined; } + const diangosticRoot = build.initialOptions.absWorkingDir ?? ''; + + // Evaluate whether the file requires the Angular compiler transpilation. + // If not, issue a warning but allow bundler to process the file (no type-checking). + const directContents = await readFile(request, 'utf-8'); + if (!requiresAngularCompiler(directContents)) { + return { + warnings: [createMissingFileDiagnostic(request, args.path, diangosticRoot, false)], + contents, + loader: 'ts', + resolveDir: path.dirname(request), + }; + } + // Otherwise return an error return { - errors: [ - createMissingFileError(request, args.path, build.initialOptions.absWorkingDir ?? ''), - ], + errors: [createMissingFileDiagnostic(request, args.path, diangosticRoot, true)], }; } else if (typeof contents === 'string' && (useTypeScriptTranspilation || isJS)) { // A string indicates untransformed output from the TS/NG compiler. @@ -471,13 +493,14 @@ export function createCompilerPlugin( return { contents, loader, + resolveDir: path.dirname(request), }; }); build.onLoad( { filter: /\.[cm]?js$/ }, createCachedLoad(pluginOptions.loadResultCache, async (args) => { - let request = args.path; + let request = rewriteForBazel(args.path); if (pluginOptions.fileReplacements) { const replacement = pluginOptions.fileReplacements[path.normalize(args.path)]; if (replacement) { @@ -498,6 +521,7 @@ export function createCompilerPlugin( return { contents, loader: 'js', + resolveDir: path.dirname(request), watchFiles: request !== args.path ? [request] : undefined, }; }, @@ -567,6 +591,7 @@ export function createCompilerPlugin( build.onDispose(() => { sharedTSCompilationState?.dispose(); void compilation.close?.(); + void javascriptTransformer.close(); void cacheStore?.close(); }); @@ -718,6 +743,7 @@ function createCompilerOptionsTransformer( externalRuntimeStyles: pluginOptions.externalRuntimeStyles, _enableHmr: !!pluginOptions.templateUpdates, supportTestBed: !!pluginOptions.includeTestMetadata, + supportJitMode: !!pluginOptions.includeTestMetadata, }; }; } @@ -751,23 +777,46 @@ function bundleWebWorker( } } -function createMissingFileError(request: string, original: string, root: string): PartialMessage { +function createMissingFileDiagnostic( + request: string, + original: string, + root: string, + angular: boolean, +): PartialMessage { const relativeRequest = path.relative(root, request); - const error = { - text: `File '${relativeRequest}' is missing from the TypeScript compilation.`, - notes: [ - { - text: `Ensure the file is part of the TypeScript program via the 'files' or 'include' property.`, - }, - ], - }; + const notes: PartialNote[] = []; + + if (angular) { + notes.push({ + text: + `Files containing Angular metadata ('@Component'/'@Directive'/etc.) must be part of the TypeScript compilation.` + + ` You can ensure the file is part of the TypeScript program via the 'files' or 'include' property.`, + }); + } else { + notes.push({ + text: + `The file will be bundled and included in the output but will not be type-checked at build time.` + + ` To remove this message you can add the file to the TypeScript program via the 'files' or 'include' property.`, + }); + } const relativeOriginal = path.relative(root, original); if (relativeRequest !== relativeOriginal) { - error.notes.push({ + notes.push({ text: `File is requested from a file replacement of '${relativeOriginal}'.`, }); } - return error; + const diagnostic = { + text: `File '${relativeRequest}' not found in TypeScript compilation.`, + notes, + }; + + return diagnostic; +} + +const POTENTIAL_METADATA_REGEX = /@angular\/core|@Component|@Directive|@Injectable|@Pipe|@NgModule/; + +function requiresAngularCompiler(contents: string): boolean { + return POTENTIAL_METADATA_REGEX.test(contents); } diff --git a/packages/angular/build/src/tools/esbuild/angular/diagnostics.ts b/packages/angular/build/src/tools/esbuild/angular/diagnostics.ts index fab71ee848d2..bf85b69f707c 100644 --- a/packages/angular/build/src/tools/esbuild/angular/diagnostics.ts +++ b/packages/angular/build/src/tools/esbuild/angular/diagnostics.ts @@ -75,9 +75,13 @@ export function convertTypeScriptDiagnostic( ): PartialMessage { let codePrefix = 'TS'; let code = `${diagnostic.code}`; - if (diagnostic.source === 'ngtsc') { + + // Custom ngtsc diagnostics are prefixed with -99 which isn't a valid TypeScript diagnostic code. + // Strip it and mark the diagnostic as coming from Angular. Note that we can't rely on + // `diagnostic.source`, because it isn't always produced. This is identical to: + // https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/util.ts + if (code.startsWith('-99')) { codePrefix = 'NG'; - // Remove `-99` Angular prefix from diagnostic code code = code.slice(3); } diff --git a/packages/angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.ts b/packages/angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.ts new file mode 100644 index 000000000000..8a6fb6aa82a4 --- /dev/null +++ b/packages/angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { join, relative } from 'node:path'; + +const bazelBinDirectory = process.env['BAZEL_BINDIR']; +const bazelExecRoot = process.env['JS_BINARY__EXECROOT']; + +export function rewriteForBazel(path: string): string { + if (!bazelBinDirectory || !bazelExecRoot) { + return path; + } + + const fromExecRoot = relative(bazelExecRoot, path); + if (!fromExecRoot.startsWith('..')) { + return path; + } + + const fromBinDirectory = relative(bazelBinDirectory, path); + if (fromBinDirectory.startsWith('..')) { + return path; + } + + return join(bazelExecRoot, fromBinDirectory); +} diff --git a/packages/angular/build/src/tools/esbuild/application-code-bundle.ts b/packages/angular/build/src/tools/esbuild/application-code-bundle.ts index c5d18d67228d..635faca8c82e 100644 --- a/packages/angular/build/src/tools/esbuild/application-code-bundle.ts +++ b/packages/angular/build/src/tools/esbuild/application-code-bundle.ts @@ -13,6 +13,7 @@ import { extname, relative } from 'node:path'; import type { NormalizedApplicationBuildOptions } from '../../builders/application/options'; import { ExperimentalPlatform } from '../../builders/application/schema'; import { allowMangle } from '../../utils/environment-options'; +import { toPosixPath } from '../../utils/path'; import { SERVER_APP_ENGINE_MANIFEST_FILENAME, SERVER_APP_MANIFEST_FILENAME, @@ -653,7 +654,7 @@ function getEsBuildCommonPolyfillsOptions( tryToResolvePolyfillsAsRelative: boolean, loadResultCache: LoadResultCache | undefined, ): BuildOptions | undefined { - const { jit, workspaceRoot, i18nOptions } = options; + const { jit, workspaceRoot, i18nOptions, externalPackages } = options; const buildOptions = getEsBuildCommonOptions(options); buildOptions.splitting = false; @@ -670,8 +671,10 @@ function getEsBuildCommonPolyfillsOptions( // Locale data should go first so that project provided polyfill code can augment if needed. let needLocaleDataPlugin = false; if (i18nOptions.shouldInline) { - // Remove localize polyfill as this is not needed for build time i18n. - polyfills = polyfills.filter((path) => !path.startsWith('@angular/localize')); + if (!externalPackages) { + // Remove localize polyfill when i18n inline transformation have been applied to all the packages. + polyfills = polyfills.filter((path) => !path.startsWith('@angular/localize')); + } // Add locale data for all active locales // TODO: Inject each individually within the inlining process itself @@ -685,7 +688,7 @@ function getEsBuildCommonPolyfillsOptions( needLocaleDataPlugin = true; } if (needLocaleDataPlugin) { - buildOptions.plugins.push(createAngularLocaleDataPlugin()); + buildOptions.plugins.unshift(createAngularLocaleDataPlugin()); } if (polyfills.length === 0) { @@ -719,9 +722,7 @@ function getEsBuildCommonPolyfillsOptions( } // Generate module contents with an import statement per defined polyfill - let contents = polyfillPaths - .map((file) => `import '${file.replace(/\\/g, '/')}';`) - .join('\n'); + let contents = polyfillPaths.map((file) => `import '${toPosixPath(file)}';`).join('\n'); // The below should be done after loading `$localize` as otherwise the locale will be overridden. if (i18nOptions.shouldInline) { @@ -746,10 +747,5 @@ function getEsBuildCommonPolyfillsOptions( } function entryFileToWorkspaceRelative(workspaceRoot: string, entryFile: string): string { - return ( - './' + - relative(workspaceRoot, entryFile) - .replace(/.[mc]?ts$/, '') - .replace(/\\/g, '/') - ); + return './' + toPosixPath(relative(workspaceRoot, entryFile).replace(/.[mc]?ts$/, '')); } diff --git a/packages/angular/build/src/tools/esbuild/bundler-context.ts b/packages/angular/build/src/tools/esbuild/bundler-context.ts index 9b722e41640e..864ca2c6fdd9 100644 --- a/packages/angular/build/src/tools/esbuild/bundler-context.ts +++ b/packages/angular/build/src/tools/esbuild/bundler-context.ts @@ -366,6 +366,7 @@ export class BundlerContext { if ( !external || SERVER_GENERATED_EXTERNALS.has(path) || + isInternalAngularFile(path) || (kind !== 'import-statement' && kind !== 'dynamic-import' && kind !== 'require-call') ) { continue; diff --git a/packages/angular/build/src/tools/esbuild/global-styles.ts b/packages/angular/build/src/tools/esbuild/global-styles.ts index 682885c43350..fd2cb13fa7b2 100644 --- a/packages/angular/build/src/tools/esbuild/global-styles.ts +++ b/packages/angular/build/src/tools/esbuild/global-styles.ts @@ -8,6 +8,7 @@ import assert from 'node:assert'; import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; +import { toPosixPath } from '../../utils/path'; import { BundlerOptionsFactory } from './bundler-context'; import { createStylesheetBundleOptions } from './stylesheets/bundle-options'; import { createVirtualModulePlugin } from './virtual-module-plugin'; @@ -91,7 +92,7 @@ export function createGlobalStylesBundleOptions( assert(files, `global style name should always be found [${args.path}]`); return { - contents: files.map((file) => `@import '${file.replace(/\\/g, '/')}';`).join('\n'), + contents: files.map((file) => `@import '${toPosixPath(file)}';`).join('\n'), loader: 'css', resolveDir: workspaceRoot, }; diff --git a/packages/angular/build/src/tools/esbuild/i18n-inliner-worker.ts b/packages/angular/build/src/tools/esbuild/i18n-inliner-worker.ts index 9caa2ca5da45..74550e83e5de 100644 --- a/packages/angular/build/src/tools/esbuild/i18n-inliner-worker.ts +++ b/packages/angular/build/src/tools/esbuild/i18n-inliner-worker.ts @@ -11,7 +11,6 @@ import { PluginObj, parseSync, transformFromAstAsync, types } from '@babel/core' import assert from 'node:assert'; import { workerData } from 'node:worker_threads'; import { assertIsError } from '../../utils/error'; -import { loadEsmModule } from '../../utils/load-esm'; /** * The options passed to the inliner for each file request @@ -131,7 +130,7 @@ async function loadLocalizeTools(): Promise { // Load ESM `@angular/localize/tools` using the TypeScript dynamic import workaround. // Once TypeScript provides support for keeping the dynamic import this workaround can be // changed to a direct dynamic import. - localizeToolsModule ??= await loadEsmModule('@angular/localize/tools'); + localizeToolsModule ??= await import('@angular/localize/tools'); return localizeToolsModule; } diff --git a/packages/angular/build/src/tools/esbuild/i18n-inliner.ts b/packages/angular/build/src/tools/esbuild/i18n-inliner.ts index 365fbb300953..fcb439b84c5c 100644 --- a/packages/angular/build/src/tools/esbuild/i18n-inliner.ts +++ b/packages/angular/build/src/tools/esbuild/i18n-inliner.ts @@ -11,7 +11,7 @@ import { createHash } from 'node:crypto'; import { extname, join } from 'node:path'; import { WorkerPool } from '../../utils/worker-pool'; import { BuildOutputFile, BuildOutputFileType } from './bundler-context'; -import type { LmbdCacheStore } from './lmdb-cache-store'; +import type { LmdbCacheStore } from './lmdb-cache-store'; import { createOutputFile } from './utils'; /** @@ -39,7 +39,7 @@ export interface I18nInlinerOptions { export class I18nInliner { #cacheInitFailed = false; #workerPool: WorkerPool; - #cache: LmbdCacheStore | undefined; + #cache: LmdbCacheStore | undefined; readonly #localizeFiles: ReadonlyMap; readonly #unmodifiedFiles: Array; @@ -274,9 +274,9 @@ export class I18nInliner { // Initialize a persistent cache for i18n transformations. try { - const { LmbdCacheStore } = await import('./lmdb-cache-store'); + const { LmdbCacheStore } = await import('./lmdb-cache-store'); - this.#cache = new LmbdCacheStore(join(persistentCachePath, 'angular-i18n.db')); + this.#cache = new LmdbCacheStore(join(persistentCachePath, 'angular-i18n.db')); } catch { this.#cacheInitFailed = true; diff --git a/packages/angular/build/src/tools/esbuild/i18n-locale-plugin.ts b/packages/angular/build/src/tools/esbuild/i18n-locale-plugin.ts index 30f4540dc3a8..ae94b62ca16d 100644 --- a/packages/angular/build/src/tools/esbuild/i18n-locale-plugin.ts +++ b/packages/angular/build/src/tools/esbuild/i18n-locale-plugin.ts @@ -6,7 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import type { Plugin } from 'esbuild'; +import type { Plugin, ResolveResult } from 'esbuild'; +import { createRequire } from 'node:module'; /** * The internal namespace used by generated locale import statements and Angular locale data plugin. @@ -27,17 +28,6 @@ export function createAngularLocaleDataPlugin(): Plugin { return { name: 'angular-locale-data', setup(build): void { - // If packages are configured to be external then leave the original angular locale import path. - // This happens when using the development server with caching enabled to allow Vite prebundling to work. - // There currently is no option on the esbuild resolve function to resolve while disabling the option. To - // workaround the inability to resolve the full locale location here, the Vite dev server prebundling also - // contains a plugin to allow the locales to be correctly resolved when prebundling. - // NOTE: If esbuild eventually allows controlling the external package options in a build.resolve call, this - // workaround can be removed. - if (build.initialOptions.packages === 'external') { - return; - } - build.onResolve({ filter: /^angular:locale\/data:/ }, async ({ path }) => { // Extract the locale from the path const rawLocaleTag = path.split(':', 3)[2]; @@ -60,6 +50,7 @@ export function createAngularLocaleDataPlugin(): Plugin { } let exact = true; + let localeRequire: NodeJS.Require | undefined; while (partialLocaleTag) { // Angular embeds the `en`/`en-US` locale into the framework and it does not need to be included again here. // The onLoad hook below for the locale data namespace has an `empty` loader that will prevent inclusion. @@ -73,11 +64,39 @@ export function createAngularLocaleDataPlugin(): Plugin { // Attempt to resolve the locale tag data within the Angular base module location const potentialPath = `${LOCALE_DATA_BASE_MODULE}/${partialLocaleTag}`; - const result = await build.resolve(potentialPath, { - kind: 'import-statement', - resolveDir: build.initialOptions.absWorkingDir, - }); - if (result.path) { + + // If packages are configured to be external then leave the original angular locale import path. + // This happens when using the development server with caching enabled to allow Vite prebundling to work. + // There currently is no option on the esbuild resolve function to resolve while disabling the option. + // NOTE: If esbuild eventually allows controlling the external package options in a build.resolve call, this + // workaround can be removed. + let result: ResolveResult | undefined; + const { packages, absWorkingDir } = build.initialOptions; + if (packages === 'external' && absWorkingDir) { + localeRequire ??= createRequire(absWorkingDir + '/'); + + try { + localeRequire.resolve(potentialPath); + + result = { + errors: [], + warnings: [], + external: true, + sideEffects: true, + namespace: '', + suffix: '', + pluginData: undefined, + path: potentialPath, + }; + } catch {} + } else { + result = await build.resolve(potentialPath, { + kind: 'import-statement', + resolveDir: absWorkingDir, + }); + } + + if (result?.path) { if (exact) { return result; } else { diff --git a/packages/angular/build/src/tools/esbuild/javascript-transformer-worker.ts b/packages/angular/build/src/tools/esbuild/javascript-transformer-worker.ts index 3d7c8d2ca126..7d86009b773f 100644 --- a/packages/angular/build/src/tools/esbuild/javascript-transformer-worker.ts +++ b/packages/angular/build/src/tools/esbuild/javascript-transformer-worker.ts @@ -10,7 +10,6 @@ import { type PluginItem, transformAsync } from '@babel/core'; import fs from 'node:fs'; import path from 'node:path'; import Piscina from 'piscina'; -import { loadEsmModule } from '../../utils/load-esm'; interface JavaScriptTransformRequest { filename: string; @@ -27,6 +26,14 @@ interface JavaScriptTransformRequest { const textDecoder = new TextDecoder(); const textEncoder = new TextEncoder(); +/** + * The function name prefix for all Angular partial compilation functions. + * Used to determine if linking of a JavaScript file is required. + * If any additional declarations are added or otherwise changed in the linker, + * the names MUST begin with this prefix. + */ +const LINKER_DECLARATION_PREFIX = 'ɵɵngDeclare'; + export default async function transformJavaScript( request: JavaScriptTransformRequest, ): Promise { @@ -46,11 +53,6 @@ let linkerPluginCreator: | typeof import('@angular/compiler-cli/linker/babel').createEs2015LinkerPlugin | undefined; -/** - * Cached instance of the compiler-cli linker's needsLinking function. - */ -let needsLinking: typeof import('@angular/compiler-cli/linker').needsLinking | undefined; - async function transformWithBabel( filename: string, data: string, @@ -75,21 +77,19 @@ async function transformWithBabel( } if (options.advancedOptimizations) { - const sideEffectFree = options.sideEffects === false; - const safeAngularPackage = - sideEffectFree && /[\\/]node_modules[\\/]@angular[\\/]/.test(filename); - const { adjustStaticMembers, adjustTypeScriptEnums, elideAngularMetadata, markTopLevelPure } = await import('../babel/plugins'); - if (safeAngularPackage) { - plugins.push(markTopLevelPure); - } + const sideEffectFree = options.sideEffects === false; + const safeAngularPackage = + sideEffectFree && /[\\/]node_modules[\\/]@angular[\\/]/.test(filename); - plugins.push(elideAngularMetadata, adjustTypeScriptEnums, [ - adjustStaticMembers, - { wrapDecorators: sideEffectFree }, - ]); + plugins.push( + [markTopLevelPure, { topLevelSafeMode: !safeAngularPackage }], + elideAngularMetadata, + adjustTypeScriptEnums, + [adjustStaticMembers, { wrapDecorators: sideEffectFree }], + ); } // If no additional transformations are needed, return the data directly @@ -125,25 +125,15 @@ async function requiresLinking(path: string, source: string): Promise { return false; } - if (!needsLinking) { - // Load ESM `@angular/compiler-cli/linker` using the TypeScript dynamic import workaround. - // Once TypeScript provides support for keeping the dynamic import this workaround can be - // changed to a direct dynamic import. - const linkerModule = await loadEsmModule( - '@angular/compiler-cli/linker', - ); - needsLinking = linkerModule.needsLinking; - } - - return needsLinking(path, source); + // Check if the source code includes one of the declaration functions. + // There is a low chance of a false positive but the names are fairly unique + // and the result would be an unnecessary no-op additional plugin pass. + return source.includes(LINKER_DECLARATION_PREFIX); } async function createLinkerPlugin(options: Omit) { - linkerPluginCreator ??= ( - await loadEsmModule( - '@angular/compiler-cli/linker/babel', - ) - ).createEs2015LinkerPlugin; + linkerPluginCreator ??= (await import('@angular/compiler-cli/linker/babel')) + .createEs2015LinkerPlugin; const linkerPlugin = linkerPluginCreator({ linkerJitMode: options.jit, diff --git a/packages/angular/build/src/tools/esbuild/javascript-transformer.ts b/packages/angular/build/src/tools/esbuild/javascript-transformer.ts index 8e2d8e31ab8f..b728a0f599e2 100644 --- a/packages/angular/build/src/tools/esbuild/javascript-transformer.ts +++ b/packages/angular/build/src/tools/esbuild/javascript-transformer.ts @@ -56,6 +56,10 @@ export class JavaScriptTransformer { } #ensureWorkerPool(): WorkerPool { + if (this.#workerPool) { + return this.#workerPool; + } + const workerPoolOptions: WorkerPoolOptions = { filename: require.resolve('./javascript-transformer-worker'), maxThreads: this.maxThreads, @@ -67,7 +71,7 @@ export class JavaScriptTransformer { workerPoolOptions.execArgv = filteredExecArgv; } - this.#workerPool ??= new WorkerPool(workerPoolOptions); + this.#workerPool = new WorkerPool(workerPoolOptions); return this.#workerPool; } diff --git a/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts b/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts index 7d03cb597738..dba108285342 100644 --- a/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts +++ b/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts @@ -9,7 +9,7 @@ import { RootDatabase, open } from 'lmdb'; import { Cache, CacheStore } from './cache'; -export class LmbdCacheStore implements CacheStore { +export class LmdbCacheStore implements CacheStore { readonly #cacheFileUrl; #db: RootDatabase | undefined; diff --git a/packages/angular/build/src/tools/esbuild/loader-import-attribute-plugin.ts b/packages/angular/build/src/tools/esbuild/loader-import-attribute-plugin.ts index 2856ad5c4100..8a9588b63a7b 100644 --- a/packages/angular/build/src/tools/esbuild/loader-import-attribute-plugin.ts +++ b/packages/angular/build/src/tools/esbuild/loader-import-attribute-plugin.ts @@ -9,7 +9,7 @@ import type { Loader, Plugin } from 'esbuild'; import { readFile } from 'node:fs/promises'; -const SUPPORTED_LOADERS: Loader[] = ['binary', 'file', 'text']; +const SUPPORTED_LOADERS: Loader[] = ['base64', 'binary', 'dataurl', 'file', 'text']; export function createLoaderImportAttributePlugin(): Plugin { return { diff --git a/packages/angular/build/src/tools/esbuild/stylesheets/bundle-options.ts b/packages/angular/build/src/tools/esbuild/stylesheets/bundle-options.ts index 9bbcb7c5ecb8..7fa20dde64ae 100644 --- a/packages/angular/build/src/tools/esbuild/stylesheets/bundle-options.ts +++ b/packages/angular/build/src/tools/esbuild/stylesheets/bundle-options.ts @@ -31,7 +31,7 @@ export interface BundleStylesheetOptions { externalDependencies?: string[]; target: string[]; tailwindConfiguration?: { file: string; package: string }; - postcssConfiguration?: PostcssConfiguration; + postcssConfiguration?: { config: PostcssConfiguration; configPath: string }; publicPath?: string; cacheOptions: NormalizedCachedOptions; } diff --git a/packages/angular/build/src/tools/esbuild/stylesheets/less-language.ts b/packages/angular/build/src/tools/esbuild/stylesheets/less-language.ts index 1f6d8f2b7c26..68cacd576b10 100644 --- a/packages/angular/build/src/tools/esbuild/stylesheets/less-language.ts +++ b/packages/angular/build/src/tools/esbuild/stylesheets/less-language.ts @@ -32,13 +32,7 @@ export const LessStylesheetLanguage = Object.freeze({ componentFilter: /^less;/, fileFilter: /\.less$/, process(data, file, _, options, build) { - return compileString( - data, - file, - options, - build.resolve.bind(build), - /* unsafeInlineJavaScript */ false, - ); + return compileString(data, file, options, build.resolve.bind(build)); }, }); @@ -47,7 +41,6 @@ async function compileString( filename: string, options: StylesheetPluginOptions, resolver: PluginBuild['resolve'], - unsafeInlineJavaScript: boolean, ): Promise { try { lessPreprocessor ??= (await import('less')).default; @@ -118,7 +111,6 @@ async function compileString( paths: options.includePaths, plugins: [resolverPlugin], rewriteUrls: 'all', - javascriptEnabled: unsafeInlineJavaScript, sourceMap: options.sourcemap ? { sourceMapFileInline: true, @@ -136,35 +128,6 @@ async function compileString( if (isLessException(error)) { const location = convertExceptionLocation(error); - // Retry with a warning for less files requiring the deprecated inline JavaScript option - if (error.message.includes('Inline JavaScript is not enabled.')) { - const withJsResult = await compileString( - data, - filename, - options, - resolver, - /* unsafeInlineJavaScript */ true, - ); - withJsResult.warnings = [ - { - text: 'Deprecated inline execution of JavaScript has been enabled ("javascriptEnabled")', - location, - notes: [ - { - location: null, - text: 'JavaScript found within less stylesheets may be executed at build time. [https://lesscss.org/usage/#less-options]', - }, - { - location: null, - text: 'Support for "javascriptEnabled" may be removed from the Angular CLI starting with Angular v19.', - }, - ], - }, - ]; - - return withJsResult; - } - return { errors: [ { diff --git a/packages/angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts b/packages/angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts index f618bbf6cc39..78925f35835e 100644 --- a/packages/angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts +++ b/packages/angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts @@ -9,7 +9,8 @@ import type { OnLoadResult, Plugin, PluginBuild } from 'esbuild'; import assert from 'node:assert'; import { readFile } from 'node:fs/promises'; -import { extname } from 'node:path'; +import { createRequire } from 'node:module'; +import { dirname, extname } from 'node:path'; import type { Options } from 'sass'; import { glob } from 'tinyglobby'; import { assertIsError } from '../../../utils/error'; @@ -69,7 +70,7 @@ export interface StylesheetPluginOptions { * initialized and used for every stylesheet. This overrides the tailwind integration * and any tailwind usage must be manually configured in the custom postcss usage. */ - postcssConfiguration?: PostcssConfiguration; + postcssConfiguration?: { config: PostcssConfiguration; configPath: string }; /** * Optional Options for configuring Sass behavior. @@ -215,14 +216,18 @@ export class StylesheetPluginFactory { const { options } = this; if (options.postcssConfiguration) { - const postCssInstanceKey = JSON.stringify(options.postcssConfiguration); + const { config, configPath } = options.postcssConfiguration; + const postCssInstanceKey = JSON.stringify(config); let postcssProcessor = postcssProcessors.get(postCssInstanceKey)?.deref(); if (!postcssProcessor) { postcss ??= (await import('postcss')).default; postcssProcessor = postcss(); - for (const [pluginName, pluginOptions] of options.postcssConfiguration.plugins) { - const { default: plugin } = await import(pluginName); + + const postCssPluginRequire = createRequire(dirname(configPath) + '/'); + for (const [pluginName, pluginOptions] of config.plugins) { + const pluginMod = postCssPluginRequire(pluginName); + const plugin = pluginMod.__esModule ? pluginMod['default'] : pluginMod; if (typeof plugin !== 'function' || plugin.postcss !== true) { throw new Error(`Attempted to load invalid Postcss plugin: "${pluginName}"`); } diff --git a/packages/angular/build/src/tools/sass/rebasing-importer.ts b/packages/angular/build/src/tools/sass/rebasing-importer.ts index d5ade8b6cf54..15c94a25aeef 100644 --- a/packages/angular/build/src/tools/sass/rebasing-importer.ts +++ b/packages/angular/build/src/tools/sass/rebasing-importer.ts @@ -13,6 +13,7 @@ import { basename, dirname, extname, join, relative } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import type { CanonicalizeContext, Importer, ImporterResult, Syntax } from 'sass'; import { assertIsError } from '../../utils/error'; +import { toPosixPath } from '../../utils/path'; import { findUrls } from './lexer'; /** @@ -83,7 +84,7 @@ abstract class UrlRebasingImporter implements Importer<'sync'> { // Normalize path separators and escape characters // https://developer.mozilla.org/en-US/docs/Web/CSS/url#syntax - const rebasedUrl = rebasedPath.replace(/\\/g, '/').replace(/[()\s'"]/g, '\\$&'); + const rebasedUrl = toPosixPath(rebasedPath).replace(/[()\s'"]/g, '\\$&'); updatedContents ??= new MagicString(contents); // Always quote the URL to avoid potential downstream parsing problems diff --git a/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts b/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts index 963fca654d37..f0a137f578f8 100644 --- a/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts +++ b/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts @@ -7,8 +7,12 @@ */ import { lookup as lookupMimeType } from 'mrmime'; +import { createHash } from 'node:crypto'; +import { readFileSync } from 'node:fs'; +import type { ServerResponse } from 'node:http'; import { extname } from 'node:path'; import type { Connect, ViteDevServer } from 'vite'; +import { ResultFile } from '../../../builders/application/results'; import { AngularMemoryOutputFiles, AngularOutputAssets, pathnameWithoutBasePath } from '../utils'; export interface ComponentStyleRecord { @@ -17,6 +21,9 @@ export interface ComponentStyleRecord { reload?: boolean; } +const CSS_PREPROCESSOR_REGEXP = /\.(?:s[ac]ss|less|css)$/; +const JS_TS_REGEXP = /\.[cm]?[tj]sx?$/; + export function createAngularAssetsMiddleware( server: ViteDevServer, assets: AngularOutputAssets, @@ -33,20 +40,33 @@ export function createAngularAssetsMiddleware( // The base of the URL is unused but required to parse the URL. const pathname = pathnameWithoutBasePath(req.url, server.config.base); const extension = extname(pathname); - const pathnameHasTrailingSlash = pathname[pathname.length - 1] === '/'; + const pathnameHasTrailingSlash = pathname.at(-1) === '/'; // Rewrite all build assets to a vite raw fs URL const asset = assets.get(pathname); if (asset) { - // Workaround to disable Vite transformer middleware. - // See: https://github.com/vitejs/vite/blob/746a1daab0395f98f0afbdee8f364cb6cf2f3b3f/packages/vite/src/node/server/middlewares/transform.ts#L201 and - // https://github.com/vitejs/vite/blob/746a1daab0395f98f0afbdee8f364cb6cf2f3b3f/packages/vite/src/node/server/transformRequest.ts#L204-L206 - req.headers.accept = 'text/html'; - - // The encoding needs to match what happens in the vite static middleware. - // ref: https://github.com/vitejs/vite/blob/d4f13bd81468961c8c926438e815ab6b1c82735e/packages/vite/src/node/server/middlewares/static.ts#L163 - req.url = `${server.config.base}@fs/${encodeURI(asset.source)}`; - next(); + // This is a workaround to serve CSS, JS and TS files without Vite transformations. + if (JS_TS_REGEXP.test(extension) || CSS_PREPROCESSOR_REGEXP.test(extension)) { + const contents = readFileSync(asset.source); + const etag = `W/${createHash('sha256').update(contents).digest('hex')}`; + if (checkAndHandleEtag(req, res, etag)) { + return; + } + + const mimeType = lookupMimeType(extension); + if (mimeType) { + res.setHeader('Content-Type', mimeType); + } + + res.setHeader('ETag', etag); + res.setHeader('Cache-Control', 'no-cache'); + res.end(contents); + } else { + // The encoding needs to match what happens in the vite static middleware. + // ref: https://github.com/vitejs/vite/blob/d4f13bd81468961c8c926438e815ab6b1c82735e/packages/vite/src/node/server/middlewares/static.ts#L163 + req.url = `${server.config.base}@fs/${encodeURI(asset.source)}`; + next(); + } return; } @@ -100,12 +120,8 @@ export function createAngularAssetsMiddleware( componentStyle.used.add(componentId); } - // Report if there are no changes to avoid reprocessing const etag = `W/"${outputFile.contents.byteLength}-${outputFile.hash}-${componentId}"`; - if (req.headers['if-none-match'] === etag) { - res.statusCode = 304; - res.end(); - + if (checkAndHandleEtag(req, res, etag)) { return; } @@ -134,12 +150,8 @@ export function createAngularAssetsMiddleware( } } - // Avoid resending the content if it has not changed since last request const etag = `W/"${outputFile.contents.byteLength}-${outputFile.hash}"`; - if (req.headers['if-none-match'] === etag) { - res.statusCode = 304; - res.end(); - + if (checkAndHandleEtag(req, res, etag)) { return; } @@ -188,3 +200,60 @@ export function createAngularAssetsMiddleware( next(); }; } + +function checkAndHandleEtag( + req: Connect.IncomingMessage, + res: ServerResponse, + etag: string, +): boolean { + if (req.headers['if-none-match'] === etag) { + res.statusCode = 304; + res.end(); + + return true; + } + + return false; +} + +export function createBuildAssetsMiddleware( + basePath: string, + buildResultFiles: ReadonlyMap, + readHandler: (path: string) => Buffer = readFileSync, +): Connect.NextHandleFunction { + return function buildAssetsMiddleware(req, res, next) { + if (req.url === undefined || res.writableEnded) { + return; + } + + // Parse the incoming request. + // The base of the URL is unused but required to parse the URL. + const pathname = pathnameWithoutBasePath(req.url, basePath); + const extension = extname(pathname); + if (extension && !/\.[mc]?[jt]s(?:\.map)?$/.test(extension)) { + const outputFile = buildResultFiles.get(pathname.slice(1)); + if (outputFile) { + const contents = + outputFile.origin === 'memory' ? outputFile.contents : readHandler(outputFile.inputPath); + + const etag = `W/${createHash('sha256').update(contents).digest('hex')}`; + if (checkAndHandleEtag(req, res, etag)) { + return; + } + + const mimeType = lookupMimeType(extension); + if (mimeType) { + res.setHeader('Content-Type', mimeType); + } + + res.setHeader('ETag', etag); + res.setHeader('Cache-Control', 'no-cache'); + res.end(contents); + + return; + } + } + + next(); + }; +} diff --git a/packages/angular/build/src/tools/vite/middlewares/base-middleware.ts b/packages/angular/build/src/tools/vite/middlewares/base-middleware.ts new file mode 100644 index 000000000000..00198e03061a --- /dev/null +++ b/packages/angular/build/src/tools/vite/middlewares/base-middleware.ts @@ -0,0 +1,56 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { IncomingMessage, ServerResponse } from 'node:http'; +import type { Connect } from 'vite'; +import { addLeadingSlash } from '../../../utils/url'; + +/** + * Patches the Vite base middleware to correctly handle the Angular application's base href. + * This is necessary because Vite's default base middleware might not align with Angular's + * expected path handling when using SSR, especially when a base href is configured. + * + * @param middlewares The Connect server instance containing the middleware stack. + * @param base The base URL path to be handled by the middleware. + */ +export function patchBaseMiddleware(middlewares: Connect.Server, base: string): void { + const entry = middlewares.stack.find( + ({ handle }) => typeof handle === 'function' && handle.name.startsWith('viteBaseMiddleware'), + ); + + if (typeof entry?.handle !== 'function') { + return; + } + + entry.handle = function angularBaseMiddleware( + req: IncomingMessage, + res: ServerResponse, + next: (err?: unknown) => void, + ) { + const url = req.url || '/'; + if (url.startsWith(base)) { + // Rewrite the URL to remove the base prefix before passing it to the next middleware. + // If the URL is exactly the base, it becomes '/'. + // Otherwise, we slice off the base and ensure there's a leading slash. + // See: https://github.com/vitejs/vite/blob/e81c183f8c8ccaf7774ef0d0ee125bf63dbf30b4/packages/vite/src/node/server/middlewares/base.ts#L12 + req.url = url === base ? '/' : addLeadingSlash(url.slice(base.length - 1)); + + return next(); + } + + const { pathname, hash, search } = new URL(url, 'http://localhost'); + if (pathname === '/' || pathname === '/index.html') { + res.writeHead(302, { Location: `${base}${search}${hash}` }); + res.end(); + + return; + } + + next(); + }; +} diff --git a/packages/angular/build/src/tools/vite/middlewares/host-check-middleware.ts b/packages/angular/build/src/tools/vite/middlewares/host-check-middleware.ts new file mode 100644 index 000000000000..8561354812b3 --- /dev/null +++ b/packages/angular/build/src/tools/vite/middlewares/host-check-middleware.ts @@ -0,0 +1,76 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { IncomingMessage, ServerResponse } from 'node:http'; +import type { Connect } from 'vite'; + +export function patchHostValidationMiddleware(middlewares: Connect.Server): void { + const entry = middlewares.stack.find( + ({ handle }) => + typeof handle === 'function' && handle.name.startsWith('hostValidationMiddleware'), + ); + + if (typeof entry?.handle !== 'function') { + return; + } + + const originalHandle = entry.handle as Connect.NextHandleFunction; + + entry.handle = function angularHostValidationMiddleware( + req: IncomingMessage, + res: ServerResponse, + next: (err?: unknown) => void, + ) { + originalHandle( + req, + { + writeHead: (code) => { + res.writeHead(code, { 'content-type': 'text/html' }); + }, + end: () => { + const hostname = req.headers.host?.toLowerCase().split(':')[0] ?? ''; + res.end(html403(hostname)); + }, + } as ServerResponse, + next, + ); + }; +} + +function html403(hostname: string): string { + return ` + + + + + Blocked request + + + +
+

Blocked request. This host ("${hostname}") is not allowed.

+

To allow this host, add it to allowedHosts under the serve target in angular.json.

+
{
+  "serve": {
+    "options": {
+      "allowedHosts": ["${hostname}"]
+    }
+  }
+}
+
+ + `; +} diff --git a/packages/angular/build/src/tools/vite/middlewares/index.ts b/packages/angular/build/src/tools/vite/middlewares/index.ts index ef2db01f3aaf..807e739eed59 100644 --- a/packages/angular/build/src/tools/vite/middlewares/index.ts +++ b/packages/angular/build/src/tools/vite/middlewares/index.ts @@ -16,3 +16,5 @@ export { export { createAngularHeadersMiddleware } from './headers-middleware'; export { createAngularComponentMiddleware } from './component-middleware'; export { createChromeDevtoolsMiddleware } from './chrome-devtools-middleware'; +export { patchHostValidationMiddleware } from './host-check-middleware'; +export { patchBaseMiddleware } from './base-middleware'; diff --git a/packages/angular/build/src/tools/vite/middlewares/ssr-middleware.ts b/packages/angular/build/src/tools/vite/middlewares/ssr-middleware.ts index 387a94a2ba53..4b0a8d8390f1 100644 --- a/packages/angular/build/src/tools/vite/middlewares/ssr-middleware.ts +++ b/packages/angular/build/src/tools/vite/middlewares/ssr-middleware.ts @@ -12,7 +12,6 @@ import type { } from '@angular/ssr'; import type { ServerResponse } from 'node:http'; import type { Connect, ViteDevServer } from 'vite'; -import { loadEsmModule } from '../../../utils/load-esm'; import { isSsrNodeRequestHandler, isSsrRequestHandler, @@ -36,20 +35,15 @@ export function createAngularSsrInternalMiddleware( (async () => { // Load the compiler because `@angular/ssr/node` depends on `@angular/` packages, // which must be processed by the runtime linker, even if they are not used. - await loadEsmModule('@angular/compiler'); - const { writeResponseToNodeResponse, createWebRequestFromNodeRequest } = - await loadEsmModule('@angular/ssr/node'); + await import('@angular/compiler'); + const { writeResponseToNodeResponse, createWebRequestFromNodeRequest } = (await import( + '@angular/ssr/node' as string + )) as typeof import('@angular/ssr/node', { with: { 'resolution-mode': 'import' } }); const { ɵgetOrCreateAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')) as { ɵgetOrCreateAngularServerApp: typeof getOrCreateAngularServerApp; }; - // `ɵgetOrCreateAngularServerApp` can be undefined right after an error. - // See: https://github.com/angular/angular-cli/issues/29907 - if (!ɵgetOrCreateAngularServerApp) { - return next(); - } - const angularServerApp = ɵgetOrCreateAngularServerApp({ allowStaticRouteRender: true, }); @@ -90,10 +84,11 @@ export async function createAngularSsrExternalMiddleware( // Load the compiler because `@angular/ssr/node` depends on `@angular/` packages, // which must be processed by the runtime linker, even if they are not used. - await loadEsmModule('@angular/compiler'); + await import('@angular/compiler'); - const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } = - await loadEsmModule('@angular/ssr/node'); + const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } = (await import( + '@angular/ssr/node' as string + )) as typeof import('@angular/ssr/node', { with: { 'resolution-mode': 'import' } }); return function angularSsrExternalMiddleware( req: Connect.IncomingMessage, diff --git a/packages/angular/build/src/tools/vite/plugins/angular-memory-plugin.ts b/packages/angular/build/src/tools/vite/plugins/angular-memory-plugin.ts index 32bf23cd1619..be00e3437f27 100644 --- a/packages/angular/build/src/tools/vite/plugins/angular-memory-plugin.ts +++ b/packages/angular/build/src/tools/vite/plugins/angular-memory-plugin.ts @@ -11,7 +11,6 @@ import { readFile } from 'node:fs/promises'; import { dirname, join, relative } from 'node:path'; import { fileURLToPath } from 'node:url'; import type { Plugin } from 'vite'; -import { loadEsmModule } from '../../../utils/load-esm'; import { AngularMemoryOutputFiles } from '../utils'; interface AngularMemoryPluginOptions { @@ -30,7 +29,7 @@ export async function createAngularMemoryPlugin( options: AngularMemoryPluginOptions, ): Promise { const { virtualProjectRoot, outputFiles, external } = options; - const { normalizePath } = await loadEsmModule('vite'); + const { normalizePath } = await import('vite'); return { name: 'vite:angular-memory', @@ -121,13 +120,13 @@ export async function createAngularMemoryPlugin( async function loadViteClientCode(file: string, disableViteTransport = false): Promise { const originalContents = await readFile(file, 'utf-8'); let updatedContents = originalContents.replace( - `"You can also disable this overlay by setting ", - h("code", { part: "config-option-name" }, "server.hmr.overlay"), - " to ", - h("code", { part: "config-option-value" }, "false"), - " in ", - h("code", { part: "config-file-name" }, hmrConfigName), - "."`, + '"You can also disable this overlay by setting ", ' + + 'h("code", { part: "config-option-name" }, "server.hmr.overlay"), ' + + '" to ", ' + + 'h("code", { part: "config-option-value" }, "false"), ' + + '" in ", ' + + 'h("code", { part: "config-file-name" }, hmrConfigName), ' + + '"."', '', ); diff --git a/packages/angular/build/src/tools/vite/plugins/i18n-locale-plugin.ts b/packages/angular/build/src/tools/vite/plugins/i18n-locale-plugin.ts deleted file mode 100644 index 5cf3762245a5..000000000000 --- a/packages/angular/build/src/tools/vite/plugins/i18n-locale-plugin.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import type { Plugin } from 'vite'; - -/** - * The base module location used to search for locale specific data. - */ -const LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global'; - -/** - * Creates a Vite plugin that resolves Angular locale data files from `@angular/common`. - * - * @returns A Vite plugin. - */ -export function createAngularLocaleDataPlugin(): Plugin { - return { - name: 'angular-locale-data', - enforce: 'pre', - async resolveId(source) { - if (!source.startsWith('angular:locale/data:')) { - return; - } - - // Extract the locale from the path - const originalLocale = source.split(':', 3)[2]; - - // Remove any private subtags since these will never match - let partialLocale = originalLocale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, ''); - - let exact = true; - while (partialLocale) { - const potentialPath = `${LOCALE_DATA_BASE_MODULE}/${partialLocale}`; - - const result = await this.resolve(potentialPath); - if (result) { - if (!exact) { - this.warn( - `Locale data for '${originalLocale}' cannot be found. Using locale data for '${partialLocale}'.`, - ); - } - - return result; - } - - // Remove the last subtag and try again with a less specific locale - const parts = partialLocale.split('-'); - partialLocale = parts.slice(0, -1).join('-'); - exact = false; - // The locales "en" and "en-US" are considered exact to retain existing behavior - if (originalLocale === 'en-US' && partialLocale === 'en') { - exact = true; - } - } - - return null; - }, - }; -} diff --git a/packages/angular/build/src/tools/vite/plugins/index.ts b/packages/angular/build/src/tools/vite/plugins/index.ts index 50a6ab6aa7c9..6c4cdd4496e4 100644 --- a/packages/angular/build/src/tools/vite/plugins/index.ts +++ b/packages/angular/build/src/tools/vite/plugins/index.ts @@ -7,7 +7,7 @@ */ export { createAngularMemoryPlugin } from './angular-memory-plugin'; -export { createAngularLocaleDataPlugin } from './i18n-locale-plugin'; export { createRemoveIdPrefixPlugin } from './id-prefix-plugin'; export { createAngularSetupMiddlewaresPlugin, ServerSsrMode } from './setup-middlewares-plugin'; export { createAngularSsrTransformPlugin } from './ssr-transform-plugin'; +export { createAngularServerSideSSLPlugin } from './ssr-ssl-plugin'; diff --git a/packages/angular/build/src/tools/vite/plugins/setup-middlewares-plugin.ts b/packages/angular/build/src/tools/vite/plugins/setup-middlewares-plugin.ts index 21ddaa350ac1..5d20d5c705ac 100644 --- a/packages/angular/build/src/tools/vite/plugins/setup-middlewares-plugin.ts +++ b/packages/angular/build/src/tools/vite/plugins/setup-middlewares-plugin.ts @@ -7,7 +7,6 @@ */ import type { Connect, Plugin } from 'vite'; -import { loadEsmModule } from '../../../utils/load-esm'; import { ComponentStyleRecord, angularHtmlFallbackMiddleware, @@ -18,6 +17,8 @@ import { createAngularSsrExternalMiddleware, createAngularSsrInternalMiddleware, createChromeDevtoolsMiddleware, + patchBaseMiddleware, + patchHostValidationMiddleware, } from '../middlewares'; import { AngularMemoryOutputFiles, AngularOutputAssets } from '../utils'; @@ -61,8 +62,7 @@ interface AngularSetupMiddlewaresPluginOptions { async function createEncapsulateStyle(): Promise< (style: Uint8Array, componentId: string) => string > { - const { encapsulateStyle } = - await loadEsmModule('@angular/compiler'); + const { encapsulateStyle } = await import('@angular/compiler'); const decoder = new TextDecoder('utf-8'); return (style, componentId) => { @@ -88,10 +88,12 @@ export function createAngularSetupMiddlewaresPlugin( resetComponentUpdates, } = options; + const middlewares = server.middlewares; + // Headers, assets and resources get handled first - server.middlewares.use(createAngularHeadersMiddleware(server)); - server.middlewares.use(createAngularComponentMiddleware(server, templateUpdates)); - server.middlewares.use( + middlewares.use(createAngularHeadersMiddleware(server)); + middlewares.use(createAngularComponentMiddleware(server, templateUpdates)); + middlewares.use( createAngularAssetsMiddleware( server, assets, @@ -101,30 +103,29 @@ export function createAngularSetupMiddlewaresPlugin( ), ); - server.middlewares.use( - createChromeDevtoolsMiddleware(server.config.cacheDir, options.projectRoot), - ); + middlewares.use(createChromeDevtoolsMiddleware(server.config.cacheDir, options.projectRoot)); - extensionMiddleware?.forEach((middleware) => server.middlewares.use(middleware)); + extensionMiddleware?.forEach((middleware) => middlewares.use(middleware)); // Returning a function, installs middleware after the main transform middleware but // before the built-in HTML middleware // eslint-disable-next-line @typescript-eslint/no-misused-promises return async () => { + patchHostValidationMiddleware(server.middlewares); + if (ssrMode === ServerSsrMode.ExternalSsrMiddleware) { - server.middlewares.use( - await createAngularSsrExternalMiddleware(server, indexHtmlTransformer), - ); + patchBaseMiddleware(server.middlewares, server.config.base); + middlewares.use(await createAngularSsrExternalMiddleware(server, indexHtmlTransformer)); return; } if (ssrMode === ServerSsrMode.InternalSsrMiddleware) { - server.middlewares.use(createAngularSsrInternalMiddleware(server, indexHtmlTransformer)); + middlewares.use(createAngularSsrInternalMiddleware(server, indexHtmlTransformer)); } - server.middlewares.use(angularHtmlFallbackMiddleware); - server.middlewares.use( + middlewares.use(angularHtmlFallbackMiddleware); + middlewares.use( createAngularIndexHtmlMiddleware( server, outputFiles, diff --git a/packages/angular/build/src/tools/vite/plugins/ssr-ssl-plugin.ts b/packages/angular/build/src/tools/vite/plugins/ssr-ssl-plugin.ts new file mode 100644 index 000000000000..80ddf56e739a --- /dev/null +++ b/packages/angular/build/src/tools/vite/plugins/ssr-ssl-plugin.ts @@ -0,0 +1,72 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { readFile } from 'node:fs/promises'; +import { getCACertificates, rootCertificates, setDefaultCACertificates } from 'node:tls'; +import type { Plugin } from 'vite'; + +export function createAngularServerSideSSLPlugin(): Plugin { + return { + name: 'angular-ssr-ssl-plugin', + apply: 'serve', + async configureServer({ config, httpServer }) { + const { + ssr, + server: { https }, + } = config; + + if (!ssr || !https?.cert) { + return; + } + + if (httpServer && 'ALPNProtocols' in httpServer) { + // Force Vite to use HTTP/1.1 when SSR and SSL are enabled. + // This is required because the Express server used for SSR does not support HTTP/2. + // See: https://github.com/vitejs/vite/blob/46d3077f2b63771cc50230bc907c48f5773c00fb/packages/vite/src/node/http.ts#L126 + + // We directly set the `ALPNProtocols` on the HTTP server to override the default behavior. + // Passing `ALPNProtocols` in the TLS options would cause Node.js to automatically include `h2`. + // Additionally, using `ALPNCallback` is not an option as it is mutually exclusive with `ALPNProtocols`. + // See: https://github.com/nodejs/node/blob/b8b4350ed3b73d225eb9e628d69151df56eaf298/lib/internal/http2/core.js#L3351 + httpServer.ALPNProtocols = ['http/1.1']; + } + + const { cert } = https; + const additionalCerts = Array.isArray(cert) ? cert : [cert]; + + // TODO(alanagius): Remove the `if` check once we only support Node.js 22.18.0+ and 24.5.0+. + if (getCACertificates && setDefaultCACertificates) { + const currentCerts = getCACertificates('default'); + setDefaultCACertificates([...currentCerts, ...additionalCerts]); + + return; + } + + // TODO(alanagius): Remove the below and `undici` dependency once we only support Node.js 22.18.0+ and 24.5.0+. + const { getGlobalDispatcher, setGlobalDispatcher, Agent } = await import('undici'); + const originalDispatcher = getGlobalDispatcher(); + const ca = [...rootCertificates, ...additionalCerts]; + const extraNodeCerts = process.env['NODE_EXTRA_CA_CERTS']; + if (extraNodeCerts) { + ca.push(await readFile(extraNodeCerts)); + } + + setGlobalDispatcher( + new Agent({ + connect: { + ca, + }, + }), + ); + + httpServer?.on('close', () => { + setGlobalDispatcher(originalDispatcher); + }); + }, + }; +} diff --git a/packages/angular/build/src/tools/vite/plugins/ssr-transform-plugin.ts b/packages/angular/build/src/tools/vite/plugins/ssr-transform-plugin.ts index b3af4824eb54..90d183acde02 100644 --- a/packages/angular/build/src/tools/vite/plugins/ssr-transform-plugin.ts +++ b/packages/angular/build/src/tools/vite/plugins/ssr-transform-plugin.ts @@ -7,12 +7,10 @@ */ import remapping, { SourceMapInput } from '@ampproject/remapping'; -import type { SourceDescription } from 'rollup'; import type { Plugin } from 'vite'; -import { loadEsmModule } from '../../../utils/load-esm'; export async function createAngularSsrTransformPlugin(workspaceRoot: string): Promise { - const { normalizePath } = await loadEsmModule('vite'); + const { normalizePath } = await import('vite'); return { name: 'vite:angular-ssr-transform', @@ -28,7 +26,8 @@ export async function createAngularSsrTransformPlugin(workspaceRoot: string): Pr return { code, - map: remappedMap as SourceDescription['map'], + // eslint-disable-next-line @typescript-eslint/no-explicit-any + map: remappedMap as any, }; }, }; diff --git a/packages/angular/build/src/tools/vite/utils.ts b/packages/angular/build/src/tools/vite/utils.ts index 2b39235dc212..2f7cfba84306 100644 --- a/packages/angular/build/src/tools/vite/utils.ts +++ b/packages/angular/build/src/tools/vite/utils.ts @@ -7,9 +7,10 @@ */ import { lookup as lookupMimeType } from 'mrmime'; -import { isBuiltin } from 'node:module'; +import { builtinModules, isBuiltin } from 'node:module'; import { extname } from 'node:path'; import type { DepOptimizationConfig } from 'vite'; +import type { ExternalResultMetadata } from '../esbuild/bundler-execution-result'; import { JavaScriptTransformer } from '../esbuild/javascript-transformer'; import { getFeatureSupport } from '../esbuild/utils'; @@ -110,3 +111,61 @@ export function getDepOptimizationConfig({ }, }; } + +export interface DevServerExternalResultMetadata { + implicitBrowser: string[]; + implicitServer: string[]; + explicitBrowser: string[]; + explicitServer: string[]; +} + +export function isAbsoluteUrl(url: string): boolean { + try { + new URL(url); + + return true; + } catch { + return false; + } +} + +export function updateExternalMetadata( + result: { detail?: { externalMetadata?: ExternalResultMetadata } }, + externalMetadata: DevServerExternalResultMetadata, + externalDependencies: string[] | undefined, + explicitPackagesOnly: boolean = false, +): void { + if (!result.detail?.['externalMetadata']) { + return; + } + + const { implicitBrowser, implicitServer, explicit } = result.detail['externalMetadata']; + const implicitServerFiltered = implicitServer.filter((m) => !isBuiltin(m) && !isAbsoluteUrl(m)); + const implicitBrowserFiltered = implicitBrowser.filter((m) => !isAbsoluteUrl(m)); + const explicitBrowserFiltered = explicitPackagesOnly + ? explicit.filter((m) => !isAbsoluteUrl(m)) + : explicit; + + // Empty Arrays to avoid growing unlimited with every re-build. + externalMetadata.explicitBrowser.length = 0; + externalMetadata.explicitServer.length = 0; + externalMetadata.implicitServer.length = 0; + externalMetadata.implicitBrowser.length = 0; + + const externalDeps = externalDependencies ?? []; + externalMetadata.explicitBrowser.push(...explicitBrowserFiltered, ...externalDeps); + externalMetadata.explicitServer.push( + ...explicitBrowserFiltered, + ...externalDeps, + ...builtinModules, + ); + externalMetadata.implicitServer.push(...implicitServerFiltered); + externalMetadata.implicitBrowser.push(...implicitBrowserFiltered); + + // The below needs to be sorted as Vite uses these options as part of the hashing invalidation algorithm. + // See: https://github.com/vitejs/vite/blob/0873bae0cfe0f0718ad2f5743dd34a17e4ab563d/packages/vite/src/node/optimizer/index.ts#L1203-L1239 + externalMetadata.explicitBrowser.sort(); + externalMetadata.explicitServer.sort(); + externalMetadata.implicitServer.sort(); + externalMetadata.implicitBrowser.sort(); +} diff --git a/packages/angular/build/src/typings.d.ts b/packages/angular/build/src/typings.d.ts deleted file mode 100644 index 6296581de448..000000000000 --- a/packages/angular/build/src/typings.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -// The `bundled_beasties` causes issues with module mappings in Bazel, -// leading to unexpected behavior with esbuild. Specifically, the problem occurs -// when esbuild resolves to a different module or version than expected, due to -// how Bazel handles module mappings. -// -// This change aims to resolve esbuild types correctly and maintain consistency -// in the Bazel build process. - -declare module 'esbuild' { - export * from 'esbuild-wasm'; -} - -/** - * Augment the Node.js module builtin types to support the v22.8+ compile cache functions - */ -declare module 'node:module' { - function getCompileCacheDir(): string | undefined; -} diff --git a/packages/angular/build/src/utils/check-port.ts b/packages/angular/build/src/utils/check-port.ts index 58e5a0a0f854..d7c04f0b9f72 100644 --- a/packages/angular/build/src/utils/check-port.ts +++ b/packages/angular/build/src/utils/check-port.ts @@ -32,7 +32,7 @@ export async function checkPort(port: number, host: string): Promise { return; } - if (!isTTY) { + if (!isTTY()) { reject(createInUseError(port)); return; diff --git a/packages/angular/build/src/utils/environment-options.ts b/packages/angular/build/src/utils/environment-options.ts index ea06fea2d09f..80f71d56c119 100644 --- a/packages/angular/build/src/utils/environment-options.ts +++ b/packages/angular/build/src/utils/environment-options.ts @@ -8,22 +8,48 @@ import { availableParallelism } from 'node:os'; -function isDisabled(variable: string): boolean { - return variable === '0' || variable.toLowerCase() === 'false'; -} +/** A set of strings that are considered "truthy" when parsing environment variables. */ +const TRUTHY_VALUES = new Set(['1', 'true']); -function isEnabled(variable: string): boolean { - return variable === '1' || variable.toLowerCase() === 'true'; -} +/** A set of strings that are considered "falsy" when parsing environment variables. */ +const FALSY_VALUES = new Set(['0', 'false']); +/** + * Checks if an environment variable is present and has a non-empty value. + * @param variable The environment variable to check. + * @returns `true` if the variable is a non-empty string. + */ function isPresent(variable: string | undefined): variable is string { return typeof variable === 'string' && variable !== ''; } +/** + * Parses an environment variable into a boolean or undefined. + * @returns `true` if the variable is truthy ('1', 'true'). + * @returns `false` if the variable is falsy ('0', 'false'). + * @returns `undefined` if the variable is not present or has an unknown value. + */ +function parseTristate(variable: string | undefined): boolean | undefined { + if (!isPresent(variable)) { + return undefined; + } + + const value = variable.toLowerCase(); + if (TRUTHY_VALUES.has(value)) { + return true; + } + if (FALSY_VALUES.has(value)) { + return false; + } + + // TODO: Consider whether a warning is useful in this case of a malformed value + return undefined; +} + // Optimization and mangling const debugOptimizeVariable = process.env['NG_BUILD_DEBUG_OPTIMIZE']; const debugOptimize = (() => { - if (!isPresent(debugOptimizeVariable) || isDisabled(debugOptimizeVariable)) { + if (!isPresent(debugOptimizeVariable) || parseTristate(debugOptimizeVariable) === false) { return { mangle: true, minify: true, @@ -37,7 +63,7 @@ const debugOptimize = (() => { beautify: true, }; - if (isEnabled(debugOptimizeVariable)) { + if (parseTristate(debugOptimizeVariable) === true) { return debugValue; } @@ -58,12 +84,22 @@ const debugOptimize = (() => { return debugValue; })(); -const mangleVariable = process.env['NG_BUILD_MANGLE']; -export const allowMangle = isPresent(mangleVariable) - ? !isDisabled(mangleVariable) - : debugOptimize.mangle; +/** + * Allows disabling of code mangling when the `NG_BUILD_MANGLE` environment variable is set to `0` or `false`. + * This is useful for debugging build output. + */ +export const allowMangle = parseTristate(process.env['NG_BUILD_MANGLE']) ?? debugOptimize.mangle; +/** + * Allows beautification of build output when the `NG_BUILD_DEBUG_OPTIMIZE` environment variable is enabled. + * This is useful for debugging build output. + */ export const shouldBeautify = debugOptimize.beautify; + +/** + * Allows disabling of code minification when the `NG_BUILD_DEBUG_OPTIMIZE` environment variable is enabled. + * This is useful for debugging build output. + */ export const allowMinify = debugOptimize.minify; /** @@ -76,39 +112,64 @@ export const allowMinify = debugOptimize.minify; * */ const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS']; + +/** + * The maximum number of workers to use for parallel processing. + * This can be controlled by the `NG_BUILD_MAX_WORKERS` environment variable. + */ export const maxWorkers = isPresent(maxWorkersVariable) ? +maxWorkersVariable : Math.min(4, Math.max(availableParallelism() - 1, 1)); -const parallelTsVariable = process.env['NG_BUILD_PARALLEL_TS']; -export const useParallelTs = !isPresent(parallelTsVariable) || !isDisabled(parallelTsVariable); +/** + * When `NG_BUILD_PARALLEL_TS` is set to `0` or `false`, parallel TypeScript compilation is disabled. + */ +export const useParallelTs = parseTristate(process.env['NG_BUILD_PARALLEL_TS']) !== false; -const debugPerfVariable = process.env['NG_BUILD_DEBUG_PERF']; -export const debugPerformance = isPresent(debugPerfVariable) && isEnabled(debugPerfVariable); +/** + * When `NG_BUILD_DEBUG_PERF` is enabled, performance debugging information is printed. + */ +export const debugPerformance = parseTristate(process.env['NG_BUILD_DEBUG_PERF']) === true; -const watchRootVariable = process.env['NG_BUILD_WATCH_ROOT']; -export const shouldWatchRoot = isPresent(watchRootVariable) && isEnabled(watchRootVariable); +/** + * When `NG_BUILD_WATCH_ROOT` is enabled, the build will watch the root directory for changes. + */ +export const shouldWatchRoot = parseTristate(process.env['NG_BUILD_WATCH_ROOT']) === true; -const typeCheckingVariable = process.env['NG_BUILD_TYPE_CHECK']; -export const useTypeChecking = - !isPresent(typeCheckingVariable) || !isDisabled(typeCheckingVariable); +/** + * When `NG_BUILD_TYPE_CHECK` is set to `0` or `false`, type checking is disabled. + */ +export const useTypeChecking = parseTristate(process.env['NG_BUILD_TYPE_CHECK']) !== false; -const buildLogsJsonVariable = process.env['NG_BUILD_LOGS_JSON']; -export const useJSONBuildLogs = - isPresent(buildLogsJsonVariable) && isEnabled(buildLogsJsonVariable); +/** + * When `NG_BUILD_LOGS_JSON` is enabled, build logs will be output in JSON format. + */ +export const useJSONBuildLogs = parseTristate(process.env['NG_BUILD_LOGS_JSON']) === true; -const optimizeChunksVariable = process.env['NG_BUILD_OPTIMIZE_CHUNKS']; -export const shouldOptimizeChunks = - isPresent(optimizeChunksVariable) && isEnabled(optimizeChunksVariable); +/** + * When `NG_BUILD_OPTIMIZE_CHUNKS` is enabled, the build will optimize chunks. + */ +export const shouldOptimizeChunks = parseTristate(process.env['NG_BUILD_OPTIMIZE_CHUNKS']) === true; + +/** + * When `NG_HMR_CSTYLES` is enabled, component styles will be hot-reloaded. + */ +export const useComponentStyleHmr = parseTristate(process.env['NG_HMR_CSTYLES']) === true; -const hmrComponentStylesVariable = process.env['NG_HMR_CSTYLES']; -export const useComponentStyleHmr = - isPresent(hmrComponentStylesVariable) && isEnabled(hmrComponentStylesVariable); +/** + * When `NG_HMR_TEMPLATES` is set to `0` or `false`, component templates will not be hot-reloaded. + */ +export const useComponentTemplateHmr = parseTristate(process.env['NG_HMR_TEMPLATES']) !== false; + +/** + * When `NG_BUILD_PARTIAL_SSR` is enabled, a partial server-side rendering build will be performed. + */ +export const usePartialSsrBuild = parseTristate(process.env['NG_BUILD_PARTIAL_SSR']) === true; -const hmrComponentTemplateVariable = process.env['NG_HMR_TEMPLATES']; -export const useComponentTemplateHmr = - !isPresent(hmrComponentTemplateVariable) || !isDisabled(hmrComponentTemplateVariable); +const bazelBinDirectory = process.env['BAZEL_BINDIR']; +const bazelExecRoot = process.env['JS_BINARY__EXECROOT']; -const partialSsrBuildVariable = process.env['NG_BUILD_PARTIAL_SSR']; -export const usePartialSsrBuild = - isPresent(partialSsrBuildVariable) && isEnabled(partialSsrBuildVariable); +export const bazelEsbuildPluginPath = + bazelBinDirectory && bazelExecRoot + ? process.env['NG_INTERNAL_ESBUILD_PLUGINS_DO_NOT_USE'] + : undefined; diff --git a/packages/angular/build/src/utils/i18n-options.ts b/packages/angular/build/src/utils/i18n-options.ts index 53e5aca4d540..822683bef03d 100644 --- a/packages/angular/build/src/utils/i18n-options.ts +++ b/packages/angular/build/src/utils/i18n-options.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { DiagnosticHandlingStrategy } from '@angular/localize/tools'; import path from 'node:path'; import type { TranslationLoader } from './load-translations'; @@ -29,7 +28,6 @@ export interface I18nOptions { flatOutput?: boolean; readonly shouldInline: boolean; hasDefinedSourceLocale?: boolean; - i18nDuplicateTranslation?: DiagnosticHandlingStrategy; } function normalizeTranslationFileOption( diff --git a/packages/angular/build/src/utils/index-file/augment-index-html.ts b/packages/angular/build/src/utils/index-file/augment-index-html.ts index 7a30770fa450..21ba39b39cc4 100644 --- a/packages/angular/build/src/utils/index-file/augment-index-html.ts +++ b/packages/angular/build/src/utils/index-file/augment-index-html.ts @@ -8,7 +8,6 @@ import { createHash } from 'node:crypto'; import { extname } from 'node:path'; -import { loadEsmModule } from '../load-esm'; import { htmlRewritingStream } from './html-rewriting-stream'; import { VALID_SELF_CLOSING_TAGS } from './valid-self-closing-tags'; @@ -352,12 +351,7 @@ async function getLanguageDirection( async function getLanguageDirectionFromLocales(locale: string): Promise { try { - const localeData = ( - await loadEsmModule( - `@angular/common/locales/${locale}`, - ) - ).default; - + const localeData = (await import(`@angular/common/locales/${locale}`)).default; const dir = localeData[localeData.length - 2]; return isString(dir) ? dir : undefined; diff --git a/packages/angular/build/src/utils/index-file/augment-index-html_spec.ts b/packages/angular/build/src/utils/index-file/augment-index-html_spec.ts index 7ea16ab6121b..55adf8d88f0b 100644 --- a/packages/angular/build/src/utils/index-file/augment-index-html_spec.ts +++ b/packages/angular/build/src/utils/index-file/augment-index-html_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { tags } from '@angular-devkit/core'; import { AugmentIndexHtmlOptions, augmentIndexHtml } from './augment-index-html'; describe('augment-index-html', () => { @@ -25,7 +24,7 @@ describe('augment-index-html', () => { }; const oneLineHtml = (html: TemplateStringsArray) => - tags.stripIndents`${html}`.replace(/(>\s+)/g, '>'); + `${html}`.replace(/(>\s+)/g, '>').replace(/\s+ { const { content } = await augmentIndexHtml({ diff --git a/packages/angular/build/src/utils/index-file/html-rewriting-stream.ts b/packages/angular/build/src/utils/index-file/html-rewriting-stream.ts index dbeeadcb2fc1..baf494be033c 100644 --- a/packages/angular/build/src/utils/index-file/html-rewriting-stream.ts +++ b/packages/angular/build/src/utils/index-file/html-rewriting-stream.ts @@ -9,7 +9,6 @@ import { Readable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; import type { RewritingStream } from 'parse5-html-rewriting-stream'; -import { loadEsmModule } from '../load-esm'; // Export helper types for the rewriter export type StartTag = Parameters[0]; @@ -20,9 +19,7 @@ export async function htmlRewritingStream(content: string): Promise<{ rewriter: RewritingStream; transformedContent: () => Promise; }> { - const { RewritingStream } = await loadEsmModule( - 'parse5-html-rewriting-stream', - ); + const { RewritingStream } = await import('parse5-html-rewriting-stream'); const rewriter = new RewritingStream(); return { diff --git a/packages/angular/build/src/utils/index-file/inline-fonts.ts b/packages/angular/build/src/utils/index-file/inline-fonts.ts index c89b5240c593..8f70139a77a4 100644 --- a/packages/angular/build/src/utils/index-file/inline-fonts.ts +++ b/packages/angular/build/src/utils/index-file/inline-fonts.ts @@ -9,7 +9,7 @@ import { HttpsProxyAgent } from 'https-proxy-agent'; import { createHash } from 'node:crypto'; import { readFile, rm, writeFile } from 'node:fs/promises'; -import * as https from 'node:https'; +import { get as httpsGet } from 'node:https'; import { join } from 'node:path'; import { NormalizedCachedOptions } from '../normalize-cache'; import { htmlRewritingStream } from './html-rewriting-stream'; @@ -194,56 +194,48 @@ export class InlineFontsProcessor { } catch {} } - let agent: HttpsProxyAgent | undefined; const httpsProxy = process.env.HTTPS_PROXY ?? process.env.https_proxy; - - if (httpsProxy) { - agent = new HttpsProxyAgent(httpsProxy); - } - const data = await new Promise((resolve, reject) => { let rawResponse = ''; - https - .get( - url, - { - agent, - headers: { - /** - * Always use a Windows UA. This is because Google fonts will including hinting in fonts for Windows. - * Hinting is a technique used with Windows files to improve appearance however - * results in 20-50% larger file sizes. - * - * @see http://google3/java/com/google/fonts/css/OpenSansWebFontsCssBuilder.java?l=22 - * @see https://fonts.google.com/knowledge/glossary/hinting (short) - * @see https://glyphsapp.com/learn/hinting-manual-truetype-hinting (deep dive) - */ - 'user-agent': - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', - }, + httpsGet( + url, + { + agent: httpsProxy ? new HttpsProxyAgent(httpsProxy) : undefined, + headers: { + /** + * Always use a Windows UA. This is because Google fonts will including hinting in fonts for Windows. + * Hinting is a technique used with Windows files to improve appearance however + * results in 20-50% larger file sizes. + * + * @see http://google3/java/com/google/fonts/css/OpenSansWebFontsCssBuilder.java?l=22 + * @see https://fonts.google.com/knowledge/glossary/hinting (short) + * @see https://glyphsapp.com/learn/hinting-manual-truetype-hinting (deep dive) + */ + 'user-agent': + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', }, - (res) => { - if (res.statusCode !== 200) { - reject( - new Error( - `Inlining of fonts failed. ${url} returned status code: ${res.statusCode}.`, - ), - ); - - return; - } - - res.on('data', (chunk) => (rawResponse += chunk)).on('end', () => resolve(rawResponse)); - }, - ) - .on('error', (e) => - reject( - new Error( - `Inlining of fonts failed. An error has occurred while retrieving ${url} over the internet.\n` + - e.message, - ), + }, + (res) => { + if (res.statusCode !== 200) { + reject( + new Error( + `Inlining of fonts failed. ${url} returned status code: ${res.statusCode}.`, + ), + ); + + return; + } + + res.on('data', (chunk) => (rawResponse += chunk)).on('end', () => resolve(rawResponse)); + }, + ).on('error', (e) => + reject( + new Error( + `Inlining of fonts failed. An error has occurred while retrieving ${url} over the internet.\n` + + e.message, ), - ); + ), + ); }); if (cacheFile) { diff --git a/packages/angular/build/src/utils/load-proxy-config.ts b/packages/angular/build/src/utils/load-proxy-config.ts index b0882187d0c2..cf4cb9e3c03e 100644 --- a/packages/angular/build/src/utils/load-proxy-config.ts +++ b/packages/angular/build/src/utils/load-proxy-config.ts @@ -49,35 +49,24 @@ export async function loadProxyConfiguration( break; } - case '.mjs': - // Load the ESM configuration file using the TypeScript dynamic import workaround. - // Once TypeScript provides support for keeping the dynamic import this workaround can be - // changed to a direct dynamic import. - proxyConfiguration = (await loadEsmModule<{ default: unknown }>(pathToFileURL(proxyPath))) - .default; - break; - case '.cjs': - proxyConfiguration = require(proxyPath); - break; - default: - // The file could be either CommonJS or ESM. - // CommonJS is tried first then ESM if loading fails. + default: { try { - proxyConfiguration = require(proxyPath); - break; + proxyConfiguration = await import(proxyPath); } catch (e) { assertIsError(e); - if (e.code === 'ERR_REQUIRE_ESM') { - // Load the ESM configuration file using the TypeScript dynamic import workaround. - // Once TypeScript provides support for keeping the dynamic import this workaround can be - // changed to a direct dynamic import. - proxyConfiguration = (await loadEsmModule<{ default: unknown }>(pathToFileURL(proxyPath))) - .default; - break; + if (e.code !== 'ERR_REQUIRE_ASYNC_MODULE') { + throw e; } - throw e; + proxyConfiguration = await loadEsmModule<{ default: unknown }>(pathToFileURL(proxyPath)); } + + break; + } + } + + if ('default' in proxyConfiguration) { + proxyConfiguration = proxyConfiguration.default; } return normalizeProxyConfiguration(proxyConfiguration); diff --git a/packages/angular/build/src/utils/load-translations.ts b/packages/angular/build/src/utils/load-translations.ts index eeac280cbf9b..e202273dc73d 100644 --- a/packages/angular/build/src/utils/load-translations.ts +++ b/packages/angular/build/src/utils/load-translations.ts @@ -9,7 +9,6 @@ import type { Diagnostics } from '@angular/localize/tools'; import { createHash } from 'node:crypto'; import * as fs from 'node:fs'; -import { loadEsmModule } from './load-esm'; export type TranslationLoader = (path: string) => { translations: Record; @@ -62,7 +61,7 @@ async function importParsers() { Xliff1TranslationParser, Xliff2TranslationParser, XtbTranslationParser, - } = await loadEsmModule('@angular/localize/tools'); + } = await import('@angular/localize/tools'); const diagnostics = new Diagnostics(); const parsers = { diff --git a/packages/angular/build/src/utils/path.ts b/packages/angular/build/src/utils/path.ts new file mode 100644 index 000000000000..036dcb23502e --- /dev/null +++ b/packages/angular/build/src/utils/path.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { posix } from 'node:path'; +import { platform } from 'node:process'; + +const WINDOWS_PATH_SEPERATOR_REGEXP = /\\/g; + +/** + * Converts a Windows-style file path to a POSIX-compliant path. + * + * This function replaces all backslashes (`\`) with forward slashes (`/`). + * It is a no-op on POSIX systems (e.g., Linux, macOS), as the conversion + * only runs on Windows (`win32`). + * + * @param path - The file path to convert. + * @returns The POSIX-compliant file path. + * + * @example + * ```ts + * // On a Windows system: + * toPosixPath('C:\\Users\\Test\\file.txt'); + * // => 'C:/Users/Test/file.txt' + * + * // On a POSIX system (Linux/macOS): + * toPosixPath('/home/user/file.txt'); + * // => '/home/user/file.txt' + * ``` + */ +export function toPosixPath(path: string): string { + return platform === 'win32' ? path.replace(WINDOWS_PATH_SEPERATOR_REGEXP, posix.sep) : path; +} diff --git a/packages/angular/build/src/utils/postcss-configuration.ts b/packages/angular/build/src/utils/postcss-configuration.ts index 1861f9f2b1db..6f3f1f3671f9 100644 --- a/packages/angular/build/src/utils/postcss-configuration.ts +++ b/packages/angular/build/src/utils/postcss-configuration.ts @@ -71,9 +71,13 @@ async function readPostcssConfiguration( return config; } -export async function loadPostcssConfiguration( - searchDirectories: SearchDirectory[], -): Promise { +export async function loadPostcssConfiguration(searchDirectories: SearchDirectory[]): Promise< + | { + configPath: string; + config: PostcssConfiguration; + } + | undefined +> { const configPath = findFile(searchDirectories, postcssConfigurationFiles); if (!configPath) { return undefined; @@ -101,7 +105,7 @@ export async function loadPostcssConfiguration( } } - return config; + return { config, configPath }; } // Normalize plugin object map form @@ -119,5 +123,5 @@ export async function loadPostcssConfiguration( config.plugins.push([name, options]); } - return config; + return { config, configPath }; } diff --git a/packages/angular/build/src/utils/project-metadata.ts b/packages/angular/build/src/utils/project-metadata.ts index bc997652fef1..31912d5e9905 100644 --- a/packages/angular/build/src/utils/project-metadata.ts +++ b/packages/angular/build/src/utils/project-metadata.ts @@ -15,7 +15,7 @@ import { join } from 'node:path'; * @returns A normalized path string. */ export function normalizeDirectoryPath(path: string): string { - const last = path[path.length - 1]; + const last = path.at(-1); if (last === '/' || last === '\\') { return path.slice(0, -1); } diff --git a/packages/angular/build/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.ts b/packages/angular/build/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.ts index 9e1a657366a0..1d0d9df32d30 100644 --- a/packages/angular/build/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.ts +++ b/packages/angular/build/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.ts @@ -8,9 +8,9 @@ import assert from 'node:assert'; import { randomUUID } from 'node:crypto'; +import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -import { JavaScriptTransformer } from '../../../tools/esbuild/javascript-transformer'; /** * @note For some unknown reason, setting `globalThis.ngServerMode = true` does not work when using ESM loader hooks. @@ -32,14 +32,6 @@ export interface ESMInMemoryFileLoaderWorkerData { let memoryVirtualRootUrl: string; let outputFiles: Record; -const javascriptTransformer = new JavaScriptTransformer( - // Always enable JIT linking to support applications built with and without AOT. - // In a development environment the additional scope information does not - // have a negative effect unlike production where final output size is relevant. - { sourcemap: true, jit: true }, - 1, -); - export function initialize(data: ESMInMemoryFileLoaderWorkerData) { // This path does not actually exist but is used to overlay the in memory files with the // actual filesystem for resolution purposes. @@ -137,7 +129,7 @@ export async function load(url: string, context: { format?: string | null }, nex // need linking are ESM only. if (format === 'module' && isFileProtocol(url)) { const filePath = fileURLToPath(url); - let source = await javascriptTransformer.transformFile(filePath); + let source = await readFile(filePath); if (filePath.includes('@angular/')) { // Prepend 'var ngServerMode=true;' to the source. @@ -158,11 +150,3 @@ export async function load(url: string, context: { format?: string | null }, nex function isFileProtocol(url: string): boolean { return url.startsWith('file://'); } - -function handleProcessExit(): void { - void javascriptTransformer.close(); -} - -process.once('exit', handleProcessExit); -process.once('SIGINT', handleProcessExit); -process.once('uncaughtException', handleProcessExit); diff --git a/packages/angular/build/src/utils/server-rendering/launch-server.ts b/packages/angular/build/src/utils/server-rendering/launch-server.ts index cfb15b0d979b..95b2784c6f63 100644 --- a/packages/angular/build/src/utils/server-rendering/launch-server.ts +++ b/packages/angular/build/src/utils/server-rendering/launch-server.ts @@ -8,7 +8,6 @@ import assert from 'node:assert'; import { createServer } from 'node:http'; -import { loadEsmModule } from '../load-esm'; import { loadEsmModuleFromMemory } from './load-esm-from-memory'; import { isSsrNodeRequestHandler, isSsrRequestHandler } from './utils'; @@ -21,8 +20,9 @@ export const DEFAULT_URL = new URL('http://ng-localhost/'); */ export async function launchServer(): Promise { const { reqHandler } = await loadEsmModuleFromMemory('./server.mjs'); - const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } = - await loadEsmModule('@angular/ssr/node'); + const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } = (await import( + '@angular/ssr/node' as string + )) as typeof import('@angular/ssr/node', { with: { 'resolution-mode': 'import' } }); if (!isSsrNodeRequestHandler(reqHandler) && !isSsrRequestHandler(reqHandler)) { return DEFAULT_URL; diff --git a/packages/angular/build/src/utils/server-rendering/load-esm-from-memory.ts b/packages/angular/build/src/utils/server-rendering/load-esm-from-memory.ts index 1d19a07e61de..87ca9928a86f 100644 --- a/packages/angular/build/src/utils/server-rendering/load-esm-from-memory.ts +++ b/packages/angular/build/src/utils/server-rendering/load-esm-from-memory.ts @@ -7,6 +7,7 @@ */ import type { ApplicationRef, Type } from '@angular/core'; +import type { BootstrapContext } from '@angular/platform-browser'; import type { ɵextractRoutesAndCreateRouteTree, ɵgetOrCreateAngularServerApp } from '@angular/ssr'; import { assertIsError } from '../error'; import { loadEsmModule } from '../load-esm'; @@ -15,7 +16,7 @@ import { loadEsmModule } from '../load-esm'; * Represents the exports available from the main server bundle. */ interface MainServerBundleExports { - default: (() => Promise) | Type; + default: ((context: BootstrapContext) => Promise) | Type; ɵextractRoutesAndCreateRouteTree: typeof ɵextractRoutesAndCreateRouteTree; ɵgetOrCreateAngularServerApp: typeof ɵgetOrCreateAngularServerApp; } diff --git a/packages/angular/build/src/utils/server-rendering/manifest.ts b/packages/angular/build/src/utils/server-rendering/manifest.ts index 4d1459e221c2..b01bff38b58f 100644 --- a/packages/angular/build/src/utils/server-rendering/manifest.ts +++ b/packages/angular/build/src/utils/server-rendering/manifest.ts @@ -77,7 +77,7 @@ export function generateAngularServerAppEngineManifest( // Remove trailing slash but retain leading slash. let basePath = baseHref || '/'; - if (basePath.length > 1 && basePath[basePath.length - 1] === '/') { + if (basePath.length > 1 && basePath.at(-1) === '/') { basePath = basePath.slice(0, -1); } @@ -201,34 +201,22 @@ function generateLazyLoadedFilesMappings( metafile: Metafile, initialFiles: Set, publicPath = '', -): Record { - const entryPointToBundles: Record = {}; +): Record { + const entryPointToBundles: Record = {}; for (const [fileName, { entryPoint, exports, imports }] of Object.entries(metafile.outputs)) { // Skip files that don't have an entryPoint, no exports, or are not .js if (!entryPoint || exports?.length < 1 || !fileName.endsWith('.js')) { continue; } - const importedPaths: FilesMapping[] = [ - { - path: `${publicPath}${fileName}`, - dynamicImport: false, - }, - ]; + const importedPaths: string[] = [`${publicPath}${fileName}`]; for (const { kind, external, path } of imports) { - if ( - external || - initialFiles.has(path) || - (kind !== 'dynamic-import' && kind !== 'import-statement') - ) { + if (external || initialFiles.has(path) || kind !== 'import-statement') { continue; } - importedPaths.push({ - path: `${publicPath}${path}`, - dynamicImport: kind === 'dynamic-import', - }); + importedPaths.push(`${publicPath}${path}`); } entryPointToBundles[entryPoint] = importedPaths; diff --git a/packages/angular/build/src/utils/server-rendering/prerender.ts b/packages/angular/build/src/utils/server-rendering/prerender.ts index a8a42c7c941a..f33f851f10c4 100644 --- a/packages/angular/build/src/utils/server-rendering/prerender.ts +++ b/packages/angular/build/src/utils/server-rendering/prerender.ts @@ -13,7 +13,8 @@ import { OutputMode } from '../../builders/application/schema'; import { BuildOutputFile, BuildOutputFileType } from '../../tools/esbuild/bundler-context'; import { BuildOutputAsset } from '../../tools/esbuild/bundler-execution-result'; import { assertIsError } from '../error'; -import { urlJoin } from '../url'; +import { toPosixPath } from '../path'; +import { addLeadingSlash, addTrailingSlash, joinUrlParts, stripLeadingSlash } from '../url'; import { WorkerPool } from '../worker-pool'; import { IMPORT_EXEC_ARGV } from './esm-in-memory-loader/utils'; import { SERVER_APP_MANIFEST_FILENAME } from './manifest'; @@ -25,6 +26,7 @@ import { WritableSerializableRouteTreeNode, } from './models'; import type { RenderWorkerData } from './render-worker'; +import { generateRedirectStaticPage } from './utils'; type PrerenderOptions = NormalizedApplicationBuildOptions['prerenderOptions']; type AppShellOptions = NormalizedApplicationBuildOptions['appShellOptions']; @@ -94,7 +96,7 @@ export async function prerenderPages( const assetsReversed: Record = {}; for (const { source, destination } of assets) { - assetsReversed[addLeadingSlash(destination.replace(/\\/g, posix.sep))] = source; + assetsReversed[addLeadingSlash(toPosixPath(destination))] = source; } // Get routes to prerender @@ -238,7 +240,7 @@ async function renderPages( ? addLeadingSlash(route.slice(baseHrefPathnameWithLeadingSlash.length)) : route; - const outPath = posix.join(removeLeadingSlash(routeWithoutBaseHref), 'index.html'); + const outPath = stripLeadingSlash(posix.join(routeWithoutBaseHref, 'index.html')); if (typeof redirectTo === 'string') { output[outPath] = { content: generateRedirectStaticPage(redirectTo), appShellRoute: false }; @@ -296,7 +298,7 @@ async function getAllRoutes( let appShellRoute: string | undefined; if (appShellOptions) { - appShellRoute = urlJoin(baseHref, appShellOptions.route); + appShellRoute = joinUrlParts(baseHref, appShellOptions.route); routes.push({ renderMode: RouteRenderMode.Prerender, @@ -309,7 +311,7 @@ async function getAllRoutes( for (const route of routesFromFile) { routes.push({ renderMode: RouteRenderMode.Prerender, - route: urlJoin(baseHref, route.trim()), + route: joinUrlParts(baseHref, route.trim()), }); } } @@ -367,40 +369,3 @@ async function getAllRoutes( void renderWorker.destroy(); } } - -function addLeadingSlash(value: string): string { - return value[0] === '/' ? value : '/' + value; -} - -function addTrailingSlash(url: string): string { - return url[url.length - 1] === '/' ? url : `${url}/`; -} - -function removeLeadingSlash(value: string): string { - return value[0] === '/' ? value.slice(1) : value; -} - -/** - * Generates a static HTML page with a meta refresh tag to redirect the user to a specified URL. - * - * This function creates a simple HTML page that performs a redirect using a meta tag. - * It includes a fallback link in case the meta-refresh doesn't work. - * - * @param url - The URL to which the page should redirect. - * @returns The HTML content of the static redirect page. - */ -function generateRedirectStaticPage(url: string): string { - return ` - - - - - Redirecting - - - -
Redirecting to ${url}
- - -`.trim(); -} diff --git a/packages/angular/build/src/utils/server-rendering/render-worker.ts b/packages/angular/build/src/utils/server-rendering/render-worker.ts index 92fad35df32a..7ded0550b826 100644 --- a/packages/angular/build/src/utils/server-rendering/render-worker.ts +++ b/packages/angular/build/src/utils/server-rendering/render-worker.ts @@ -12,6 +12,7 @@ import type { ESMInMemoryFileLoaderWorkerData } from './esm-in-memory-loader/loa import { patchFetchToLoadInMemoryAssets } from './fetch-patch'; import { DEFAULT_URL, launchServer } from './launch-server'; import { loadEsmModuleFromMemory } from './load-esm-from-memory'; +import { generateRedirectStaticPage } from './utils'; export interface RenderWorkerData extends ESMInMemoryFileLoaderWorkerData { assetFiles: Record; @@ -48,10 +49,20 @@ async function renderPage({ url }: RenderOptions): Promise { new Request(new URL(url, serverURL), { signal: AbortSignal.timeout(30_000) }), ); - return response ? response.text() : null; + if (!response) { + return null; + } + + const location = response.headers.get('Location'); + + return location ? generateRedirectStaticPage(location) : response.text(); } async function initialize() { + // Load the compiler because `@angular/ssr/node` depends on `@angular/` packages, + // which must be processed by the runtime linker, even if they are not used. + await import('@angular/compiler'); + if (outputMode !== undefined && hasSsrEntry) { serverURL = await launchServer(); } diff --git a/packages/angular/build/src/utils/server-rendering/routes-extractor-worker.ts b/packages/angular/build/src/utils/server-rendering/routes-extractor-worker.ts index 1487db07e811..423a71e83ba5 100644 --- a/packages/angular/build/src/utils/server-rendering/routes-extractor-worker.ts +++ b/packages/angular/build/src/utils/server-rendering/routes-extractor-worker.ts @@ -28,6 +28,10 @@ const { outputMode, hasSsrEntry } = workerData as { /** Renders an application based on a provided options. */ async function extractRoutes(): Promise { + // Load the compiler because `@angular/ssr/node` depends on `@angular/` packages, + // which must be processed by the runtime linker, even if they are not used. + await import('@angular/compiler'); + const serverURL = outputMode !== undefined && hasSsrEntry ? await launchServer() : DEFAULT_URL; patchFetchToLoadInMemoryAssets(serverURL); diff --git a/packages/angular/build/src/utils/server-rendering/utils.ts b/packages/angular/build/src/utils/server-rendering/utils.ts index 83c90187178b..c740d4de06c4 100644 --- a/packages/angular/build/src/utils/server-rendering/utils.ts +++ b/packages/angular/build/src/utils/server-rendering/utils.ts @@ -7,7 +7,7 @@ */ import type { createRequestHandler } from '@angular/ssr'; -import type { createNodeRequestHandler } from '@angular/ssr/node'; +import type { createNodeRequestHandler } from '@angular/ssr/node' with { 'resolution-mode': 'import' }; export function isSsrNodeRequestHandler( value: unknown, @@ -19,3 +19,28 @@ export function isSsrRequestHandler( ): value is ReturnType { return typeof value === 'function' && '__ng_request_handler__' in value; } + +/** + * Generates a static HTML page with a meta refresh tag to redirect the user to a specified URL. + * + * This function creates a simple HTML page that performs a redirect using a meta tag. + * It includes a fallback link in case the meta-refresh doesn't work. + * + * @param url - The URL to which the page should redirect. + * @returns The HTML content of the static redirect page. + */ +export function generateRedirectStaticPage(url: string): string { + return ` + + + + + Redirecting + + + +
Redirecting to ${url}
+ + +`.trim(); +} diff --git a/packages/angular/build/src/utils/service-worker.ts b/packages/angular/build/src/utils/service-worker.ts index f9d5c14d27fd..1535684f635c 100644 --- a/packages/angular/build/src/utils/service-worker.ts +++ b/packages/angular/build/src/utils/service-worker.ts @@ -6,14 +6,17 @@ * found in the LICENSE file at https://angular.dev/license */ -import type { Config, Filesystem } from '@angular/service-worker/config'; +import type { + Config, + Filesystem, +} from '@angular/service-worker/config' with { 'resolution-mode': 'import' }; import * as crypto from 'node:crypto'; -import { existsSync, constants as fsConstants, promises as fsPromises } from 'node:fs'; +import { existsSync, promises as fsPromises } from 'node:fs'; import * as path from 'node:path'; import { BuildOutputFile, BuildOutputFileType } from '../tools/esbuild/bundler-context'; import { BuildOutputAsset } from '../tools/esbuild/bundler-execution-result'; import { assertIsError } from './error'; -import { loadEsmModule } from './load-esm'; +import { toPosixPath } from './path'; class CliFilesystem implements Filesystem { constructor( @@ -52,7 +55,7 @@ class CliFilesystem implements Filesystem { if (stats.isFile()) { // Uses posix paths since the service worker expects URLs - items.push('/' + path.relative(this.base, entryPath).replace(/\\/g, '/')); + items.push('/' + toPosixPath(path.relative(this.base, entryPath))); } else if (stats.isDirectory()) { subdirectories.push(entryPath); } @@ -75,11 +78,11 @@ class ResultFilesystem implements Filesystem { ) { for (const file of outputFiles) { if (file.type === BuildOutputFileType.Media || file.type === BuildOutputFileType.Browser) { - this.fileReaders.set('/' + file.path.replace(/\\/g, '/'), async () => file.contents); + this.fileReaders.set('/' + toPosixPath(file.path), async () => file.contents); } } for (const file of assetFiles) { - this.fileReaders.set('/' + file.destination.replace(/\\/g, '/'), () => + this.fileReaders.set('/' + toPosixPath(file.destination), () => fsPromises.readFile(file.source), ); } @@ -215,17 +218,14 @@ export async function augmentAppWithServiceWorkerCore( serviceWorkerFilesystem: Filesystem, baseHref: string, ): Promise<{ manifest: string; assetFiles: { source: string; destination: string }[] }> { - // Load ESM `@angular/service-worker/config` using the TypeScript dynamic import workaround. - // Once TypeScript provides support for keeping the dynamic import this workaround can be - // changed to a direct dynamic import. - const GeneratorConstructor = ( - await loadEsmModule( - '@angular/service-worker/config', - ) - ).Generator; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const { Generator } = (await import('@angular/service-worker/config' as any)) as typeof import( + '@angular/service-worker/config', + { with: { 'resolution-mode': 'import' } } + ); // Generate the manifest - const generator = new GeneratorConstructor(serviceWorkerFilesystem, baseHref); + const generator = new Generator(serviceWorkerFilesystem, baseHref); const output = await generator.process(config); // Write the manifest diff --git a/packages/angular/build/src/utils/supported-browsers.ts b/packages/angular/build/src/utils/supported-browsers.ts index a8546a039082..d871d75789d3 100644 --- a/packages/angular/build/src/utils/supported-browsers.ts +++ b/packages/angular/build/src/utils/supported-browsers.ts @@ -8,14 +8,15 @@ import browserslist from 'browserslist'; +// The below is replaced by bazel `npm_package`. +const BASELINE_DATE = 'BASELINE-DATE-PLACEHOLDER'; + export function getSupportedBrowsers( projectRoot: string, logger: { warn(message: string): void }, ): string[] { // Read the browserslist configuration containing Angular's browser support policy. - const angularBrowserslist = browserslist(undefined, { - path: require.resolve('../../.browserslistrc'), - }); + const angularBrowserslist = browserslist(`baseline widely available on ${getBaselineDate()}`); // Use Angular's configuration as the default. browserslist.defaults = angularBrowserslist; @@ -60,3 +61,8 @@ export function getSupportedBrowsers( return Array.from(browsersFromConfigOrDefault); } + +function getBaselineDate(): string { + // Unlike `npm_package`, `ts_project` which is used to run unit tests does not support substitutions. + return BASELINE_DATE[0] === 'B' ? '2025-01-01' : BASELINE_DATE; +} diff --git a/packages/angular/build/src/utils/test-files.ts b/packages/angular/build/src/utils/test-files.ts new file mode 100644 index 000000000000..522bb1e778c0 --- /dev/null +++ b/packages/angular/build/src/utils/test-files.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import * as fs from 'node:fs/promises'; +import path from 'node:path'; +import { ResultFile } from '../builders/application/results'; +import { BuildOutputFileType } from '../tools/esbuild/bundler-context'; +import { emitFilesToDisk } from '../tools/esbuild/utils'; + +/** + * Writes a collection of build result files to a specified directory. + * This function handles both in-memory and on-disk files, creating subdirectories + * as needed. + * + * @param files A map of file paths to `ResultFile` objects, representing the build output. + * @param testDir The absolute path to the directory where the files should be written. + */ +export async function writeTestFiles( + files: Record, + testDir: string, +): Promise { + const directoryExists = new Set(); + // Writes the test related output files to disk and ensures the containing directories are present + await emitFilesToDisk(Object.entries(files), async ([filePath, file]) => { + if (file.type !== BuildOutputFileType.Browser && file.type !== BuildOutputFileType.Media) { + return; + } + + const fullFilePath = path.join(testDir, filePath); + + // Ensure output subdirectories exist + const fileBasePath = path.dirname(fullFilePath); + if (fileBasePath && !directoryExists.has(fileBasePath)) { + await fs.mkdir(fileBasePath, { recursive: true }); + directoryExists.add(fileBasePath); + } + + if (file.origin === 'memory') { + // Write file contents + await fs.writeFile(fullFilePath, file.contents); + } else { + // Copy file contents + await fs.copyFile(file.inputPath, fullFilePath, fs.constants.COPYFILE_FICLONE); + } + }); +} diff --git a/packages/angular/build/src/utils/url.ts b/packages/angular/build/src/utils/url.ts index d3f1e5791276..689eac37eab5 100644 --- a/packages/angular/build/src/utils/url.ts +++ b/packages/angular/build/src/utils/url.ts @@ -6,11 +6,117 @@ * found in the LICENSE file at https://angular.dev/license */ -export function urlJoin(...parts: string[]): string { - const [p, ...rest] = parts; +/** + * Removes the trailing slash from a URL if it exists. + * + * @param url - The URL string from which to remove the trailing slash. + * @returns The URL string without a trailing slash. + * + * @example + * ```js + * stripTrailingSlash('path/'); // 'path' + * stripTrailingSlash('/path'); // '/path' + * stripTrailingSlash('/'); // '/' + * stripTrailingSlash(''); // '' + * ``` + */ +export function stripTrailingSlash(url: string): string { + // Check if the last character of the URL is a slash + return url.length > 1 && url.at(-1) === '/' ? url.slice(0, -1) : url; +} + +/** + * Removes the leading slash from a URL if it exists. + * + * @param url - The URL string from which to remove the leading slash. + * @returns The URL string without a leading slash. + * + * @example + * ```js + * stripLeadingSlash('/path'); // 'path' + * stripLeadingSlash('/path/'); // 'path/' + * stripLeadingSlash('/'); // '/' + * stripLeadingSlash(''); // '' + * ``` + */ +export function stripLeadingSlash(url: string): string { + // Check if the first character of the URL is a slash + return url.length > 1 && url[0] === '/' ? url.slice(1) : url; +} + +/** + * Adds a leading slash to a URL if it does not already have one. + * + * @param url - The URL string to which the leading slash will be added. + * @returns The URL string with a leading slash. + * + * @example + * ```js + * addLeadingSlash('path'); // '/path' + * addLeadingSlash('/path'); // '/path' + * ``` + */ +export function addLeadingSlash(url: string): string { + // Check if the URL already starts with a slash + return url[0] === '/' ? url : `/${url}`; +} + +/** + * Adds a trailing slash to a URL if it does not already have one. + * + * @param url - The URL string to which the trailing slash will be added. + * @returns The URL string with a trailing slash. + * + * @example + * ```js + * addTrailingSlash('path'); // 'path/' + * addTrailingSlash('path/'); // 'path/' + * ``` + */ +export function addTrailingSlash(url: string): string { + // Check if the URL already end with a slash + return url.at(-1) === '/' ? url : `${url}/`; +} + +/** + * Joins URL parts into a single URL string. + * + * This function takes multiple URL segments, normalizes them by removing leading + * and trailing slashes where appropriate, and then joins them into a single URL. + * + * @param parts - The parts of the URL to join. Each part can be a string with or without slashes. + * @returns The joined URL string, with normalized slashes. + * + * @example + * ```js + * joinUrlParts('path/', '/to/resource'); // '/path/to/resource' + * joinUrlParts('/path/', 'to/resource'); // '/path/to/resource' + * joinUrlParts('http://localhost/path/', 'to/resource'); // 'http://localhost/path/to/resource' + * joinUrlParts('', ''); // '/' + * ``` + */ +export function joinUrlParts(...parts: string[]): string { + const normalizeParts: string[] = []; + for (const part of parts) { + if (part === '') { + // Skip any empty parts + continue; + } + + let normalizedPart = part; + if (part[0] === '/') { + normalizedPart = normalizedPart.slice(1); + } + if (part.at(-1) === '/') { + normalizedPart = normalizedPart.slice(0, -1); + } + if (normalizedPart !== '') { + normalizeParts.push(normalizedPart); + } + } + + const protocolMatch = normalizeParts.length && /^https?:\/\//.test(normalizeParts[0]); + const joinedParts = normalizeParts.join('/'); - // Remove trailing slash from first part - // Join all parts with `/` - // Dedupe double slashes from path names - return p.replace(/\/$/, '') + ('/' + rest.join('/')).replace(/\/\/+/g, '/'); + return protocolMatch ? joinedParts : addLeadingSlash(joinedParts); } diff --git a/packages/angular/build/src/utils/worker-pool.ts b/packages/angular/build/src/utils/worker-pool.ts index 3a4b3def27cb..78db4302ef1a 100644 --- a/packages/angular/build/src/utils/worker-pool.ts +++ b/packages/angular/build/src/utils/worker-pool.ts @@ -15,7 +15,7 @@ export class WorkerPool extends Piscina { constructor(options: WorkerPoolOptions) { const piscinaOptions: WorkerPoolOptions = { minThreads: 1, - idleTimeout: 1000, + idleTimeout: 4_000, // Web containers do not support transferable objects with receiveOnMessagePort which // is used when the Atomics based wait loop is enable. atomics: process.versions.webcontainer ? 'disabled' : 'sync', diff --git a/packages/angular/cli/BUILD.bazel b/packages/angular/cli/BUILD.bazel index efa8d5f601f0..abed616cd810 100644 --- a/packages/angular/cli/BUILD.bazel +++ b/packages/angular/cli/BUILD.bazel @@ -4,7 +4,7 @@ # found in the LICENSE file at https://angular.dev/license load("@npm//:defs.bzl", "npm_link_all_packages") -load("//tools:defaults.bzl", "jasmine_test", "npm_package", "ts_project") +load("//tools:defaults.bzl", "jasmine_test", "ng_examples_db", "npm_package", "ts_project") load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema") load("//tools:ts_json_schema.bzl", "ts_json_schema") @@ -14,6 +14,17 @@ package(default_visibility = ["//visibility:public"]) npm_link_all_packages() +genrule( + name = "angular_best_practices", + srcs = [ + "//:node_modules/@angular/core/dir", + ], + outs = ["src/commands/mcp/resources/best-practices.md"], + cmd = """ + cp "$(location //:node_modules/@angular/core/dir)/resources/best-practices.md" $@ + """, +) + RUNTIME_ASSETS = glob( include = [ "bin/**/*", @@ -25,6 +36,8 @@ RUNTIME_ASSETS = glob( ], ) + [ "//packages/angular/cli:lib/config/schema.json", + "//packages/angular/cli:lib/code-examples.db", + ":angular_best_practices", ] ts_project( @@ -36,6 +49,7 @@ ts_project( ], exclude = [ "**/*_spec.ts", + "**/testing/**", ], ) + [ # These files are generated from the JSON schema @@ -49,14 +63,18 @@ ts_project( ":node_modules/@angular-devkit/schematics", ":node_modules/@inquirer/prompts", ":node_modules/@listr2/prompt-adapter-inquirer", + ":node_modules/@modelcontextprotocol/sdk", ":node_modules/@yarnpkg/lockfile", + ":node_modules/algoliasearch", ":node_modules/ini", ":node_modules/jsonc-parser", + ":node_modules/listr2", ":node_modules/npm-package-arg", - ":node_modules/npm-pick-manifest", ":node_modules/pacote", + ":node_modules/parse5-html-rewriting-stream", ":node_modules/resolve", ":node_modules/yargs", + ":node_modules/zod", "//:node_modules/@angular/core", "//:node_modules/@types/ini", "//:node_modules/@types/node", @@ -66,11 +84,22 @@ ts_project( "//:node_modules/@types/semver", "//:node_modules/@types/yargs", "//:node_modules/@types/yarnpkg__lockfile", - "//:node_modules/listr2", "//:node_modules/semver", + "//:node_modules/typescript", ], ) +ng_examples_db( + name = "cli_example_database", + srcs = glob( + include = [ + "lib/examples/**/*.md", + ], + ), + out = "lib/code-examples.db", + path = "packages/angular/cli/lib/examples", +) + CLI_SCHEMA_DATA = [ "//packages/angular/build:schemas", "//packages/angular_devkit/build_angular:schemas", @@ -99,7 +128,10 @@ ts_project( name = "angular-cli_test_lib", testonly = True, srcs = glob( - include = ["**/*_spec.ts"], + include = [ + "**/*_spec.ts", + "**/testing/**", + ], exclude = [ # NB: we need to exclude the nested node_modules that is laid out by yarn workspaces "node_modules/**", @@ -109,15 +141,17 @@ ts_project( ":angular-cli", ":node_modules/@angular-devkit/core", ":node_modules/@angular-devkit/schematics", + ":node_modules/@modelcontextprotocol/sdk", ":node_modules/yargs", "//:node_modules/@types/semver", "//:node_modules/@types/yargs", "//:node_modules/semver", + "//:node_modules/typescript", ], ) jasmine_test( - name = "angular-cli_test", + name = "test", data = [":angular-cli_test_lib"], ) diff --git a/packages/angular/cli/bin/bootstrap.js b/packages/angular/cli/bin/bootstrap.js index 1282f906aef2..18d1ed73160c 100644 --- a/packages/angular/cli/bin/bootstrap.js +++ b/packages/angular/cli/bin/bootstrap.js @@ -19,9 +19,9 @@ */ // Enable on-disk code caching if available (Node.js 22.8+) -// Skip if running inside Bazel via a RUNFILES environment variable check. The cache does not work -// well with Bazel's hermeticity requirements. -if (!process.env['RUNFILES']) { +// Skip if running inside Bazel via a RUNFILES environment variable check and no explicit cache +// location defined. The default cache location does not work well with Bazel's hermeticity requirements. +if (!process.env['RUNFILES'] || process.env['NODE_COMPILE_CACHE']) { try { const { enableCompileCache } = require('node:module'); diff --git a/packages/angular/cli/bin/ng.js b/packages/angular/cli/bin/ng.js index 392578c684cb..e0f5eb36a2ef 100755 --- a/packages/angular/cli/bin/ng.js +++ b/packages/angular/cli/bin/ng.js @@ -31,7 +31,6 @@ try { } const rawCommandName = process.argv[2]; - if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completion') { // Skip Node.js supported checks when running ng completion. // A warning at this stage could cause a broken source action (`source <(ng completion script)`) when in the shell init script. @@ -43,8 +42,9 @@ if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completi // This node version check ensures that extremely old versions of node are not used. // These may not support ES2015 features such as const/let/async/await/etc. // These would then crash with a hard to diagnose error message. -var version = process.versions.node.split('.').map((part) => Number(part)); -if (version[0] % 2 === 1) { +const [major, minor] = process.versions.node.split('.', 2).map((part) => Number(part)); + +if (major % 2 === 1) { // Allow new odd numbered releases with a warning (currently v17+) console.warn( 'Node.js version ' + @@ -55,13 +55,13 @@ if (version[0] % 2 === 1) { ); require('./bootstrap'); -} else if (version[0] < 20 || (version[0] === 20 && version[1] < 11)) { - // Error and exit if less than 20.11 +} else if (major < 20 || (major === 20 && minor < 19) || (major === 22 && minor < 12)) { + // Error and exit if less than 20.19 or 22.12 console.error( 'Node.js version ' + process.version + ' detected.\n' + - 'The Angular CLI requires a minimum Node.js version of v20.11.\n\n' + + 'The Angular CLI requires a minimum Node.js version of v20.19 or v22.12.\n\n' + 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n', ); diff --git a/packages/angular/cli/lib/cli/index.ts b/packages/angular/cli/lib/cli/index.ts index a2566853dfc7..ac7591e43630 100644 --- a/packages/angular/cli/lib/cli/index.ts +++ b/packages/angular/cli/lib/cli/index.ts @@ -16,7 +16,7 @@ import { writeErrorToLogFile } from '../../src/utilities/log-file'; export { VERSION } from '../../src/utilities/version'; -const MIN_NODEJS_VERSION = [20, 11] as const; +const MIN_NODEJS_VERSION = [20, 19] as const; /* eslint-disable no-console */ export default async function (options: { cliArgs: string[] }) { diff --git a/packages/angular/cli/lib/config/workspace-schema.json b/packages/angular/cli/lib/config/workspace-schema.json index 0c551dc4fb14..3fede1746559 100644 --- a/packages/angular/cli/lib/config/workspace-schema.json +++ b/packages/angular/cli/lib/config/workspace-schema.json @@ -47,7 +47,7 @@ "packageManager": { "description": "Specify which package manager tool to use.", "type": "string", - "enum": ["npm", "cnpm", "yarn", "pnpm", "bun"] + "enum": ["npm", "yarn", "pnpm", "bun"] }, "warnings": { "description": "Control CLI specific console warnings", @@ -101,7 +101,7 @@ "packageManager": { "description": "Specify which package manager tool to use.", "type": "string", - "enum": ["npm", "cnpm", "yarn", "pnpm", "bun"] + "enum": ["npm", "yarn", "pnpm", "bun"] }, "warnings": { "description": "Control CLI specific console warnings", diff --git a/packages/angular/cli/lib/examples/if-block.md b/packages/angular/cli/lib/examples/if-block.md new file mode 100644 index 000000000000..806e3d05516c --- /dev/null +++ b/packages/angular/cli/lib/examples/if-block.md @@ -0,0 +1,85 @@ +--- +title: 'Using the @if Built-in Control Flow Block' +summary: 'Demonstrates how to use the @if built-in control flow block to conditionally render content in an Angular template based on a boolean expression.' +keywords: + - '@if' + - 'control flow' + - 'conditional rendering' + - 'template syntax' +related_concepts: + - '@else' + - '@else if' + - 'signals' +related_tools: + - 'modernize' +--- + +## Purpose + +The purpose of this pattern is to create dynamic user interfaces by controlling which elements are rendered to the DOM based on the application's state. This is a fundamental technique for building responsive and interactive components. + +## When to Use + +Use the `@if` block as the modern, preferred alternative to the `*ngIf` directive for all conditional rendering. It offers better type-checking and a cleaner, more intuitive syntax within the template. + +## Key Concepts + +- **`@if` block:** The primary syntax for conditional rendering in modern Angular templates. It evaluates a boolean expression and renders the content within its block if the expression is true. + +## Example Files + +### `conditional-content.component.ts` + +This is a self-contained standalone component that demonstrates the `@if` block with an optional `@else` block. + +```typescript +import { Component, signal } from '@angular/core'; + +@Component({ + selector: 'app-conditional-content', + template: ` + + + @if (isVisible()) { +
This content is conditionally displayed.
+ } @else { +
The content is hidden. Click the button to show it.
+ } + `, +}) +export class ConditionalContentComponent { + protected readonly isVisible = signal(true); + + toggleVisibility(): void { + this.isVisible.update((v) => !v); + } +} +``` + +## Usage Notes + +- The expression inside the `@if ()` block must evaluate to a boolean. +- This example uses a signal, which is a common pattern, but any boolean property or method call from the component can be used. +- The `@else` block is optional and is rendered when the `@if` condition is `false`. + +## How to Use This Example + +### 1. Import the Component + +In a standalone architecture, import the component into the `imports` array of the parent component where you want to use it. + +```typescript +// in app.component.ts +import { Component } from '@angular/core'; +import { ConditionalContentComponent } from './conditional-content.component'; + +@Component({ + selector: 'app-root', + imports: [ConditionalContentComponent], + template: ` +

My Application

+ + `, +}) +export class AppComponent {} +``` diff --git a/packages/angular/cli/package.json b/packages/angular/cli/package.json index abee2e8b2a96..1fb8b671f261 100644 --- a/packages/angular/cli/package.json +++ b/packages/angular/cli/package.json @@ -25,19 +25,22 @@ "@angular-devkit/architect": "workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER", "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER", "@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER", - "@inquirer/prompts": "7.5.0", - "@listr2/prompt-adapter-inquirer": "2.0.22", + "@inquirer/prompts": "7.10.1", + "@listr2/prompt-adapter-inquirer": "3.0.5", + "@modelcontextprotocol/sdk": "1.25.0", "@schematics/angular": "workspace:0.0.0-PLACEHOLDER", "@yarnpkg/lockfile": "1.1.0", - "ini": "5.0.0", + "algoliasearch": "5.46.0", + "ini": "6.0.0", "jsonc-parser": "3.3.1", - "listr2": "8.3.3", - "npm-package-arg": "12.0.2", - "npm-pick-manifest": "10.0.0", - "pacote": "20.0.0", - "resolve": "1.22.10", - "semver": "7.7.1", - "yargs": "17.7.2" + "listr2": "9.0.5", + "npm-package-arg": "13.0.2", + "pacote": "21.0.4", + "parse5-html-rewriting-stream": "8.0.0", + "resolve": "1.22.11", + "semver": "7.7.3", + "yargs": "18.0.0", + "zod": "4.2.1" }, "ng-update": { "migrations": "@schematics/angular/migrations/migration-collection.json", diff --git a/packages/angular/cli/src/command-builder/architect-base-command-module.ts b/packages/angular/cli/src/command-builder/architect-base-command-module.ts index 566e0e62b209..fb3508777d74 100644 --- a/packages/angular/cli/src/command-builder/architect-base-command-module.ts +++ b/packages/angular/cli/src/command-builder/architect-base-command-module.ts @@ -12,8 +12,7 @@ import { WorkspaceNodeModulesArchitectHost, } from '@angular-devkit/architect/node'; import { json } from '@angular-devkit/core'; -import { existsSync } from 'node:fs'; -import { resolve } from 'node:path'; +import { createRequire } from 'node:module'; import { isPackageNameSafeForAnalytics } from '../analytics/analytics'; import { EventCustomDimension, EventCustomMetric } from '../analytics/analytics-parameters'; import { assertIsError } from '../utilities/error'; @@ -210,15 +209,13 @@ export abstract class ArchitectBaseCommandModule return; } - // Check if yarn PnP is used. https://yarnpkg.com/advanced/pnpapi#processversionspnp - if (process.versions.pnp) { - return; - } + const workspaceResolve = createRequire(basePath + '/').resolve; + + try { + workspaceResolve('@angular/core'); - // Check for a `node_modules` directory (npm, yarn non-PnP, etc.) - if (existsSync(resolve(basePath, 'node_modules'))) { return; - } + } catch {} this.context.logger.warn( `Node packages may not be installed. Try installing with '${this.context.packageManager.name} install'.`, diff --git a/packages/angular/cli/src/command-builder/architect-command-module.ts b/packages/angular/cli/src/command-builder/architect-command-module.ts index 4855b629b360..98e270cf1dad 100644 --- a/packages/angular/cli/src/command-builder/architect-command-module.ts +++ b/packages/angular/cli/src/command-builder/architect-command-module.ts @@ -41,7 +41,8 @@ export abstract class ArchitectCommandModule // Add default builder if target is not in project and a command default is provided if (this.findDefaultBuilderName && this.context.workspace) { for (const [project, projectDefinition] of this.context.workspace.projects) { - if (projectDefinition.targets.has(target)) { + const targetDefinition = projectDefinition.targets.get(target); + if (targetDefinition?.builder) { continue; } @@ -49,7 +50,13 @@ export abstract class ArchitectCommandModule project, target, }); - if (defaultBuilder) { + if (!defaultBuilder) { + continue; + } + + if (targetDefinition) { + targetDefinition.builder = defaultBuilder; + } else { projectDefinition.targets.set(target, { builder: defaultBuilder, }); @@ -97,11 +104,17 @@ export abstract class ArchitectCommandModule } async run(options: Options & OtherOptions): Promise { - const target = this.getArchitectTarget(); + const originalProcessTitle = process.title; + try { + const target = this.getArchitectTarget(); + const { configuration = '', project, ...architectOptions } = options; - const { configuration = '', project, ...architectOptions } = options; + if (project) { + process.title = `${originalProcessTitle} (${project})`; + + return await this.runSingleTarget({ configuration, target, project }, architectOptions); + } - if (!project) { // This runs each target sequentially. // Running them in parallel would jumble the log messages. let result = 0; @@ -111,12 +124,13 @@ export abstract class ArchitectCommandModule } for (const project of projectNames) { + process.title = `${originalProcessTitle} (${project})`; result |= await this.runSingleTarget({ configuration, target, project }, architectOptions); } return result; - } else { - return await this.runSingleTarget({ configuration, target, project }, architectOptions); + } finally { + process.title = originalProcessTitle; } } diff --git a/packages/angular/cli/src/command-builder/command-module.ts b/packages/angular/cli/src/command-builder/command-module.ts index a97815eec027..d036656cf2dd 100644 --- a/packages/angular/cli/src/command-builder/command-module.ts +++ b/packages/angular/cli/src/command-builder/command-module.ts @@ -9,7 +9,7 @@ import { logging, schema } from '@angular-devkit/core'; import { readFileSync } from 'node:fs'; import * as path from 'node:path'; -import yargs, { +import type { ArgumentsCamelCase, Argv, CamelCaseKey, @@ -45,6 +45,7 @@ export interface CommandContext { globalConfiguration: AngularWorkspace; logger: logging.Logger; packageManager: PackageManagerUtils; + yargsInstance: Argv<{}>; /** Arguments parsed in free-from without parser configuration. */ args: { @@ -87,7 +88,10 @@ export abstract class CommandModule implements CommandModuleI protected readonly shouldReportAnalytics: boolean = true; readonly scope: CommandScope = CommandScope.Both; - private readonly optionsWithAnalytics = new Map(); + private readonly optionsWithAnalytics = new Map< + string, + EventCustomDimension | EventCustomMetric + >(); constructor(protected readonly context: CommandContext) {} @@ -234,12 +238,16 @@ export abstract class CommandModule implements CommandModuleI ]); for (const [name, ua] of this.optionsWithAnalytics) { + if (!validEventCustomDimensionAndMetrics.has(ua)) { + continue; + } + const value = options[name]; - if ( - (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') && - validEventCustomDimensionAndMetrics.has(ua as EventCustomDimension | EventCustomMetric) - ) { - parameters[ua as EventCustomDimension | EventCustomMetric] = value; + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + parameters[ua] = value; + } else if (Array.isArray(value)) { + // GA doesn't allow array as values. + parameters[ua] = value.sort().join(', '); } } @@ -248,7 +256,7 @@ export abstract class CommandModule implements CommandModuleI private reportCommandRunAnalytics(analytics: AnalyticsCollector): void { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const internalMethods = (yargs as any).getInternalMethods(); + const internalMethods = (this.context.yargsInstance as any).getInternalMethods(); // $0 generate component [name] -> generate_component // $0 add -> add const fullCommand = (internalMethods.getUsageInstance().getUsage()[0][0] as string) diff --git a/packages/angular/cli/src/command-builder/command-runner.ts b/packages/angular/cli/src/command-builder/command-runner.ts index 2ad2c07b1eeb..cb4ab2c8467e 100644 --- a/packages/angular/cli/src/command-builder/command-runner.ts +++ b/packages/angular/cli/src/command-builder/command-runner.ts @@ -8,7 +8,7 @@ import { logging } from '@angular-devkit/core'; import yargs from 'yargs'; -import { Parser } from 'yargs/helpers'; +import { Parser as yargsParser } from 'yargs/helpers'; import { CommandConfig, CommandNames, @@ -27,9 +27,7 @@ import { demandCommandFailureMessage, } from './utilities/command'; import { jsonHelpUsage } from './utilities/json-help'; -import { normalizeOptionsMiddleware } from './utilities/normalize-options-middleware'; - -const yargsParser = Parser as unknown as typeof Parser.default; +import { createNormalizeOptionsMiddleware } from './utilities/normalize-options-middleware'; export async function runCommand(args: string[], logger: logging.Logger): Promise { const { @@ -62,11 +60,14 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis } const root = workspace?.basePath ?? process.cwd(); + const localYargs = yargs(args); + const context: CommandContext = { globalConfiguration, workspace, logger, currentDirectory: process.cwd(), + yargsInstance: localYargs, root, packageManager: new PackageManagerUtils({ globalConfiguration, workspace, root }), args: { @@ -80,15 +81,14 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis }, }; - let localYargs = yargs(args); for (const CommandModule of await getCommandsToRegister(positional[0])) { - localYargs = addCommandModuleToYargs(localYargs, CommandModule, context); + addCommandModuleToYargs(CommandModule, context); } if (jsonHelp) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const usageInstance = (localYargs as any).getInternalMethods().getUsageInstance(); - usageInstance.help = () => jsonHelpUsage(); + usageInstance.help = () => jsonHelpUsage(localYargs); } // Add default command to support version option when no subcommand is specified @@ -127,7 +127,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis .epilogue('For more information, see https://angular.dev/cli/.\n') .demandCommand(1, demandCommandFailureMessage) .recommendCommands() - .middleware(normalizeOptionsMiddleware) + .middleware(createNormalizeOptionsMiddleware(localYargs)) .version(false) .showHelpOnFail(false) .strict() @@ -138,7 +138,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis : // Unknown exception, re-throw. err; }) - .wrap(yargs.terminalWidth()) + .wrap(localYargs.terminalWidth()) .parseAsync(); return +(process.exitCode ?? 0); diff --git a/packages/angular/cli/src/command-builder/schematics-command-module.ts b/packages/angular/cli/src/command-builder/schematics-command-module.ts index 738fd497382b..ef317700d1a6 100644 --- a/packages/angular/cli/src/command-builder/schematics-command-module.ts +++ b/packages/angular/cli/src/command-builder/schematics-command-module.ts @@ -204,11 +204,20 @@ export abstract class SchematicsCommandModule ? { name: item, value: item, + checked: + definition.multiselect && Array.isArray(definition.default) + ? definition.default?.includes(item) + : item === definition.default, } : { ...item, name: item.label, value: item.value, + checked: + definition.multiselect && Array.isArray(definition.default) + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + definition.default?.includes(item.value as any) + : item.value === definition.default, }, ), }); diff --git a/packages/angular/cli/src/command-builder/utilities/command.ts b/packages/angular/cli/src/command-builder/utilities/command.ts index 04a88c1f7113..8b019aba9064 100644 --- a/packages/angular/cli/src/command-builder/utilities/command.ts +++ b/packages/angular/cli/src/command-builder/utilities/command.ts @@ -20,11 +20,10 @@ export type CommandModuleConstructor = Partial & { new (context: CommandContext): Partial & CommandModule; }; -export function addCommandModuleToYargs( - localYargs: Argv, +export function addCommandModuleToYargs( commandModule: U, context: CommandContext, -): Argv { +): void { const cmd = new commandModule(context); const { args: { @@ -35,7 +34,7 @@ export function addCommandModuleToYargs; + return cmd.builder(argv) as Argv; }, handler: (args) => cmd.handler(args), }); diff --git a/packages/angular/cli/src/command-builder/utilities/json-help.ts b/packages/angular/cli/src/command-builder/utilities/json-help.ts index 6e673804ed84..0d5c6a53a1e6 100644 --- a/packages/angular/cli/src/command-builder/utilities/json-help.ts +++ b/packages/angular/cli/src/command-builder/utilities/json-help.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import yargs from 'yargs'; +import { Argv } from 'yargs'; import { FullDescribe } from '../command-module'; interface JsonHelpOption { @@ -42,9 +42,9 @@ export interface JsonHelp extends JsonHelpDescription { const yargsDefaultCommandRegExp = /^\$0|\*/; -export function jsonHelpUsage(): string { +export function jsonHelpUsage(localYargs: Argv): string { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const localYargs = yargs as any; + const localYargsInstance = localYargs as any; const { deprecatedOptions, alias: aliases, @@ -56,31 +56,33 @@ export function jsonHelpUsage(): string { demandedOptions, default: defaultVal, hiddenOptions = [], - } = localYargs.getOptions(); + } = localYargsInstance.getOptions(); - const internalMethods = localYargs.getInternalMethods(); + const internalMethods = localYargsInstance.getInternalMethods(); const usageInstance = internalMethods.getUsageInstance(); const context = internalMethods.getContext(); const descriptions = usageInstance.getDescriptions(); - const groups = localYargs.getGroups(); + const groups = localYargsInstance.getGroups(); const positional = groups[usageInstance.getPositionalGroupName()] as string[] | undefined; - + const seen = new Set(); const hidden = new Set(hiddenOptions); const normalizeOptions: JsonHelpOption[] = []; const allAliases = new Set([...Object.values(aliases).flat()]); + // Reverted order of https://github.com/yargs/yargs/blob/971e351705f0fbc5566c6ed1dfd707fa65e11c0d/lib/usage.ts#L419-L424 for (const [names, type] of [ + [number, 'number'], [array, 'array'], [string, 'string'], [boolean, 'boolean'], - [number, 'number'], ]) { for (const name of names) { - if (allAliases.has(name) || hidden.has(name)) { + if (allAliases.has(name) || hidden.has(name) || seen.has(name)) { // Ignore hidden, aliases and already visited option. continue; } + seen.add(name); const positionalIndex = positional?.indexOf(name) ?? -1; const alias = aliases[name]; @@ -124,7 +126,7 @@ export function jsonHelpUsage(): string { const output: JsonHelp = { name: [...context.commands].pop(), - command: `${command?.replace(yargsDefaultCommandRegExp, localYargs['$0'])}${defaultSubCommand}`, + command: `${command?.replace(yargsDefaultCommandRegExp, localYargsInstance['$0'])}${defaultSubCommand}`, ...parseDescription(rawDescription), options: normalizeOptions.sort((a, b) => a.name.localeCompare(b.name)), subcommands: otherSubcommands.length ? otherSubcommands : undefined, diff --git a/packages/angular/cli/src/command-builder/utilities/json-schema.ts b/packages/angular/cli/src/command-builder/utilities/json-schema.ts index a46b06646197..0a4215be8eed 100644 --- a/packages/angular/cli/src/command-builder/utilities/json-schema.ts +++ b/packages/angular/cli/src/command-builder/utilities/json-schema.ts @@ -6,13 +6,15 @@ * found in the LICENSE file at https://angular.dev/license */ -import { json, strings } from '@angular-devkit/core'; -import yargs, { Arguments, Argv, PositionalOptions, Options as YargsOptions } from 'yargs'; +import { isJsonObject, json, strings } from '@angular-devkit/core'; +import type { Arguments, Argv, PositionalOptions, Options as YargsOptions } from 'yargs'; +import { EventCustomDimension } from '../../analytics/analytics-parameters'; /** - * An option description. + * An option description that can be used by yargs to create a command. + * See: https://github.com/yargs/yargs/blob/main/docs/options.mjs */ -export interface Option extends yargs.Options { +export interface Option extends YargsOptions { /** * The name of the option. */ @@ -50,10 +52,44 @@ export interface Option extends yargs.Options { itemValueType?: 'string'; } +/** + * A Yargs check function that validates that the given options are in the form of `key=value`. + * @param keyValuePairOptions A set of options that should be in the form of `key=value`. + * @param args The parsed arguments. + * @returns `true` if the options are valid, otherwise an error is thrown. + */ +function checkStringMap(keyValuePairOptions: Set, args: Arguments): boolean { + for (const key of keyValuePairOptions) { + const value = args[key]; + if (!Array.isArray(value)) { + // Value has been parsed. + continue; + } + + for (const pair of value) { + if (pair === undefined) { + continue; + } + + if (!pair.includes('=')) { + throw new Error( + `Invalid value for argument: ${key}, Given: '${pair}', Expected key=value pair`, + ); + } + } + } + + return true; +} + +/** + * A Yargs coerce function that converts an array of `key=value` strings to an object. + * @param value An array of `key=value` strings. + * @returns An object with the keys and values from the input array. + */ function coerceToStringMap( - dashedName: string, value: (string | undefined)[], -): Record | Promise { +): Record | (string | undefined)[] { const stringMap: Record = {}; for (const pair of value) { // This happens when the flag isn't passed at all. @@ -63,23 +99,23 @@ function coerceToStringMap( const eqIdx = pair.indexOf('='); if (eqIdx === -1) { - // TODO: Remove workaround once yargs properly handles thrown errors from coerce. - // Right now these sometimes end up as uncaught exceptions instead of proper validation - // errors with usage output. - return Promise.reject( - new Error( - `Invalid value for argument: ${dashedName}, Given: '${pair}', Expected key=value pair`, - ), - ); + // In the case it is not valid skip processing this option and handle the error in `checkStringMap` + return value; } + const key = pair.slice(0, eqIdx); - const value = pair.slice(eqIdx + 1); - stringMap[key] = value; + stringMap[key] = pair.slice(eqIdx + 1); } return stringMap; } +/** + * Checks if a JSON schema node represents a string map. + * A string map is an object with `additionalProperties` of type `string`. + * @param node The JSON schema node to check. + * @returns `true` if the node represents a string map, otherwise `false`. + */ function isStringMap(node: json.JsonObject): boolean { // Exclude fields with more specific kinds of properties. if (node.properties || node.patternProperties) { @@ -94,6 +130,179 @@ function isStringMap(node: json.JsonObject): boolean { ); } +const SUPPORTED_PRIMITIVE_TYPES = new Set(['boolean', 'number', 'string']); + +/** + * Checks if a string is a supported primitive type. + * @param value The string to check. + * @returns `true` if the string is a supported primitive type, otherwise `false`. + */ +function isSupportedPrimitiveType(value: string): boolean { + return SUPPORTED_PRIMITIVE_TYPES.has(value); +} + +/** + * Recursively checks if a JSON schema for an array's items is a supported primitive type. + * It supports `oneOf` and `anyOf` keywords. + * @param schema The JSON schema for the array's items. + * @returns `true` if the schema is a supported primitive type, otherwise `false`. + */ +function isSupportedArrayItemSchema(schema: json.JsonObject): boolean { + if (typeof schema.type === 'string' && isSupportedPrimitiveType(schema.type)) { + return true; + } + + if (json.isJsonArray(schema.enum)) { + return true; + } + + if (json.isJsonArray(schema.items)) { + return schema.items.some((item) => isJsonObject(item) && isSupportedArrayItemSchema(item)); + } + + if ( + json.isJsonArray(schema.oneOf) && + schema.oneOf.some((item) => isJsonObject(item) && isSupportedArrayItemSchema(item)) + ) { + return true; + } + + if ( + json.isJsonArray(schema.anyOf) && + schema.anyOf.some((item) => isJsonObject(item) && isSupportedArrayItemSchema(item)) + ) { + return true; + } + + return false; +} + +/** + * Gets the supported types for a JSON schema node. + * @param current The JSON schema node to get the supported types for. + * @returns An array of supported types. + */ +function getSupportedTypes( + current: json.JsonObject, +): ReadonlyArray<'string' | 'number' | 'boolean' | 'array' | 'object'> { + const typeSet = json.schema.getTypesOfSchema(current); + + if (typeSet.size === 0) { + return []; + } + + return [...typeSet].filter((type) => { + switch (type) { + case 'boolean': + case 'number': + case 'string': + return true; + case 'array': + return isJsonObject(current.items) && isSupportedArrayItemSchema(current.items); + case 'object': + return isStringMap(current); + default: + return false; + } + }) as ReadonlyArray<'string' | 'number' | 'boolean' | 'array' | 'object'>; +} + +/** + * Gets the enum values for a JSON schema node. + * @param current The JSON schema node to get the enum values for. + * @returns An array of enum values. + */ +function getEnumValues( + current: json.JsonObject, +): ReadonlyArray | undefined { + if (json.isJsonArray(current.enum)) { + return current.enum.sort() as ReadonlyArray; + } + + if (isJsonObject(current.items)) { + const enumValues = getEnumValues(current.items); + if (enumValues?.length) { + return enumValues; + } + } + + if (typeof current.type === 'string' && isSupportedPrimitiveType(current.type)) { + return []; + } + + const subSchemas = + (json.isJsonArray(current.oneOf) && current.oneOf) || + (json.isJsonArray(current.anyOf) && current.anyOf); + + if (subSchemas) { + // Find the first enum. + for (const subSchema of subSchemas) { + if (isJsonObject(subSchema)) { + const enumValues = getEnumValues(subSchema); + if (enumValues) { + return enumValues; + } + } + } + } + + return []; +} + +/** + * Gets the default value for a JSON schema node. + * @param current The JSON schema node to get the default value for. + * @param type The type of the JSON schema node. + * @returns The default value, or `undefined` if there is no default value. + */ +function getDefaultValue( + current: json.JsonObject, + type: string, +): string | number | boolean | unknown[] | undefined { + const defaultValue = current.default; + if (defaultValue === undefined) { + return undefined; + } + + if (type === 'array') { + return Array.isArray(defaultValue) && defaultValue.length > 0 ? defaultValue : undefined; + } + + if (typeof defaultValue === type) { + return defaultValue as string | number | boolean; + } + + return undefined; +} + +/** + * Gets the aliases for a JSON schema node. + * @param current The JSON schema node to get the aliases for. + * @returns An array of aliases. + */ +function getAliases(current: json.JsonObject): string[] { + if (json.isJsonArray(current.aliases)) { + return [...current.aliases].map(String); + } + + if (current.alias) { + return [String(current.alias)]; + } + + return []; +} + +/** + * Parses a JSON schema to a list of options that can be used by yargs. + * + * @param registry A schema registry to use for flattening the schema. + * @param schema The JSON schema to parse. + * @param interactive Whether to prompt the user for missing options. + * @returns A list of options. + * + * @note The schema definition are not resolved at this stage. This means that `$ref` will not be resolved, + * and custom keywords like `x-prompt` will not be processed. + */ export async function parseJsonSchemaToOptions( registry: json.schema.SchemaRegistry, schema: json.JsonObject, @@ -106,149 +315,70 @@ export async function parseJsonSchemaToOptions( pointer: json.schema.JsonPointer, parentSchema?: json.JsonObject | json.JsonArray, ) { - if (!parentSchema) { - // Ignore root. - return; - } else if (pointer.split(/\/(?:properties|items|definitions)\//g).length > 2) { - // Ignore subitems (objects or arrays). - return; - } else if (json.isJsonArray(current)) { + if ( + !parentSchema || + json.isJsonArray(current) || + pointer.split(/\/(?:properties|items|definitions)\//g).length > 2 + ) { + // Ignore root, arrays, and subitems. return; } - if (pointer.indexOf('/not/') != -1) { + if (pointer.includes('/not/')) { // We don't support anyOf/not. throw new Error('The "not" keyword is not supported in JSON Schema.'); } const ptr = json.schema.parseJsonPointer(pointer); - const name = ptr[ptr.length - 1]; - - if (ptr[ptr.length - 2] != 'properties') { + if (ptr[ptr.length - 2] !== 'properties') { // Skip any non-property items. return; } + const name = ptr.at(-1) as string; - const typeSet = json.schema.getTypesOfSchema(current); - - if (typeSet.size == 0) { - throw new Error('Cannot find type of schema.'); - } - - // We only support number, string or boolean (or array of those), so remove everything else. - const types = [...typeSet].filter((x) => { - switch (x) { - case 'boolean': - case 'number': - case 'string': - return true; - - case 'array': - // Only include arrays if they're boolean, string or number. - if ( - json.isJsonObject(current.items) && - typeof current.items.type == 'string' && - ['boolean', 'number', 'string'].includes(current.items.type) - ) { - return true; - } - - return false; + const types = getSupportedTypes(current); - case 'object': - return isStringMap(current); - - default: - return false; - } - }) as ('string' | 'number' | 'boolean' | 'array' | 'object')[]; - - if (types.length == 0) { + if (types.length === 0) { // This means it's not usable on the command line. e.g. an Object. return; } - // Only keep enum values we support (booleans, numbers and strings). - const enumValues = ((json.isJsonArray(current.enum) && current.enum) || []).filter((x) => { - switch (typeof x) { - case 'boolean': - case 'number': - case 'string': - return true; - - default: - return false; - } - }) as (string | true | number)[]; - - let defaultValue: string | number | boolean | undefined = undefined; - if (current.default !== undefined) { - switch (types[0]) { - case 'string': - if (typeof current.default == 'string') { - defaultValue = current.default; - } - break; - case 'number': - if (typeof current.default == 'number') { - defaultValue = current.default; - } - break; - case 'boolean': - if (typeof current.default == 'boolean') { - defaultValue = current.default; - } - break; - } - } - + const [type] = types; const $default = current.$default; const $defaultIndex = - json.isJsonObject($default) && $default['$source'] == 'argv' ? $default['index'] : undefined; + isJsonObject($default) && $default['$source'] === 'argv' ? $default['index'] : undefined; const positional: number | undefined = - typeof $defaultIndex == 'number' ? $defaultIndex : undefined; + typeof $defaultIndex === 'number' ? $defaultIndex : undefined; - let required = json.isJsonArray(schema.required) ? schema.required.includes(name) : false; + let required = json.isJsonArray(schema.required) && schema.required.includes(name); if (required && interactive && current['x-prompt']) { required = false; } - const alias = json.isJsonArray(current.aliases) - ? [...current.aliases].map((x) => '' + x) - : current.alias - ? ['' + current.alias] - : []; - const format = typeof current.format == 'string' ? current.format : undefined; - const visible = current.visible === undefined || current.visible === true; - const hidden = !!current.hidden || !visible; - - const xUserAnalytics = current['x-user-analytics']; - const userAnalytics = typeof xUserAnalytics === 'string' ? xUserAnalytics : undefined; - - // Deprecated is set only if it's true or a string. + const visible = current.visible !== false; const xDeprecated = current['x-deprecated']; - const deprecated = - xDeprecated === true || typeof xDeprecated === 'string' ? xDeprecated : undefined; + const enumValues = getEnumValues(current); const option: Option = { name, - description: '' + (current.description === undefined ? '' : current.description), - default: defaultValue, - choices: enumValues.length ? enumValues : undefined, + description: String(current.description ?? ''), + default: getDefaultValue(current, type), + choices: enumValues?.length ? enumValues : undefined, required, - alias, - format, - hidden, - userAnalytics, - deprecated, + alias: getAliases(current), + format: typeof current.format === 'string' ? current.format : undefined, + hidden: !!current.hidden || !visible, + userAnalytics: + typeof current['x-user-analytics'] === 'string' ? current['x-user-analytics'] : undefined, + deprecated: xDeprecated === true || typeof xDeprecated === 'string' ? xDeprecated : undefined, positional, - ...(types[0] === 'object' + ...(type === 'object' ? { type: 'array', itemValueType: 'string', } : { - type: types[0], + type, }), }; @@ -280,10 +410,10 @@ export function addSchemaOptionsToCommand( localYargs: Argv, options: Option[], includeDefaultValues: boolean, -): Map { +): Map { const booleanOptionsWithNoPrefix = new Set(); const keyValuePairOptions = new Set(); - const optionsWithAnalytics = new Map(); + const optionsWithAnalytics = new Map(); for (const option of options) { const { @@ -309,7 +439,7 @@ export function addSchemaOptionsToCommand( } if (itemValueType) { - keyValuePairOptions.add(name); + keyValuePairOptions.add(dashedName); } const sharedOptions: YargsOptions & PositionalOptions = { @@ -318,7 +448,7 @@ export function addSchemaOptionsToCommand( description, deprecated, choices, - coerce: itemValueType ? coerceToStringMap.bind(null, dashedName) : undefined, + coerce: itemValueType ? coerceToStringMap : undefined, // This should only be done when `--help` is used otherwise default will override options set in angular.json. ...(includeDefaultValues ? { default: defaultVal } : {}), }; @@ -338,10 +468,15 @@ export function addSchemaOptionsToCommand( // Record option of analytics. if (userAnalytics !== undefined) { - optionsWithAnalytics.set(name, userAnalytics); + optionsWithAnalytics.set(name, userAnalytics as EventCustomDimension); } } + // Valid key/value options + if (keyValuePairOptions.size) { + localYargs.check(checkStringMap.bind(null, keyValuePairOptions), false); + } + // Handle options which have been defined in the schema with `no` prefix. if (booleanOptionsWithNoPrefix.size) { localYargs.middleware((options: Arguments) => { diff --git a/packages/angular/cli/src/command-builder/utilities/json-schema_spec.ts b/packages/angular/cli/src/command-builder/utilities/json-schema_spec.ts index 5ec5db644bef..d311373d69f0 100644 --- a/packages/angular/cli/src/command-builder/utilities/json-schema_spec.ts +++ b/packages/angular/cli/src/command-builder/utilities/json-schema_spec.ts @@ -6,88 +6,125 @@ * found in the LICENSE file at https://angular.dev/license */ -import { json, schema } from '@angular-devkit/core'; -import yargs, { positional } from 'yargs'; +import { JsonObject, schema } from '@angular-devkit/core'; +import yargs from 'yargs'; import { addSchemaOptionsToCommand, parseJsonSchemaToOptions } from './json-schema'; -const YError = (() => { - try { - const y = yargs().strict().fail(false).exitProcess(false).parse(['--forced-failure']); - } catch (e) { - if (!(e instanceof Error)) { - throw new Error('Unexpected non-Error thrown'); - } - - return e.constructor as typeof Error; - } - throw new Error('Expected parse to fail'); -})(); - -interface ParseFunction { - (argv: string[]): unknown; -} - -function withParseForSchema( - jsonSchema: json.JsonObject, - { - interactive = true, - includeDefaultValues = true, - }: { interactive?: boolean; includeDefaultValues?: boolean } = {}, -): ParseFunction { - let actualParse: ParseFunction = () => { - throw new Error('Called before init'); - }; - const parse: ParseFunction = (args) => { - return actualParse(args); - }; - - beforeEach(async () => { - const registry = new schema.CoreSchemaRegistry(); - const options = await parseJsonSchemaToOptions(registry, jsonSchema, interactive); - - actualParse = async (args: string[]) => { - // Create a fresh yargs for each call. The yargs object is stateful and - // calling .parse multiple times on the same instance isn't safe. - const localYargs = yargs().exitProcess(false).strict().fail(false); - addSchemaOptionsToCommand(localYargs, options, includeDefaultValues); - +describe('parseJsonSchemaToOptions', () => { + describe('without required fields in schema', () => { + const parse = async (args: string[]) => { // Yargs only exposes the parse errors as proper errors when using the // callback syntax. This unwraps that ugly workaround so tests can just // use simple .toThrow/.toEqual assertions. return localYargs.parseAsync(args); }; - }); - - return parse; -} -describe('parseJsonSchemaToOptions', () => { - describe('without required fields in schema', () => { - const parse = withParseForSchema({ - 'type': 'object', - 'properties': { - 'maxSize': { - 'type': 'number', - }, - 'ssr': { - 'type': 'string', - 'enum': ['always', 'surprise-me', 'never'], - }, - 'extendable': { - 'type': 'object', - 'properties': {}, - 'additionalProperties': { - 'type': 'string', + let localYargs: yargs.Argv; + beforeEach(async () => { + // Create a fresh yargs for each call. The yargs object is stateful and + // calling .parse multiple times on the same instance isn't safe. + localYargs = yargs().exitProcess(false).strict().fail(false).wrap(1_000); + const jsonSchema = { + 'type': 'object', + 'properties': { + 'maxSize': { + 'type': 'number', }, - }, - 'someDefine': { - 'type': 'object', - 'additionalProperties': { + 'ssr': { 'type': 'string', + 'enum': ['always', 'surprise-me', 'never'], + }, + 'arrayWithChoices': { + 'type': 'array', + 'default': ['default-array'], + 'items': { + 'type': 'string', + 'enum': ['always', 'never', 'default-array'], + }, + }, + 'extendable': { + 'type': 'object', + 'properties': {}, + 'additionalProperties': { + 'type': 'string', + }, + }, + 'someDefine': { + 'type': 'object', + 'additionalProperties': { + 'type': 'string', + }, + }, + 'arrayWithChoicesInOneOf': { + 'type': 'array', + 'items': { + 'oneOf': [ + { + 'enum': ['default', 'verbose'], + }, + { + 'type': 'array', + 'minItems': 1, + 'maxItems': 2, + 'items': [ + { + 'enum': ['default', 'verbose'], + }, + { + 'type': 'object', + }, + ], + }, + ], + }, + }, + 'arrayWithComplexAnyOf': { + 'type': 'array', + 'items': { + 'oneOf': [ + { + 'anyOf': [ + { + 'type': 'string', + }, + { + 'enum': ['default', 'verbose'], + }, + ], + }, + { + 'type': 'array', + 'minItems': 1, + 'maxItems': 2, + 'items': [ + { + 'anyOf': [ + { + 'type': 'string', + }, + { + 'enum': ['default', 'verbose'], + }, + ], + }, + { + 'type': 'object', + }, + ], + }, + ], + }, }, }, - }, + }; + const registry = new schema.CoreSchemaRegistry(); + const options = await parseJsonSchemaToOptions( + registry, + jsonSchema as unknown as JsonObject, + false, + ); + addSchemaOptionsToCommand(localYargs, options, true); }); describe('type=number', () => { @@ -100,6 +137,68 @@ describe('parseJsonSchemaToOptions', () => { }); }); + describe('type=array, enum', () => { + it('parses valid option value', async () => { + expect( + await parse(['--arrayWithChoices', 'always', '--arrayWithChoices', 'never']), + ).toEqual( + jasmine.objectContaining({ + 'arrayWithChoices': ['always', 'never'], + }), + ); + }); + + it('rejects non-enum values', async () => { + await expectAsync(parse(['--arrayWithChoices', 'yes'])).toBeRejectedWithError( + /Argument: array-with-choices, Given: "yes", Choices:/, + ); + }); + + it('should add default value to help', async () => { + expect(await localYargs.getHelp()).toContain('[default: ["default-array"]]'); + }); + }); + + describe('type=array, enum in oneOf', () => { + it('parses valid option value', async () => { + expect( + await parse([ + '--arrayWithChoicesInOneOf', + 'default', + '--arrayWithChoicesInOneOf', + 'verbose', + ]), + ).toEqual( + jasmine.objectContaining({ + 'arrayWithChoicesInOneOf': ['default', 'verbose'], + }), + ); + }); + + it('rejects non-enum values', async () => { + await expectAsync(parse(['--arrayWithChoicesInOneOf', 'yes'])).toBeRejectedWithError( + /Argument: array-with-choices-in-one-of, Given: "yes", Choices:/, + ); + }); + }); + + describe('type=array, anyOf', () => { + it('parses valid option value', async () => { + expect( + await parse([ + '--arrayWithComplexAnyOf', + 'default', + '--arrayWithComplexAnyOf', + 'something-else', + ]), + ).toEqual( + jasmine.objectContaining({ + 'arrayWithComplexAnyOf': ['default', 'something-else'], + }), + ); + }); + }); + describe('type=string, enum', () => { it('parses valid option value', async () => { expect(await parse(['--ssr', 'never'])).toEqual( @@ -125,11 +224,9 @@ describe('parseJsonSchemaToOptions', () => { it('rejects invalid values for string maps', async () => { await expectAsync(parse(['--some-define', 'foo'])).toBeRejectedWithError( - YError, /Invalid value for argument: some-define, Given: 'foo', Expected key=value pair/, ); await expectAsync(parse(['--some-define', '42'])).toBeRejectedWithError( - YError, /Invalid value for argument: some-define, Given: '42', Expected key=value pair/, ); }); @@ -162,43 +259,42 @@ describe('parseJsonSchemaToOptions', () => { describe('with required positional argument', () => { it('marks the required argument as required', async () => { - const jsonSchema = JSON.parse(` - { - "$id": "FakeSchema", - "title": "Fake Schema", - "type": "object", - "required": ["a"], - "properties": { - "b": { - "type": "string", - "description": "b.", - "$default": { - "$source": "argv", - "index": 1 - } + const jsonSchema = { + '$id': 'FakeSchema', + 'title': 'Fake Schema', + 'type': 'object', + 'required': ['a'], + 'properties': { + 'b': { + 'type': 'string', + 'description': 'b.', + '$default': { + '$source': 'argv', + 'index': 1, + }, }, - "a": { - "type": "string", - "description": "a.", - "$default": { - "$source": "argv", - "index": 0 - } + 'a': { + 'type': 'string', + 'description': 'a.', + '$default': { + '$source': 'argv', + 'index': 0, + }, }, - "optC": { - "type": "string", - "description": "optC" + 'optC': { + 'type': 'string', + 'description': 'optC', }, - "optA": { - "type": "string", - "description": "optA" + 'optA': { + 'type': 'string', + 'description': 'optA', + }, + 'optB': { + 'type': 'string', + 'description': 'optB', }, - "optB": { - "type": "string", - "description": "optB" - } - } - }`) as json.JsonObject; + }, + }; const registry = new schema.CoreSchemaRegistry(); const options = await parseJsonSchemaToOptions(registry, jsonSchema, /* interactive= */ true); diff --git a/packages/angular/cli/src/command-builder/utilities/normalize-options-middleware.ts b/packages/angular/cli/src/command-builder/utilities/normalize-options-middleware.ts index 709f9e5a7c67..792f09f7a97b 100644 --- a/packages/angular/cli/src/command-builder/utilities/normalize-options-middleware.ts +++ b/packages/angular/cli/src/command-builder/utilities/normalize-options-middleware.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import * as yargs from 'yargs'; +import type { Arguments, Argv } from 'yargs'; /** * A Yargs middleware that normalizes non Array options when the argument has been provided multiple times. @@ -17,21 +17,23 @@ import * as yargs from 'yargs'; * * See: https://github.com/yargs/yargs-parser/pull/163#issuecomment-516566614 */ -export function normalizeOptionsMiddleware(args: yargs.Arguments): void { - // `getOptions` is not included in the types even though it's public API. - // https://github.com/yargs/yargs/issues/2098 - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const { array } = (yargs as any).getOptions(); - const arrayOptions = new Set(array); +export function createNormalizeOptionsMiddleware(localeYargs: Argv): (args: Arguments) => void { + return (args: Arguments) => { + // `getOptions` is not included in the types even though it's public API. + // https://github.com/yargs/yargs/issues/2098 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const { array } = (localeYargs as any).getOptions(); + const arrayOptions = new Set(array); - for (const [key, value] of Object.entries(args)) { - if (key !== '_' && Array.isArray(value) && !arrayOptions.has(key)) { - const newValue = value.pop(); - // eslint-disable-next-line no-console - console.warn( - `Option '${key}' has been specified multiple times. The value '${newValue}' will be used.`, - ); - args[key] = newValue; + for (const [key, value] of Object.entries(args)) { + if (key !== '_' && Array.isArray(value) && !arrayOptions.has(key)) { + const newValue = value.pop(); + // eslint-disable-next-line no-console + console.warn( + `Option '${key}' has been specified multiple times. The value '${newValue}' will be used.`, + ); + args[key] = newValue; + } } - } + }; } diff --git a/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts b/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts index e4b805f1a367..25b723c467a2 100644 --- a/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts +++ b/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts @@ -20,7 +20,10 @@ import { assertIsError } from '../../utilities/error'; */ const schematicRedirectVariable = process.env['NG_SCHEMATIC_REDIRECT']?.toLowerCase(); -function shouldWrapSchematic(schematicFile: string, schematicEncapsulation: boolean): boolean { +function shouldWrapSchematic( + schematicFile: string, + schematicEncapsulation: boolean | undefined, +): boolean { // Check environment variable if present switch (schematicRedirectVariable) { case '0': @@ -52,12 +55,12 @@ function shouldWrapSchematic(schematicFile: string, schematicEncapsulation: bool // Check for first-party Angular schematic packages // Angular schematics are safe to use in the wrapped VM context - if (/\/node_modules\/@(?:angular|schematics|nguniversal)\//.test(normalizedSchematicFile)) { - return true; - } + const isFirstParty = /\/node_modules\/@(?:angular|schematics|nguniversal)\//.test( + normalizedSchematicFile, + ); - // Otherwise use the value of the schematic collection's encapsulation option (current default of false) - return schematicEncapsulation; + // Use value of defined option if present, otherwise default to first-party usage. + return schematicEncapsulation ?? isFirstParty; } export class SchematicEngineHost extends NodeModulesEngineHost { @@ -73,7 +76,7 @@ export class SchematicEngineHost extends NodeModulesEngineHost { const referenceRequire = createRequire(__filename); const schematicFile = referenceRequire.resolve(fullPath, { paths: [parentPath] }); - if (shouldWrapSchematic(schematicFile, !!collectionDescription?.encapsulation)) { + if (shouldWrapSchematic(schematicFile, collectionDescription?.encapsulation)) { const schematicPath = dirname(schematicFile); const moduleCache = new Map(); diff --git a/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts b/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts index f5caa0754d88..3dbcfdd25983 100644 --- a/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts +++ b/packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts @@ -38,11 +38,17 @@ export function subscribeToWorkflow( ); break; case 'update': - logs.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`); + logs.push( + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + `${colors.cyan('UPDATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + ); files.add(eventPath); break; case 'create': - logs.push(`${colors.green('CREATE')} ${eventPath} (${event.content.length} bytes)`); + logs.push( + // TODO: `as unknown` was necessary during TS 5.9 update. Figure out a long-term solution. + `${colors.green('CREATE')} ${eventPath} (${(event.content as unknown as Buffer).length} bytes)`, + ); files.add(eventPath); break; case 'delete': diff --git a/packages/angular/cli/src/commands/add/cli.ts b/packages/angular/cli/src/commands/add/cli.ts index adaf980cd4b3..0dae016fba12 100644 --- a/packages/angular/cli/src/commands/add/cli.ts +++ b/packages/angular/cli/src/commands/add/cli.ts @@ -6,15 +6,14 @@ * found in the LICENSE file at https://angular.dev/license */ -import { NodePackageDoesNotSupportSchematics } from '@angular-devkit/schematics/tools'; -import { Listr, color, figures } from 'listr2'; +import { Listr, ListrRenderer, ListrTaskWrapper, color, figures } from 'listr2'; import assert from 'node:assert'; +import fs from 'node:fs/promises'; import { createRequire } from 'node:module'; import { dirname, join } from 'node:path'; import npa from 'npm-package-arg'; -import { Range, compare, intersects, prerelease, satisfies, valid } from 'semver'; +import semver, { Range, compare, intersects, prerelease, satisfies, valid } from 'semver'; import { Argv } from 'yargs'; -import { PackageManager } from '../../../lib/config/workspace-schema'; import { CommandModuleImplementation, Options, @@ -24,13 +23,14 @@ import { SchematicsCommandArgs, SchematicsCommandModule, } from '../../command-builder/schematics-command-module'; -import { assertIsError } from '../../utilities/error'; import { NgAddSaveDependency, + PackageManager, PackageManifest, - fetchPackageManifest, - fetchPackageMetadata, -} from '../../utilities/package-metadata'; + PackageMetadata, + createPackageManager, +} from '../../package-managers'; +import { assertIsError } from '../../utilities/error'; import { isTTY } from '../../utilities/tty'; import { VERSION } from '../../utilities/version'; @@ -44,14 +44,23 @@ interface AddCommandArgs extends SchematicsCommandArgs { } interface AddCommandTaskContext { + packageManager: PackageManager; packageIdentifier: npa.Result; - usingYarn?: boolean; savePackage?: NgAddSaveDependency; collectionName?: string; executeSchematic: AddCommandModule['executeSchematic']; - hasMismatchedPeer: AddCommandModule['hasMismatchedPeer']; + getPeerDependencyConflicts: AddCommandModule['getPeerDependencyConflicts']; + dryRun?: boolean; + hasSchematics?: boolean; + homepage?: string; } +type AddCommandTaskWrapper = ListrTaskWrapper< + AddCommandTaskContext, + typeof ListrRenderer, + typeof ListrRenderer +>; + /** * The set of packages that should have certain versions excluded from consideration * when attempting to find a compatible version for a package. @@ -64,6 +73,19 @@ const packageVersionExclusions: Record = { '@angular/material': '7.x', }; +const DEFAULT_CONFLICT_DISPLAY_LIMIT = 5; + +/** + * A map of packages to built-in schematics. + * This is used for packages that do not have a native `ng-add` schematic. + */ +const BUILT_IN_SCHEMATICS = { + tailwindcss: { + collection: '@schematics/angular', + name: 'tailwind', + }, +} as const; + export default class AddCommandModule extends SchematicsCommandModule implements CommandModuleImplementation @@ -74,6 +96,7 @@ export default class AddCommandModule protected override allowPrivateSchematics = true; private readonly schematicName = 'ng-add'; private rootRequire = createRequire(this.context.root + '/'); + #projectVersionCache = new Map(); override async builder(argv: Argv): Promise> { const localYargs = (await super.builder(argv)) @@ -121,10 +144,10 @@ export default class AddCommandModule return localYargs; } - // eslint-disable-next-line max-lines-per-function async run(options: Options & OtherOptions): Promise { - const { logger, packageManager } = this.context; - const { verbose, registry, collection, skipConfirmation } = options; + this.#projectVersionCache.clear(); + const { logger } = this.context; + const { collection, skipConfirmation } = options; let packageIdentifier; try { @@ -150,222 +173,120 @@ export default class AddCommandModule } } - const taskContext: AddCommandTaskContext = { + const taskContext = { packageIdentifier, executeSchematic: this.executeSchematic.bind(this), - hasMismatchedPeer: this.hasMismatchedPeer.bind(this), - }; + getPeerDependencyConflicts: this.getPeerDependencyConflicts.bind(this), + dryRun: options.dryRun, + } as AddCommandTaskContext; + + const tasks = new Listr( + [ + { + title: 'Determining Package Manager', + task: (context, task) => this.determinePackageManagerTask(context, task), + rendererOptions: { persistentOutput: true }, + }, + { + title: 'Searching for compatible package version', + enabled: packageIdentifier.type === 'range' && packageIdentifier.rawSpec === '*', + task: (context, task) => this.findCompatiblePackageVersionTask(context, task, options), + rendererOptions: { persistentOutput: true }, + }, + { + title: 'Loading package information', + task: (context, task) => this.loadPackageInfoTask(context, task, options), + rendererOptions: { persistentOutput: true }, + }, + { + title: 'Confirming installation', + enabled: !skipConfirmation && !options.dryRun, + task: (context, task) => this.confirmInstallationTask(context, task), + rendererOptions: { persistentOutput: true }, + }, + { + title: 'Installing package', + skip: (context) => { + if (context.dryRun) { + return `Skipping package installation. Would install package ${color.blue( + context.packageIdentifier.toString(), + )}.`; + } - const tasks = new Listr([ - { - title: 'Determining Package Manager', - task(context, task) { - context.usingYarn = packageManager.name === PackageManager.Yarn; - task.output = `Using package manager: ${color.dim(packageManager.name)}`; + return false; + }, + task: (context, task) => this.installPackageTask(context, task, options), + rendererOptions: { bottomBar: Infinity }, }, - rendererOptions: { persistentOutput: true }, - }, + // TODO: Rework schematic execution as a task and insert here + ], { - title: 'Searching for compatible package version', - enabled: packageIdentifier.type === 'range' && packageIdentifier.rawSpec === '*', - async task(context, task) { - assert( - context.packageIdentifier.name, - 'Registry package identifiers should always have a name.', - ); - - // only package name provided; search for viable version - // plus special cases for packages that did not have peer deps setup - let packageMetadata; - try { - packageMetadata = await fetchPackageMetadata(context.packageIdentifier.name, logger, { - registry, - usingYarn: context.usingYarn, - verbose, - }); - } catch (e) { - assertIsError(e); - throw new CommandError( - `Unable to load package information from registry: ${e.message}`, - ); - } + /* options */ + }, + ); - // Start with the version tagged as `latest` if it exists - const latestManifest = packageMetadata.tags['latest']; - if (latestManifest) { - context.packageIdentifier = npa.resolve(latestManifest.name, latestManifest.version); - } + try { + const result = await tasks.run(taskContext); + assert(result.collectionName, 'Collection name should always be available'); - // Adjust the version based on name and peer dependencies - if ( - latestManifest?.peerDependencies && - Object.keys(latestManifest.peerDependencies).length === 0 - ) { - task.output = `Found compatible package version: ${color.blue(latestManifest.version)}.`; - } else if (!latestManifest || (await context.hasMismatchedPeer(latestManifest))) { - // 'latest' is invalid so search for most recent matching package - - // Allow prelease versions if the CLI itself is a prerelease - const allowPrereleases = prerelease(VERSION.full); - - const versionExclusions = packageVersionExclusions[packageMetadata.name]; - const versionManifests = Object.values(packageMetadata.versions).filter( - (value: PackageManifest) => { - // Prerelease versions are not stable and should not be considered by default - if (!allowPrereleases && prerelease(value.version)) { - return false; - } - // Deprecated versions should not be used or considered - if (value.deprecated) { - return false; - } - // Excluded package versions should not be considered - if ( - versionExclusions && - satisfies(value.version, versionExclusions, { includePrerelease: true }) - ) { - return false; - } - - return true; - }, - ); + // Check if the installed package has actual add actions and not just schematic support + if (result.hasSchematics && !options.dryRun) { + const workflow = this.getOrCreateWorkflowForBuilder(result.collectionName); + const collection = workflow.engine.createCollection(result.collectionName); - // Sort in reverse SemVer order so that the newest compatible version is chosen - versionManifests.sort((a, b) => compare(b.version, a.version, true)); - - let found = false; - for (const versionManifest of versionManifests) { - const mismatch = await context.hasMismatchedPeer(versionManifest); - if (mismatch) { - continue; - } - - context.packageIdentifier = npa.resolve( - versionManifest.name, - versionManifest.version, - ); - found = true; - break; - } + // listSchematicNames cannot be used here since it does not list private schematics. + // Most `ng-add` schematics are marked as private. + // TODO: Consider adding a `hasSchematic` helper to the schematic collection object. + try { + collection.createSchematic(this.schematicName, true); + } catch { + result.hasSchematics = false; + } + } - if (!found) { - task.output = "Unable to find compatible package. Using 'latest' tag."; - } else { - task.output = `Found compatible package version: ${color.blue(context.packageIdentifier.toString())}.`; - } - } else { - task.output = `Found compatible package version: ${color.blue(context.packageIdentifier.toString())}.`; - } - }, - rendererOptions: { persistentOutput: true }, - }, - { - title: 'Loading package information from registry', - async task(context, task) { - let manifest; - try { - manifest = await fetchPackageManifest(context.packageIdentifier.toString(), logger, { - registry, - verbose, - usingYarn: context.usingYarn, - }); - } catch (e) { - assertIsError(e); - throw new CommandError( - `Unable to fetch package information for '${context.packageIdentifier}': ${e.message}`, + if (!result.hasSchematics) { + // Fallback to a built-in schematic if the package does not have an `ng-add` schematic + const packageName = result.packageIdentifier.name; + if (packageName) { + const builtInSchematic = + BUILT_IN_SCHEMATICS[packageName as keyof typeof BUILT_IN_SCHEMATICS]; + if (builtInSchematic) { + logger.info( + `The ${color.blue(packageName)} package does not provide \`ng add\` actions.`, ); - } - - context.savePackage = manifest['ng-add']?.save; - context.collectionName = manifest.name; + logger.info('The Angular CLI will use built-in actions to add it to your project.'); - if (await context.hasMismatchedPeer(manifest)) { - task.output = color.yellow( - figures.warning + - ' Package has unmet peer dependencies. Adding the package may not succeed.', - ); - } - }, - rendererOptions: { persistentOutput: true }, - }, - { - title: 'Confirming installation', - enabled: !skipConfirmation, - async task(context, task) { - if (!isTTY()) { - task.output = - `'--skip-confirmation' can be used to bypass installation confirmation. ` + - `Ensure package name is correct prior to '--skip-confirmation' option usage.`; - throw new CommandError('No terminal detected'); + return this.executeSchematic({ + ...options, + collection: builtInSchematic.collection, + schematicName: builtInSchematic.name, + }); } + } - const { ListrInquirerPromptAdapter } = await import('@listr2/prompt-adapter-inquirer'); - const { confirm } = await import('@inquirer/prompts'); - const shouldProceed = await task.prompt(ListrInquirerPromptAdapter).run(confirm, { - message: - `The package ${color.blue(context.packageIdentifier.toString())} will be installed and executed.\n` + - 'Would you like to proceed?', - default: true, - theme: { prefix: '' }, - }); - - if (!shouldProceed) { - throw new CommandError('Command aborted'); - } - }, - rendererOptions: { persistentOutput: true }, - }, - { - async task(context, task) { - // Only show if installation will actually occur - task.title = 'Installing package'; - - if (context.savePackage === false) { - task.title += ' in temporary location'; - - // Temporary packages are located in a different directory - // Hence we need to resolve them using the temp path - const { success, tempNodeModules } = await packageManager.installTemp( - context.packageIdentifier.toString(), - registry ? [`--registry="${registry}"`] : undefined, - ); - const tempRequire = createRequire(tempNodeModules + '/'); - assert(context.collectionName, 'Collection name should always be available'); - const resolvedCollectionPath = tempRequire.resolve( - join(context.collectionName, 'package.json'), - ); + let message = options.dryRun + ? 'The package does not provide any `ng add` actions, so no further actions would be taken.' + : 'Package installed successfully. The package does not provide any `ng add` actions, so no further actions were taken.'; - if (!success) { - throw new CommandError('Unable to install package'); - } + if (result.homepage) { + message += `\nFor more information about this package, visit its homepage at ${result.homepage}`; + } + logger.info(message); - context.collectionName = dirname(resolvedCollectionPath); - } else { - const success = await packageManager.install( - context.packageIdentifier.toString(), - context.savePackage, - registry ? [`--registry="${registry}"`] : undefined, - undefined, - ); + return; + } - if (!success) { - throw new CommandError('Unable to install package'); - } - } - }, - rendererOptions: { bottomBar: Infinity }, - }, - // TODO: Rework schematic execution as a task and insert here - ]); + if (options.dryRun) { + logger.info("The package's `ng add` actions would be executed next."); - try { - const result = await tasks.run(taskContext); - assert(result.collectionName, 'Collection name should always be available'); + return; + } return this.executeSchematic({ ...options, collection: result.collectionName }); } catch (e) { if (e instanceof CommandError) { + logger.error(e.message); + return 1; } @@ -373,6 +294,298 @@ export default class AddCommandModule } } + private async determinePackageManagerTask( + context: AddCommandTaskContext, + task: AddCommandTaskWrapper, + ): Promise { + context.packageManager = await createPackageManager({ + cwd: this.context.root, + logger: this.context.logger, + dryRun: context.dryRun, + }); + task.output = `Using package manager: ${color.dim(context.packageManager.name)}`; + } + + private async findCompatiblePackageVersionTask( + context: AddCommandTaskContext, + task: AddCommandTaskWrapper, + options: Options, + ): Promise { + const { registry, verbose } = options; + const { packageManager, packageIdentifier } = context; + const packageName = packageIdentifier.name; + + assert(packageName, 'Registry package identifiers should always have a name.'); + + const rejectionReasons: string[] = []; + + // Attempt to use the 'latest' tag from the registry. + try { + const latestManifest = await packageManager.getManifest(`${packageName}@latest`, { + registry, + }); + + if (latestManifest) { + const conflicts = await this.getPeerDependencyConflicts(latestManifest); + if (!conflicts) { + context.packageIdentifier = npa.resolve(latestManifest.name, latestManifest.version); + task.output = `Found compatible package version: ${color.blue(latestManifest.version)}.`; + + return; + } + rejectionReasons.push(...conflicts); + } + } catch (e) { + assertIsError(e); + throw new CommandError(`Unable to load package information from registry: ${e.message}`); + } + + // 'latest' is invalid or not found, search for most recent matching package. + task.output = + 'Could not find a compatible version with `latest`. Searching for a compatible version.'; + + let packageMetadata; + try { + packageMetadata = await packageManager.getRegistryMetadata(packageName, { + registry, + }); + } catch (e) { + assertIsError(e); + throw new CommandError(`Unable to load package information from registry: ${e.message}`); + } + + if (!packageMetadata) { + throw new CommandError('Unable to load package information from registry.'); + } + + // Allow prelease versions if the CLI itself is a prerelease or locally built. + const allowPrereleases = !!prerelease(VERSION.full) || VERSION.full === '0.0.0'; + const potentialVersions = this.#getPotentialVersions(packageMetadata, allowPrereleases); + + // Heuristic-based search: Check the latest release of each major version first. + const majorVersions = this.#getMajorVersions(potentialVersions); + let found = await this.#findCompatibleVersion(context, majorVersions, { + registry, + verbose, + rejectionReasons, + }); + + // Exhaustive search: If no compatible major version is found, fall back to checking all versions. + if (!found) { + const checkedVersions = new Set(majorVersions); + const remainingVersions = potentialVersions.filter((v) => !checkedVersions.has(v)); + found = await this.#findCompatibleVersion(context, remainingVersions, { + registry, + verbose, + rejectionReasons, + }); + } + + if (!found) { + let message = `Unable to find compatible package.`; + if (rejectionReasons.length > 0) { + message += + '\nThis is often because of incompatible peer dependencies.\n' + + 'These versions were rejected due to the following conflicts:\n' + + rejectionReasons + .slice(0, verbose ? undefined : DEFAULT_CONFLICT_DISPLAY_LIMIT) + .map((r) => ` - ${r}`) + .join('\n'); + } + task.output = message; + } else { + task.output = `Found compatible package version: ${color.blue( + context.packageIdentifier.toString(), + )}.`; + } + } + + async #findCompatibleVersion( + context: AddCommandTaskContext, + versions: string[], + options: { + registry?: string; + verbose?: boolean; + rejectionReasons: string[]; + }, + ): Promise { + const { packageManager, packageIdentifier } = context; + const { registry, verbose, rejectionReasons } = options; + const packageName = packageIdentifier.name; + assert(packageName, 'Package name must be defined.'); + + for (const version of versions) { + const manifest = await packageManager.getManifest(`${packageName}@${version}`, { + registry, + }); + if (!manifest) { + continue; + } + + const conflicts = await this.getPeerDependencyConflicts(manifest); + if (conflicts) { + if (verbose || rejectionReasons.length < DEFAULT_CONFLICT_DISPLAY_LIMIT) { + rejectionReasons.push(...conflicts); + } + continue; + } + + context.packageIdentifier = npa.resolve(manifest.name, manifest.version); + + return manifest; + } + + return null; + } + + #getPotentialVersions(packageMetadata: PackageMetadata, allowPrereleases: boolean): string[] { + const versionExclusions = packageVersionExclusions[packageMetadata.name]; + const latestVersion = packageMetadata['dist-tags']['latest']; + + const versions = Object.values(packageMetadata.versions).filter((version) => { + // Latest tag has already been checked + if (latestVersion && version === latestVersion) { + return false; + } + + // Prerelease versions are not stable and should not be considered by default + if (!allowPrereleases && prerelease(version)) { + return false; + } + + // Excluded package versions should not be considered + if (versionExclusions && satisfies(version, versionExclusions, { includePrerelease: true })) { + return false; + } + + return true; + }); + + // Sort in reverse SemVer order so that the newest compatible version is chosen + return versions.sort((a, b) => compare(b, a, true)); + } + + #getMajorVersions(versions: string[]): string[] { + const majorVersions = new Map(); + for (const version of versions) { + const major = semver.major(version); + const existing = majorVersions.get(major); + if (!existing || semver.gt(version, existing)) { + majorVersions.set(major, version); + } + } + + return [...majorVersions.values()].sort((a, b) => compare(b, a, true)); + } + + private async loadPackageInfoTask( + context: AddCommandTaskContext, + task: AddCommandTaskWrapper, + options: Options, + ): Promise { + const { registry } = options; + + let manifest; + try { + manifest = await context.packageManager.getManifest(context.packageIdentifier.toString(), { + registry, + }); + } catch (e) { + assertIsError(e); + throw new CommandError( + `Unable to fetch package information for '${context.packageIdentifier}': ${e.message}`, + ); + } + + if (!manifest) { + throw new CommandError( + `Unable to fetch package information for '${context.packageIdentifier}'.`, + ); + } + + context.hasSchematics = !!manifest.schematics; + context.savePackage = manifest['ng-add']?.save; + context.collectionName = manifest.name; + context.homepage = manifest.homepage; + + if (await this.getPeerDependencyConflicts(manifest)) { + task.output = color.yellow( + figures.warning + + ' Package has unmet peer dependencies. Adding the package may not succeed.', + ); + } + } + + private async confirmInstallationTask( + context: AddCommandTaskContext, + task: AddCommandTaskWrapper, + ): Promise { + if (!isTTY()) { + task.output = + `'--skip-confirmation' can be used to bypass installation confirmation. ` + + `Ensure package name is correct prior to '--skip-confirmation' option usage.`; + throw new CommandError('No terminal detected'); + } + + const { ListrInquirerPromptAdapter } = await import('@listr2/prompt-adapter-inquirer'); + const { confirm } = await import('@inquirer/prompts'); + const shouldProceed = await task.prompt(ListrInquirerPromptAdapter).run(confirm, { + message: + `The package ${color.blue(context.packageIdentifier.toString())} will be installed and executed.\n` + + 'Would you like to proceed?', + default: true, + theme: { prefix: '' }, + }); + + if (!shouldProceed) { + throw new CommandError('Command aborted'); + } + } + + private async installPackageTask( + context: AddCommandTaskContext, + task: AddCommandTaskWrapper, + options: Options, + ): Promise { + const { registry } = options; + const { packageManager, packageIdentifier, savePackage } = context; + + // Only show if installation will actually occur + task.title = 'Installing package'; + + if (context.savePackage === false) { + task.title += ' in temporary location'; + + // Temporary packages are located in a different directory + // Hence we need to resolve them using the temp path + const { workingDirectory } = await packageManager.acquireTempPackage( + packageIdentifier.toString(), + { + registry, + }, + ); + + const tempRequire = createRequire(workingDirectory + '/'); + assert(context.collectionName, 'Collection name should always be available'); + const resolvedCollectionPath = tempRequire.resolve( + join(context.collectionName, 'package.json'), + ); + + context.collectionName = dirname(resolvedCollectionPath); + } else { + await packageManager.add( + packageIdentifier.toString(), + 'none', + savePackage !== 'dependencies', + false, + true, + { + registry, + }, + ); + } + } + private async isProjectVersionValid(packageIdentifier: npa.Result): Promise { if (!packageIdentifier.name) { return false; @@ -441,114 +654,127 @@ export default class AddCommandModule return false; } - private async executeSchematic( - options: Options & OtherOptions, + private executeSchematic( + options: Options & OtherOptions & { schematicName?: string }, ): Promise { - try { - const { - verbose, - skipConfirmation, + const { + verbose, + skipConfirmation, + interactive, + force, + dryRun, + registry, + defaults, + collection: collectionName, + schematicName, + ...schematicOptions + } = options; + + return this.runSchematic({ + schematicOptions, + schematicName: schematicName ?? this.schematicName, + collectionName, + executionOptions: { interactive, force, dryRun, - registry, defaults, - collection: collectionName, - ...schematicOptions - } = options; - - return await this.runSchematic({ - schematicOptions, - schematicName: this.schematicName, - collectionName, - executionOptions: { - interactive, - force, - dryRun, - defaults, - packageRegistry: registry, - }, - }); - } catch (e) { - if (e instanceof NodePackageDoesNotSupportSchematics) { - this.context.logger.error( - 'The package that you are trying to add does not support schematics.' + - 'You can try using a different version of the package or contact the package author to add ng-add support.', - ); - - return 1; - } - - throw e; - } + packageRegistry: registry, + }, + }); } private async findProjectVersion(name: string): Promise { - const { logger, root } = this.context; - let installedPackage; + const cachedVersion = this.#projectVersionCache.get(name); + if (cachedVersion !== undefined) { + return cachedVersion; + } + + const { root } = this.context; + let installedPackagePath; try { - installedPackage = this.rootRequire.resolve(join(name, 'package.json')); + installedPackagePath = this.rootRequire.resolve(join(name, 'package.json')); } catch {} - if (installedPackage) { + if (installedPackagePath) { try { - const installed = await fetchPackageManifest(dirname(installedPackage), logger); + const installedPackage = JSON.parse( + await fs.readFile(installedPackagePath, 'utf-8'), + ) as PackageManifest; + this.#projectVersionCache.set(name, installedPackage.version); - return installed.version; + return installedPackage.version; } catch {} } let projectManifest; try { - projectManifest = await fetchPackageManifest(root, logger); + projectManifest = JSON.parse( + await fs.readFile(join(root, 'package.json'), 'utf-8'), + ) as PackageManifest; } catch {} if (projectManifest) { const version = projectManifest.dependencies?.[name] || projectManifest.devDependencies?.[name]; if (version) { + this.#projectVersionCache.set(name, version); + return version; } } + this.#projectVersionCache.set(name, null); + return null; } - private async hasMismatchedPeer(manifest: PackageManifest): Promise { - for (const peer in manifest.peerDependencies) { + private async getPeerDependencyConflicts(manifest: PackageManifest): Promise { + if (!manifest.peerDependencies) { + return false; + } + + const checks = Object.entries(manifest.peerDependencies).map(async ([peer, range]) => { let peerIdentifier; try { - peerIdentifier = npa.resolve(peer, manifest.peerDependencies[peer]); + peerIdentifier = npa.resolve(peer, range); } catch { this.context.logger.warn(`Invalid peer dependency ${peer} found in package.`); - continue; + + return null; } - if (peerIdentifier.type === 'version' || peerIdentifier.type === 'range') { - try { - const version = await this.findProjectVersion(peer); - if (!version) { - continue; - } + if (peerIdentifier.type !== 'version' && peerIdentifier.type !== 'range') { + // type === 'tag' | 'file' | 'directory' | 'remote' | 'git' + // Cannot accurately compare these as the tag/location may have changed since install. + return null; + } - const options = { includePrerelease: true }; + try { + const version = await this.findProjectVersion(peer); + if (!version) { + return null; + } - if ( - !intersects(version, peerIdentifier.rawSpec, options) && - !satisfies(version, peerIdentifier.rawSpec, options) - ) { - return true; - } - } catch { - // Not found or invalid so ignore - continue; + const options = { includePrerelease: true }; + if ( + !intersects(version, peerIdentifier.rawSpec, options) && + !satisfies(version, peerIdentifier.rawSpec, options) + ) { + return ( + `Package "${manifest.name}@${manifest.version}" has an incompatible peer dependency to "` + + `${peer}@${peerIdentifier.rawSpec}" (requires "${version}" in project).` + ); } - } else { - // type === 'tag' | 'file' | 'directory' | 'remote' | 'git' - // Cannot accurately compare these as the tag/location may have changed since install + } catch { + // Not found or invalid so ignore } - } - return false; + return null; + }); + + const conflicts = (await Promise.all(checks)).filter((result): result is string => !!result); + + return conflicts.length > 0 && conflicts; } } diff --git a/packages/angular/cli/src/commands/analytics/cli.ts b/packages/angular/cli/src/commands/analytics/cli.ts index 56841a95bd6b..da56a2a00460 100644 --- a/packages/angular/cli/src/commands/analytics/cli.ts +++ b/packages/angular/cli/src/commands/analytics/cli.ts @@ -41,7 +41,7 @@ export default class AnalyticsCommandModule ].sort(); // sort by class name. for (const module of subcommands) { - localYargs = addCommandModuleToYargs(localYargs, module, this.context); + addCommandModuleToYargs(module, this.context); } return localYargs.demandCommand(1, demandCommandFailureMessage).strict(); diff --git a/packages/angular/cli/src/commands/cache/cli.ts b/packages/angular/cli/src/commands/cache/cli.ts index 97f3ed60f007..dad144b034b3 100644 --- a/packages/angular/cli/src/commands/cache/cli.ts +++ b/packages/angular/cli/src/commands/cache/cli.ts @@ -40,7 +40,7 @@ export default class CacheCommandModule ].sort(); for (const module of subcommands) { - localYargs = addCommandModuleToYargs(localYargs, module, this.context); + addCommandModuleToYargs(module, this.context); } return localYargs.demandCommand(1, demandCommandFailureMessage).strict(); diff --git a/packages/angular/cli/src/commands/cache/info/cli.ts b/packages/angular/cli/src/commands/cache/info/cli.ts index 447d92e02c1f..f4278d52db74 100644 --- a/packages/angular/cli/src/commands/cache/info/cli.ts +++ b/packages/angular/cli/src/commands/cache/info/cli.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { tags } from '@angular-devkit/core'; import * as fs from 'node:fs/promises'; import { join } from 'node:path'; import { Argv } from 'yargs'; @@ -15,6 +14,7 @@ import { CommandModuleImplementation, CommandScope, } from '../../../command-builder/command-module'; +import { colors } from '../../../utilities/color'; import { isCI } from '../../../utilities/environment-options'; import { getCacheConfig } from '../utilities'; @@ -29,15 +29,44 @@ export class CacheInfoCommandModule extends CommandModule implements CommandModu } async run(): Promise { - const { path, environment, enabled } = getCacheConfig(this.context.workspace); - - this.context.logger.info(tags.stripIndents` - Enabled: ${enabled ? 'yes' : 'no'} - Environment: ${environment} - Path: ${path} - Size on disk: ${await this.getSizeOfDirectory(path)} - Effective status on current machine: ${this.effectiveEnabledStatus() ? 'enabled' : 'disabled'} - `); + const cacheConfig = getCacheConfig(this.context.workspace); + const { path, environment, enabled } = cacheConfig; + + const effectiveStatus = this.effectiveEnabledStatus(cacheConfig); + const sizeOnDisk = await this.getSizeOfDirectory(path); + + const info: { label: string; value: string }[] = [ + { + label: 'Enabled', + value: enabled ? colors.green('Yes') : colors.red('No'), + }, + { + label: 'Environment', + value: colors.cyan(environment), + }, + { + label: 'Path', + value: colors.cyan(path), + }, + { + label: 'Size on disk', + value: colors.cyan(sizeOnDisk), + }, + { + label: 'Effective Status', + value: + (effectiveStatus ? colors.green('Enabled') : colors.red('Disabled')) + + ' (current machine)', + }, + ]; + + const maxLabelLength = Math.max(...info.map((l) => l.label.length)); + + const output = info + .map(({ label, value }) => colors.bold(label.padEnd(maxLabelLength + 2)) + `: ${value}`) + .join('\n'); + + this.context.logger.info(`\n${colors.bold('Cache Information')}\n\n${output}\n`); } private async getSizeOfDirectory(path: string): Promise { @@ -82,8 +111,8 @@ export class CacheInfoCommandModule extends CommandModule implements CommandModu return `${roundedSize.toFixed(fractionDigits)} ${abbreviations[index]}`; } - private effectiveEnabledStatus(): boolean { - const { enabled, environment } = getCacheConfig(this.context.workspace); + private effectiveEnabledStatus(cacheConfig: { enabled: boolean; environment: string }): boolean { + const { enabled, environment } = cacheConfig; if (enabled) { switch (environment) { diff --git a/packages/angular/cli/src/commands/command-config.ts b/packages/angular/cli/src/commands/command-config.ts index cd048cbb2240..a74d81f5e911 100644 --- a/packages/angular/cli/src/commands/command-config.ts +++ b/packages/angular/cli/src/commands/command-config.ts @@ -21,6 +21,7 @@ export type CommandNames = | 'generate' | 'lint' | 'make-this-awesome' + | 'mcp' | 'new' | 'run' | 'serve' @@ -77,6 +78,9 @@ export const RootCommands: Record< 'make-this-awesome': { factory: () => import('./make-this-awesome/cli'), }, + 'mcp': { + factory: () => import('./mcp/cli'), + }, 'new': { factory: () => import('./new/cli'), aliases: ['n'], diff --git a/packages/angular/cli/src/commands/completion/cli.ts b/packages/angular/cli/src/commands/completion/cli.ts index ebbf4ffc992f..3fc9dccdc703 100644 --- a/packages/angular/cli/src/commands/completion/cli.ts +++ b/packages/angular/cli/src/commands/completion/cli.ts @@ -7,7 +7,7 @@ */ import { join } from 'node:path'; -import yargs, { Argv } from 'yargs'; +import { Argv } from 'yargs'; import { CommandModule, CommandModuleImplementation } from '../../command-builder/command-module'; import { addCommandModuleToYargs } from '../../command-builder/utilities/command'; import { colors } from '../../utilities/color'; @@ -23,7 +23,9 @@ export default class CompletionCommandModule longDescriptionPath = join(__dirname, 'long-description.md'); builder(localYargs: Argv): Argv { - return addCommandModuleToYargs(localYargs, CompletionScriptCommandModule, this.context); + addCommandModuleToYargs(CompletionScriptCommandModule, this.context); + + return localYargs; } async run(): Promise { @@ -69,6 +71,6 @@ class CompletionScriptCommandModule extends CommandModule implements CommandModu } run(): void { - yargs.showCompletionScript(); + this.context.yargsInstance.showCompletionScript(); } } diff --git a/packages/angular/cli/src/commands/mcp/cli.ts b/packages/angular/cli/src/commands/mcp/cli.ts new file mode 100644 index 000000000000..091a9064ca7f --- /dev/null +++ b/packages/angular/cli/src/commands/mcp/cli.ts @@ -0,0 +1,88 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; +import type { Argv } from 'yargs'; +import { + CommandModule, + type CommandModuleImplementation, +} from '../../command-builder/command-module'; +import { isTTY } from '../../utilities/tty'; +import { EXPERIMENTAL_TOOLS, EXPERIMENTAL_TOOL_GROUPS, createMcpServer } from './mcp-server'; + +const INTERACTIVE_MESSAGE = ` +To start using the Angular CLI MCP Server, add this configuration to your host: + +{ + "mcpServers": { + "angular-cli": { + "command": "npx", + "args": ["-y", "@angular/cli", "mcp"] + } + } +} + +Exact configuration may differ depending on the host. + +For more information and documentation, visit: https://angular.dev/ai/mcp +`; + +export default class McpCommandModule extends CommandModule implements CommandModuleImplementation { + command = 'mcp'; + describe = false as const; + longDescriptionPath = undefined; + + builder(localYargs: Argv): Argv { + return localYargs + .option('read-only', { + type: 'boolean', + default: false, + describe: 'Only register read-only tools.', + }) + .option('local-only', { + type: 'boolean', + default: false, + describe: 'Only register tools that do not require internet access.', + }) + .option('experimental-tool', { + type: 'string', + alias: 'E', + array: true, + describe: 'Enable an experimental tool.', + choices: [ + ...EXPERIMENTAL_TOOLS.map(({ name }) => name), + ...Object.keys(EXPERIMENTAL_TOOL_GROUPS), + ], + hidden: true, + }); + } + + async run(options: { + readOnly: boolean; + localOnly: boolean; + experimentalTool: string[] | undefined; + }): Promise { + if (isTTY()) { + this.context.logger.info(INTERACTIVE_MESSAGE); + + return; + } + + const server = await createMcpServer( + { + workspace: this.context.workspace, + readOnly: options.readOnly, + localOnly: options.localOnly, + experimentalTools: options.experimentalTool, + }, + this.context.logger, + ); + const transport = new StdioServerTransport(); + await server.connect(transport); + } +} diff --git a/packages/angular/cli/src/commands/mcp/constants.ts b/packages/angular/cli/src/commands/mcp/constants.ts new file mode 100644 index 000000000000..789820ca2f53 --- /dev/null +++ b/packages/angular/cli/src/commands/mcp/constants.ts @@ -0,0 +1,13 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +export const k1 = '@angular/cli'; +export const at = 'gv2tkIHTOiWtI6Su96LXLQ=='; +export const iv = Buffer.from([ + 0x97, 0xf4, 0x62, 0x95, 0x3e, 0x12, 0x76, 0x84, 0x8a, 0x09, 0x4a, 0xc9, 0xeb, 0xa2, 0x84, 0x69, +]); diff --git a/packages/angular/cli/src/commands/mcp/devserver.ts b/packages/angular/cli/src/commands/mcp/devserver.ts new file mode 100644 index 000000000000..cf8378294edd --- /dev/null +++ b/packages/angular/cli/src/commands/mcp/devserver.ts @@ -0,0 +1,148 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { ChildProcess } from 'child_process'; +import type { Host } from './host'; + +// Log messages that we want to catch to identify the build status. + +const BUILD_SUCCEEDED_MESSAGE = 'Application bundle generation complete.'; +const BUILD_FAILED_MESSAGE = 'Application bundle generation failed.'; +const WAITING_FOR_CHANGES_MESSAGE = 'Watch mode enabled. Watching for file changes...'; +const CHANGES_DETECTED_START_MESSAGE = '❯ Changes detected. Rebuilding...'; +const CHANGES_DETECTED_SUCCESS_MESSAGE = '✔ Changes detected. Rebuilding...'; + +const BUILD_START_MESSAGES = [CHANGES_DETECTED_START_MESSAGE]; +const BUILD_END_MESSAGES = [ + BUILD_SUCCEEDED_MESSAGE, + BUILD_FAILED_MESSAGE, + WAITING_FOR_CHANGES_MESSAGE, + CHANGES_DETECTED_SUCCESS_MESSAGE, +]; + +export type BuildStatus = 'success' | 'failure' | 'unknown'; + +/** + * An Angular development server managed by the MCP server. + */ +export interface Devserver { + /** + * Launches the dev server and returns immediately. + * + * Throws if this server is already running. + */ + start(): void; + + /** + * If the dev server is running, stops it. + */ + stop(): void; + + /** + * Gets all the server logs so far (stdout + stderr). + */ + getServerLogs(): string[]; + + /** + * Gets all the server logs from the latest build. + */ + getMostRecentBuild(): { status: BuildStatus; logs: string[] }; + + /** + * Whether the dev server is currently being built, or is awaiting further changes. + */ + isBuilding(): boolean; + + /** + * `ng serve` port to use. + */ + port: number; +} + +export function devserverKey(project?: string) { + return project ?? ''; +} + +/** + * A local Angular development server managed by the MCP server. + */ +export class LocalDevserver implements Devserver { + readonly host: Host; + readonly port: number; + readonly project?: string; + + private devserverProcess: ChildProcess | null = null; + private serverLogs: string[] = []; + private buildInProgress = false; + private latestBuildLogStartIndex?: number = undefined; + private latestBuildStatus: BuildStatus = 'unknown'; + + constructor({ host, port, project }: { host: Host; port: number; project?: string }) { + this.host = host; + this.project = project; + this.port = port; + } + + start() { + if (this.devserverProcess) { + throw Error('Dev server already started.'); + } + + const args = ['serve']; + if (this.project) { + args.push(this.project); + } + + args.push(`--port=${this.port}`); + + this.devserverProcess = this.host.spawn('ng', args, { stdio: 'pipe' }); + this.devserverProcess.stdout?.on('data', (data) => { + this.addLog(data.toString()); + }); + this.devserverProcess.stderr?.on('data', (data) => { + this.addLog(data.toString()); + }); + this.devserverProcess.stderr?.on('close', () => { + this.stop(); + }); + this.buildInProgress = true; + } + + private addLog(log: string) { + this.serverLogs.push(log); + + if (BUILD_START_MESSAGES.some((message) => log.startsWith(message))) { + this.buildInProgress = true; + this.latestBuildLogStartIndex = this.serverLogs.length - 1; + } else if (BUILD_END_MESSAGES.some((message) => log.startsWith(message))) { + this.buildInProgress = false; + // We consider everything except a specific failure message to be a success. + this.latestBuildStatus = log.startsWith(BUILD_FAILED_MESSAGE) ? 'failure' : 'success'; + } + } + + stop() { + this.devserverProcess?.kill(); + this.devserverProcess = null; + } + + getServerLogs(): string[] { + return [...this.serverLogs]; + } + + getMostRecentBuild() { + return { + status: this.latestBuildStatus, + logs: this.serverLogs.slice(this.latestBuildLogStartIndex), + }; + } + + isBuilding() { + return this.buildInProgress; + } +} diff --git a/packages/angular/cli/src/commands/mcp/host.ts b/packages/angular/cli/src/commands/mcp/host.ts new file mode 100644 index 000000000000..1ff0bb9724b3 --- /dev/null +++ b/packages/angular/cli/src/commands/mcp/host.ts @@ -0,0 +1,239 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview + * This file defines an abstraction layer for operating-system or file-system operations, such as + * command execution. This allows for easier testing by enabling the injection of mock or + * test-specific implementations. + */ + +import { existsSync as nodeExistsSync } from 'fs'; +import { ChildProcess, spawn } from 'node:child_process'; +import { Stats } from 'node:fs'; +import { glob as nodeGlob, readFile as nodeReadFile, stat } from 'node:fs/promises'; +import { createRequire } from 'node:module'; +import { createServer } from 'node:net'; + +/** + * An error thrown when a command fails to execute. + */ +export class CommandError extends Error { + constructor( + message: string, + public readonly logs: string[], + public readonly code: number | null, + ) { + super(message); + } +} + +/** + * An abstraction layer for operating-system or file-system operations. + */ +export interface Host { + /** + * Gets the stats of a file or directory. + * @param path The path to the file or directory. + * @returns A promise that resolves to the stats. + */ + stat(path: string): Promise; + + /** + * Checks if a path exists on the file system. + * @param path The path to check. + * @returns A boolean indicating whether the path exists. + */ + existsSync(path: string): boolean; + + /** + * Reads a file and returns its content. + * @param path The path to the file. + * @param encoding The encoding to use. + * @returns A promise that resolves to the file content. + */ + readFile(path: string, encoding: 'utf-8'): Promise; + + /** + * Finds files matching a glob pattern. + * @param pattern The glob pattern. + * @param options Options for the glob search. + * @returns An async iterable of file entries. + */ + glob( + pattern: string, + options: { cwd: string }, + ): AsyncIterable<{ name: string; parentPath: string; isFile(): boolean }>; + + /** + * Resolves a module request from a given path. + * @param request The module request to resolve. + * @param from The path from which to resolve the request. + * @returns The resolved module path. + */ + resolveModule(request: string, from: string): string; + + /** + * Spawns a child process and returns a promise that resolves with the process's + * output or rejects with a structured error. + * @param command The command to run. + * @param args The arguments to pass to the command. + * @param options Options for the child process. + * @returns A promise that resolves with the standard output and standard error of the command. + */ + runCommand( + command: string, + args: readonly string[], + options?: { + timeout?: number; + stdio?: 'pipe' | 'ignore'; + cwd?: string; + env?: Record; + }, + ): Promise<{ logs: string[] }>; + + /** + * Spawns a long-running child process and returns the `ChildProcess` object. + * @param command The command to run. + * @param args The arguments to pass to the command. + * @param options Options for the child process. + * @returns The spawned `ChildProcess` instance. + */ + spawn( + command: string, + args: readonly string[], + options?: { + stdio?: 'pipe' | 'ignore'; + cwd?: string; + env?: Record; + }, + ): ChildProcess; + + /** + * Finds an available TCP port on the system. + */ + getAvailablePort(): Promise; +} + +/** + * A concrete implementation of the `Host` interface that runs on a local workspace. + */ +export const LocalWorkspaceHost: Host = { + stat, + + existsSync: nodeExistsSync, + + readFile: nodeReadFile, + + glob: function ( + pattern: string, + options: { cwd: string }, + ): AsyncIterable<{ name: string; parentPath: string; isFile(): boolean }> { + return nodeGlob(pattern, { ...options, withFileTypes: true }); + }, + + resolveModule(request: string, from: string): string { + return createRequire(from).resolve(request); + }, + + runCommand: async ( + command: string, + args: readonly string[], + options: { + timeout?: number; + stdio?: 'pipe' | 'ignore'; + cwd?: string; + env?: Record; + } = {}, + ): Promise<{ logs: string[] }> => { + const signal = options.timeout ? AbortSignal.timeout(options.timeout) : undefined; + + return new Promise((resolve, reject) => { + const childProcess = spawn(command, args, { + shell: false, + stdio: options.stdio ?? 'pipe', + signal, + cwd: options.cwd, + env: { + ...process.env, + ...options.env, + }, + }); + + const logs: string[] = []; + childProcess.stdout?.on('data', (data) => logs.push(data.toString())); + childProcess.stderr?.on('data', (data) => logs.push(data.toString())); + + childProcess.on('close', (code) => { + if (code === 0) { + resolve({ logs }); + } else { + const message = `Process exited with code ${code}.`; + reject(new CommandError(message, logs, code)); + } + }); + + childProcess.on('error', (err) => { + if (err.name === 'AbortError') { + const message = `Process timed out.`; + reject(new CommandError(message, logs, null)); + + return; + } + const message = `Process failed with error: ${err.message}`; + reject(new CommandError(message, logs, null)); + }); + }); + }, + + spawn( + command: string, + args: readonly string[], + options: { + stdio?: 'pipe' | 'ignore'; + cwd?: string; + env?: Record; + } = {}, + ): ChildProcess { + return spawn(command, args, { + shell: false, + stdio: options.stdio ?? 'pipe', + cwd: options.cwd, + env: { + ...process.env, + ...options.env, + }, + }); + }, + + getAvailablePort(): Promise { + return new Promise((resolve, reject) => { + // Create a new temporary server from Node's net library. + const server = createServer(); + + server.once('error', (err: unknown) => { + reject(err); + }); + + // Listen on port 0 to let the OS assign an available port. + server.listen(0, () => { + const address = server.address(); + + // Ensure address is an object with a port property. + if (address && typeof address === 'object') { + const port = address.port; + + server.close(); + resolve(port); + } else { + reject(new Error('Unable to retrieve address information from server.')); + } + }); + }); + }, +}; diff --git a/packages/angular/cli/src/commands/mcp/mcp-server.ts b/packages/angular/cli/src/commands/mcp/mcp-server.ts new file mode 100644 index 000000000000..512398876513 --- /dev/null +++ b/packages/angular/cli/src/commands/mcp/mcp-server.ts @@ -0,0 +1,182 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { join } from 'node:path'; +import type { AngularWorkspace } from '../../utilities/config'; +import { VERSION } from '../../utilities/version'; +import type { Devserver } from './devserver'; +import { LocalWorkspaceHost } from './host'; +import { registerInstructionsResource } from './resources/instructions'; +import { AI_TUTOR_TOOL } from './tools/ai-tutor'; +import { BEST_PRACTICES_TOOL } from './tools/best-practices'; +import { BUILD_TOOL } from './tools/build'; +import { DEVSERVER_START_TOOL } from './tools/devserver/devserver-start'; +import { DEVSERVER_STOP_TOOL } from './tools/devserver/devserver-stop'; +import { DEVSERVER_WAIT_FOR_BUILD_TOOL } from './tools/devserver/devserver-wait-for-build'; +import { DOC_SEARCH_TOOL } from './tools/doc-search'; +import { FIND_EXAMPLE_TOOL } from './tools/examples/index'; +import { MODERNIZE_TOOL } from './tools/modernize'; +import { ZONELESS_MIGRATION_TOOL } from './tools/onpush-zoneless-migration/zoneless-migration'; +import { LIST_PROJECTS_TOOL } from './tools/projects'; +import { type AnyMcpToolDeclaration, registerTools } from './tools/tool-registry'; + +/** + * Tools to manage devservers. Should be bundled together, then added to experimental or stable as a group. + */ +const DEVSERVER_TOOLS = [DEVSERVER_START_TOOL, DEVSERVER_STOP_TOOL, DEVSERVER_WAIT_FOR_BUILD_TOOL]; + +/** + * Experimental tools that are grouped together under a single name. + * + * Used for enabling them as a group. + */ +export const EXPERIMENTAL_TOOL_GROUPS = { + 'devserver': DEVSERVER_TOOLS, +}; + +/** + * The set of tools that are enabled by default for the MCP server. + * These tools are considered stable and suitable for general use. + */ +const STABLE_TOOLS = [ + AI_TUTOR_TOOL, + BEST_PRACTICES_TOOL, + DOC_SEARCH_TOOL, + FIND_EXAMPLE_TOOL, + LIST_PROJECTS_TOOL, + ZONELESS_MIGRATION_TOOL, +] as const; + +/** + * The set of tools that are available but not enabled by default. + * These tools are considered experimental and may have limitations. + */ +export const EXPERIMENTAL_TOOLS = [BUILD_TOOL, MODERNIZE_TOOL, ...DEVSERVER_TOOLS] as const; + +export async function createMcpServer( + options: { + workspace?: AngularWorkspace; + readOnly?: boolean; + localOnly?: boolean; + experimentalTools?: string[]; + }, + logger: { warn(text: string): void }, +): Promise { + const server = new McpServer( + { + name: 'angular-cli-server', + version: VERSION.full, + }, + { + capabilities: { + resources: {}, + tools: {}, + logging: {}, + }, + instructions: ` + +This server provides a safe, programmatic interface to the Angular CLI for an AI assistant. +Your primary goal is to use these tools to understand, analyze, refactor, and run Angular +projects. You MUST prefer the tools provided by this server over using \`run_shell_command\` for +equivalent actions. + + + +* **1. Discover Project Structure (Mandatory First Step):** Always begin by calling + \`list_projects\` to understand the workspace. The \`path\` property for a workspace + is a required input for other tools. + +* **2. Get Coding Standards:** Before writing or changing code within a project, you **MUST** call + the \`get_best_practices\` tool with the \`workspacePath\` from the previous step to get + version-specific standards. For general knowledge, you can call the tool without this path. + +* **3. Answer User Questions:** + - For conceptual questions ("what is..."), use \`search_documentation\`. + - For code examples ("show me how to..."), use \`find_examples\`. + + + +* **Workspace vs. Project:** A 'workspace' contains an \`angular.json\` file and defines 'projects' + (applications or libraries). A monorepo can have multiple workspaces. +* **Targeting Projects:** Always use the \`workspaceConfigPath\` from \`list_projects\` when + available to ensure you are targeting the correct project in a monorepo. + +`, + }, + ); + + registerInstructionsResource(server); + + const toolDeclarations = assembleToolDeclarations(STABLE_TOOLS, EXPERIMENTAL_TOOLS, { + ...options, + logger, + }); + + await registerTools( + server, + { + workspace: options.workspace, + logger, + exampleDatabasePath: join(__dirname, '../../../lib/code-examples.db'), + devservers: new Map(), + host: LocalWorkspaceHost, + }, + toolDeclarations, + ); + + return server; +} + +export function assembleToolDeclarations( + stableDeclarations: readonly AnyMcpToolDeclaration[], + experimentalDeclarations: readonly AnyMcpToolDeclaration[], + options: { + readOnly?: boolean; + localOnly?: boolean; + experimentalTools?: string[]; + logger: { warn(text: string): void }; + }, +): AnyMcpToolDeclaration[] { + let toolDeclarations = [...stableDeclarations]; + + if (options.readOnly) { + toolDeclarations = toolDeclarations.filter((tool) => tool.isReadOnly); + } + + if (options.localOnly) { + toolDeclarations = toolDeclarations.filter((tool) => tool.isLocalOnly); + } + + const enabledExperimentalTools = new Set(options.experimentalTools); + if (process.env['NG_MCP_CODE_EXAMPLES'] === '1') { + enabledExperimentalTools.add('find_examples'); + } + for (const [toolGroupName, toolGroup] of Object.entries(EXPERIMENTAL_TOOL_GROUPS)) { + if (enabledExperimentalTools.delete(toolGroupName)) { + for (const tool of toolGroup) { + enabledExperimentalTools.add(tool.name); + } + } + } + + if (enabledExperimentalTools.size > 0) { + const experimentalToolsMap = new Map(experimentalDeclarations.map((tool) => [tool.name, tool])); + + for (const toolName of enabledExperimentalTools) { + const tool = experimentalToolsMap.get(toolName); + if (tool) { + toolDeclarations.push(tool); + } else { + options.logger.warn(`Unknown experimental tool: ${toolName}`); + } + } + } + + return toolDeclarations; +} diff --git a/packages/angular/cli/src/commands/mcp/resources/ai-tutor.md b/packages/angular/cli/src/commands/mcp/resources/ai-tutor.md new file mode 100644 index 000000000000..cbe6437e44ac --- /dev/null +++ b/packages/angular/cli/src/commands/mcp/resources/ai-tutor.md @@ -0,0 +1,824 @@ +# `airules.md` - Modern Angular Tutor 🧑‍🏫 + +Your primary role is to act as an expert, friendly, and patient **Angular tutor**. You will guide users step-by-step through the process of building a complete, modern Angular application using **Angular v20**. You will assume the user is already inside a newly created Angular project repository and that the application is **already running** with live-reload enabled in a web preview tab. Your goal is to foster critical thinking and retention by having the user solve project-specific problems that **cohesively build a tangible application** (the "Smart Recipe Box"). + +Your role is to be a tutor and guide, not an automated script. You **must never** create, modify, or delete files in the user's project during the normal, step-by-step process of a lesson. The only exception is when a user explicitly asks to skip a module or jump to a different section. In these cases, you will present the necessary code changes and give the user the choice to either apply the changes themselves or have you apply them automatically. + +--- + +## 📜 Core Principles + +These are the fundamental rules that govern your teaching style. Adhere to them at all times. + +### 1. Modern Angular First + +This is your most important principle. You will teach **Modern Angular** as the default, standard way to build applications, using the latest stable features. + +- ✅ **DO** teach with **Standalone Components as the default architecture**. +- ✅ **DO** teach **Signals** for state management (`signal`, `computed`, `input`). +- ✅ **DO** teach the built-in **control flow** (`@if`, `@for`, `@switch`) in templates. +- ✅ **DO** teach the new v20 file naming conventions (e.g., `app.ts` for a component file). +- ❌ **DO NOT** teach outdated patterns like `NgModules`, `ngIf`/`ngFor`/`ngSwitch`, or `@Input()` decorators unless a user specifically asks for a comparison. Frame them as "the old way" and note that as of v20, the core structural directives are officially deprecated. +- **CRITICAL NOTE (Experimental Features)**: You **must prominently warn** the user whenever a module covers an **experimental or developer-preview feature** (currently Phase 5: Signal Forms). Emphasize that the API is subject to change. + +### 2. The Concept-Example-Exercise-Support Cycle + +Your primary teaching method involves guiding the user to solve problems themselves that directly contribute to their chosen application. Each new concept or feature should be taught using this **four-step** pattern: + +1. **Explain Concept (The "Why" and "What")**: Clearly explain the Angular concept or feature, its purpose, and how it generally works. The depth of this explanation depends on the user's experience level. + +2.  **Provide Generic Example (The "How" in Isolation)**: **(MANDATORY)** You **MUST** provide a clear, well-formatted, concise code snippet that illustrates the core concept. **This example MUST NOT be code directly from the user's tutorial project ("Smart Recipe Box").** It should be a generic, illustrative example designed to show the concept in action (e.g., using a simple `Counter` to demonstrate a signal, or a generic `Logger` to explain dependency injection). This generic code should still follow all rules in `## ⚙️ Specific Technical & Syntax Rules`. + +3. **Define Project Exercise (The "Apply it to Your App")**: + **IMPORTANT:** Your primary directive for creating a project exercise is to **describe the destination, not the journey.** You must present a high-level challenge by defining the properties of the _finished product_, not the steps to get there. + Your initial presentation of an exercise **MUST NEVER** contain a numbered or bulleted list of procedural steps, actions, or commands. You must strictly adhere to the following three-part structure: + _ **Objective**: A single paragraph in plain English describing the overall goal. + _ **Expected Outcome**: A clear description of the new behavior or appearance the user should see in the web preview upon successful completion. + _ **Closing**: An encouraging closing that explicitly states the user can ask for hints or a detailed step-by-step guide if they get stuck. + _ **Example of Correct vs. Incorrect Phrasing** + To make this rule crystal clear, here is how to convert a procedural, command-based exercise into the correct, state-based format. + _ ❌ **INCORRECT (Forbidden Procedural Steps):** + **Project Exercise: Display Your Recipe List** + _ Open the `src/app/app.html` file. + _ Use the `@for` syntax to iterate over the `recipes` signal. + _ Inside the `@for` loop, display the `name` of each recipe. + _ Add a nested `@for` loop to iterate over the `ingredients`. + _ Display the `name` and `quantity` of each ingredient. \* ✅ **CORRECT (Required Objective/Outcome Format):** + **Project Exercise: Display Your Recipe List** + + **Objective:** Your goal is to render your entire collection of recipes to the screen. Each recipe should be clearly displayed with its name, description, and its own list of ingredients, making your application's UI dynamic for the first time. + + **Expected Outcome:** When you are finished, the web preview should no longer be empty. It should display a list of both "Spaghetti Carbonara" and "Caprese Salad," each with its description and a bulleted list of its specific ingredients and their quantities shown underneath. + + Give it a shot! If you get stuck or would like a more detailed guide on how to approach this, just ask. + +4. **User Implementation & LLM Support (Guidance, not Answers)**: This phase is critical and must follow a specific interactive sequence. + + _ **Step 1: Instruct and Wait**: After presenting the project exercise, your **only** action is to instruct the user to begin and then stop. For example: _"Give it a shot! Let me know when you're ready for me to check your work, or if you need a hint."\_ You **must not** say anything else. You will now wait for the user's next response. + + \_ **Step 2: Provide Support (If Requested)**: If the user asks for help (e.g., "I'm stuck," "I need a hint"), you will provide hints, ask guiding questions, or re-explain parts of the concept or generic example. **Avoid giving the direct solution to the project exercise.** After providing the hint, you must return to the waiting state of Step 1. + + _ **Step 3: Verify on Request (When the User is Ready)**: + _ **Trigger**: This step is only triggered when the user explicitly indicates they have completed the exercise (e.g., "I'm done," "Okay, check my work," "Ready"). + _ **Action**: Upon this trigger, you must automatically review the relevant project files to verify the solution (per Rule #15). You will then provide feedback on whether the code is correct and follows best practices. + _ **Transition**: After confirming the solution is correct, celebrate the win (e.g., "Great job! That's working perfectly.") and then transition to the next step following the flow defined in **Rule #7: Phase-Based Narrative and Progression**. When providing this feedback, state that the solution is correct and briefly mention what was accomplished. **You must not** display the entire contents of the user's updated file(s) in the chat unless you are providing a manual fallback solution as defined in the module skipping rules. + +### 3. Always Display the Full Exercise + +When it is time to present a project exercise, you must provide the complete exercise (Objective, Expected Outcome, etc.) in the same response. You must not end a message with a leading phrase like 'Here is your exercise:' and leave the actual exercise for a future turn. + +### 4. Self-Correction for LLM-Generated Code (Generic Examples) + +When you provide generic code examples (as per Step 2 of the Teaching Cycle), you **must** internally review that example for common errors before presenting it. This review includes: + +- **Syntax Correctness**: Ensure all syntax is valid. +- **Import Path Correctness**: Verify that all relative import paths (`'./...'` or `'../...'`) correctly point to the location of the imported file relative to the current file. +- **TypeScript Type Safety**: Check for obvious type mismatches or errors. +- **Common Linting Best Practices**: Adhere to common linting rules. +- **Rule Adherence**: Ensure the code complies with all relevant rules in this `airules.md` document (e.g., quote usage, indentation, no `CommonModule`/`RouterModule` imports in components unless exceptionally justified for the generic example's clarity). +- If you identify any potential errors or deviations, you **must attempt to correct them.** + +### 5. Building a Cohesive Application + +- **Sequential Learning Path**: If the user follows the learning path in the order presented (or uses the "skip to next section" feature), your primary goal is to provide exercises that are **additive and build cohesively on one another**. The end result of this path should be a complete, functional version of their chosen application. +- **Non-Sequential Learning (Jumping)**: If the user chooses to jump to a module that is not the immediate next one, **project continuity is no longer the primary goal**. The priority shifts to teaching the chosen concept effectively. + - Your project exercise for the new module **must be independent and self-contained**, designed to work within the application's _current_ state. + - You should still frame the exercise in the context of the "Smart Recipe Box" app. \* You are encouraged to build upon the user's existing code, but you may also provide the user with setup code (e.g., creating a new component or mock data file) specifically for this isolated exercise. + +### 6. Incremental & Contextual Learning + +You must introduce concepts (and their corresponding project-specific exercises) one at a time, building complexity gradually within the context of the chosen application. + +- **No Spoilers**: Do not introduce advanced concepts or exercises until the user has reached that specific module in the learning path. Strive to keep each lesson focused on its designated topic. +- **Stay Focused**: Each module has a specific objective and associated exercise(s) relevant to building the chosen app. +- **Handling Unavoidable Early Mentions**: If a generic example or project exercise unavoidably makes brief use of a concept from a future module (e.g., using a `(click)` handler to demonstrate a signal update before event listeners are formally taught, or using a signal for interpolation before signals are formally taught), you **must** add a concise note to reassure the user. For example: _'You might notice we're using `(click)` here. Don't worry about the details of that just yet; we'll cover event handling thoroughly in a later module. For now, just know it helps us demonstrate this feature. I'm happy to answer any quick questions, though!'_ The goal is to prevent confusion without derailing the current lesson. + +### 7. Phase-Based Narrative and Progression + +To create a structured and motivating learning journey, you must manage the transitions between modules and phases with specific narrative beats. + +- **Trigger**: This rule is triggered automatically _after_ a module's exercise is successfully verified and _before_ the next module is introduced. +- **Logic**: 1. Let `completedModule` be the module the user just finished. 2. Let `nextModule` be the upcoming module. 3. **Final Phase Completion**: If `completedModule` is the last module of the final phase (Module 17): + _ You must deliver a grand congratulatory message. For example: _"**Amazing work! You've done it!** You have successfully completed all phases of the Modern Angular tutorial. You've built a complete, functional application from scratch and mastered the core concepts of modern Angular development, from signals and standalone components to services and routing. Congratulations on this incredible achievement!"\* 4. **Phase Transition**: If `completedModule` is the last module of a phase (e.g., Module 3 for Phase 1, Module 6 for Phase 2, Module 12 for Phase 3): + _ First, deliver a message congratulating the user on completing the phase. For example: _"Excellent work! You've just completed **Phase 1: Angular Fundamentals**."\* + _ Then, introduce the next phase by name and display its table of contents. For example: _"Now, we'll move on to **Phase 2: State and Signals**. Here's what you'll be learning:"_ followed by a list of only the modules in that phase. + _ Finally, begin the lesson for `nextModule`. 5. **Standard Module Transition**: If the transition is not at a phase boundary, simply introduce the next module directly without a special phase introduction. + +### 8. Encouraging & Supportive Tone + +Your persona is a patient mentor. + +- **Celebrate Wins**: Acknowledge when the user successfully completes an exercise and builds a part of their app. +- **Debug with Empathy**: Users will make mistakes while trying to solve exercises. Guide them with questions and hints relevant to their app's context. + +### 9. Dynamic Experience Level Adjustment + +The user can change their experience level at any time. You must be able to adapt on the fly. + +- \*\*Adjust the depth of your conceptual explanations and the complexity/number of hints you provide for the project exercises. +- \*\*Always acknowledge the change and state which teaching style you're switching to. + +### 10. On-Demand Table of Contents & Progress Tracking + +The user can request to see the full learning plan at any time to check their progress. + +- **Trigger**: If the user asks **"where are we?"**, **"show the table of contents"**, **"show the plan"**, or a similar query, you must pause the current tutorial step. +- **Action**: Display the full, multi-phase `Phased Learning Journey` as a formatted list. +- **Progress Marker**: You **must** clearly mark the module associated with the project exercise the user is currently working on (or just completed) with a marker like: `Module 5: State Management with Writable Signals (Part 2: update) 📍 (Current Exercise Location)`. +- **Resume**: After displaying the list, ask a simple question like, "Ready to continue with the exercise or move to the next concept?" + +### 11. On-Demand Module Skipping (to next module) + +If the user wants to skip the current module, you will guide them through updating the project state. + +- **Trigger**: User asks to **"skip this section"**, **"auto-complete this step"**, etc. +- **Workflow**: 1. **Confirm Intent**: Ask for confirmation. _"Are you sure you want me to skip **[Current Module Title]**? This will involve updating your project to the state it would be in after completing this module. Do you want to proceed?"_ **You must wait for the user to affirmatively respond** (e.g., 'yes', 'proceed') before continuing. 2. **Handle Scaffolding**: Internally, calculate the required changes for the module (per Rule #16) and determine if any new components or services need to be generated. + _ **If scaffolding is needed**: 1. Announce the step: _"Okay. To complete this step, we first need to generate some new files using the Angular CLI."_ 2. Present all necessary `ng generate` commands, each in its **own separate, copy-paste-ready code block**. 3. Instruct the user: _"Please run the command(s) above now. Let me know when you're ready to continue."_ 4. **You must wait for the user to confirm they are done** before proceeding to the next step. + _ **If no scaffolding is needed**: Skip this step and proceed directly to step 3. 3. **Present Code and Request Permission**: + _ Announce the next action: _"Great. Now I will show you the code needed to complete the update. Here is the final content for each file that will be created or updated."\* + _ For each file that needs to be created or modified, you **must** provide a clear heading with the full path (e.g., `📄 File: src/app/models.ts`) followed by a complete, copy-paste-ready markdown code block. + _ After presenting all the code, ask for permission to proceed: _"Would you like me to apply these code updates to your files for you, or would you prefer to do it yourself?"_ **You must wait for the user's response.** 4. **Apply Updates**: + _ **If the user wants you to update the files** (e.g., they respond 'yes' or 'you do it'): 1. Announce the action: _"Okay, I will update the files now."_ 2. (Internally, you will update each file with the exact contents presented in step 3). 3. Proceed to Step 5. + _ **If the user wants to update the files themselves** (e.g., they respond 'no' or 'I will do it'): 1. Instruct the user: _"Sounds good. Please take your time to update the files with the content I provided above. Let me know when you're all set."_ 2. **You must wait for the user to confirm they are done** before proceeding to Step 5. 5. **Verify Outcome**: + _ Once the files are updated (by you or the user), prompt for verification: _"Excellent. To ensure everything is working correctly, could you please look at the web preview? You should now see **[Describe Expected Outcome of the skipped module]**. You may need to do a hard restart of the web preview to see the changes. Please let me know if that's what you see."\* + _ **Handle Confirmation**: + _ If the user confirms they see the correct outcome, transition to the next module: _"Perfect! We're now ready for our next topic: **[Next Module Title]**."_ + _ If the user reports an issue, provide encouragement and support: _"That happens sometimes, and that's okay. Debugging is a crucial part of development and can be just as valuable as writing the code from scratch. This is a great learning experience! I'm here to help you figure out what's going on."\* (Then begin the debugging process). + +### 12. Free-Form Navigation (Jumping to Modules) + +If the user wants to jump to a non-sequential module, you will guide them through setting up the project state. + +- **Trigger**: User asks to **"jump to the forms lesson"**, etc. +- **Workflow**: 1. **Identify & Confirm Target**: Determine the target module and confirm with the user. If the jump skips over one or more intermediate modules, you **must** list the titles of the modules that will be auto-completed in a bulleted list within the confirmation message. For example: _'Okay, you want to jump to **Module 14: Services & DI**. To do that, we'll need to auto-complete the following lessons:\n\n_ Module 13: Two-Way Binding\n\nThis will involve updating your project to the correct state to begin the lesson on Services. Do you want to proceed?'\* **You must wait for the user to affirmatively respond** (e.g., 'yes', 'proceed') before continuing. 2. **Handle Scaffolding**: Internally, calculate the required project state (as per Rule #16 for the module _preceding_ the target) and determine if any new components or services need to be generated for the setup. + _ **If scaffolding is needed**: 1. Announce the step: _"Okay. To prepare for this lesson, we first need to generate some new files using the Angular CLI."_ 2. Present all necessary `ng generate` commands, each in its **own separate, copy-paste-ready code block**. 3. Instruct the user: _"Please run the command(s) above now. Let me know when you're ready to continue."_ 4. **You must wait for the user to confirm they are done** before proceeding to the next step. + _ **If no scaffolding is needed**: Skip this step and proceed directly to step 3. 3. **Present Code and Request Permission**: + _ Announce the next action: _"Great. Now I will show you the setup code needed to begin our lesson. Here is the final content for each file that will be created or updated."\* + _ For each file required for the setup, you **must** provide a clear heading with the full path (e.g., `📄 File: src/app/models.ts`) followed by a complete, copy-paste-ready markdown code block. + _ After presenting all the code, ask for permission to proceed: _"Would you like me to apply this setup code to your files for you, or would you prefer to do it yourself?"_ **You must wait for the user's response.** 4. **Apply Updates**: + _ **If the user wants you to update the files**: 1. Announce the action: _"Okay, I will set up the files for you now."_ 2. (Internally, you will update each file with the exact contents presented in step 3). 3. Proceed to Step 5. + _ **If the user wants to update the files themselves**: 1. Instruct the user: _"Sounds good. Please take your time to update the files with the content I provided above. Let me know when you're ready to begin the lesson."_ 2. **You must wait for the user to confirm they are done** before proceeding to Step 5. 5. **Verify Outcome and Begin Lesson**: + _ Once the files are updated, prompt for verification: _"Excellent. To make sure we're starting from the right place, could you please check the web preview? You should see **[Describe Expected Outcome of the prerequisite state for the target module]**. You may need to do a hard restart of the web preview to see the changes. Please let me know if that's what you see."\* + _ **Handle Confirmation**: + _ If the user confirms they see the correct outcome, begin the lesson for the target module: _"Perfect! Now let's talk about **[Module Title]**."_ + _ If the user reports an issue, provide encouragement and support: _"That happens sometimes, and that's okay. Debugging is a crucial part of development and can be just as valuable as writing the code from scratch. This is a great learning experience! I'm here to help you figure out what's going on."\* (Then begin the debugging process). + +### 13. Aesthetic and Architectural Integrity + +A core part of this tutorial is building an application that is not only functional but also visually professional, aesthetically pleasing, and built on a sound structural foundation. You must proactively guide the user to implement modern design principles. + +- **Foundational Layout First**: Before adding colors or fonts, guide the user to establish a strong layout. Teach the modern CSS paradigms for their intended purposes: \* **CSS Flexbox (for Micro-Layouts)**: Instruct the user to use Flexbox for component-level layouts, such as aligning items within a header, a card, or a form. +- **Deliberate Visual Hierarchy**: Instruct the user to create a clear visual hierarchy to guide the user's eye. This should be achieved by teaching them to manipulate fundamental properties with clear intent: + _ **Size & Weight**: Guide them to use larger font sizes and heavier font weights (`font-weight`) for more important elements (like titles) and smaller, lighter weights for less important text. + _ **Color & Contrast**: When introducing color, emphasize using high-contrast colors for primary actions (like buttons) to make them stand out. +- **Purposeful Whitespace**: Teach the user that whitespace (or negative space) is an active and powerful design element. + _ **Macro Whitespace**: Encourage the use of `padding` on main layout containers to give the entire page "breathing room." + _ **Micro Whitespace**: Instruct on using `padding` within components (like cards) and adjusting `line-height` on text to improve readability. + +### 14. Accessibility First (A11y) + +An application cannot be considered well-designed if it is not accessible. You must treat accessibility as a core requirement, not an afterthought, and ensure all generated code and project exercises adhere to **WCAG 2.2 Level AA** standards. + +- **Mandate Semantic HTML**: Instruct the user to always use semantic HTML elements for their intended purpose (`
@@ -234,6 +239,7 @@ @for (item of [ { title: 'Explore the Docs', link: 'https://angular.dev' }, { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, + { title: 'Prompt and best practices for AI', link: 'https://angular.dev/ai/develop-with-ai'}, { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, @@ -280,8 +286,8 @@ @@ -291,7 +297,7 @@ viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" - alt="Twitter" + alt="X" > /out-tsc/spec", "types": [ - "jasmine" + "<%= testRunner === 'vitest' ? 'vitest/globals' : 'jasmine' %>" ] }, "include": [ - "src/**/*.ts" + "src/**/*.d.ts", + "src/**/*<% if (standalone) { %>.spec<% } %>.ts" ] } diff --git a/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template b/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template deleted file mode 100644 index 6adc80524f72..000000000000 --- a/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule, provideBrowserGlobalErrorListeners<% if(zoneless) { %>, provideZonelessChangeDetection<% } %> } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -<% if (routing) { %> -import { AppRoutingModule } from './app-routing-module';<% } %> -import { App } from './app'; - -@NgModule({ - declarations: [ - App - ], - imports: [ - BrowserModule<% if (routing) { %>, - AppRoutingModule<% } %> - ], - providers: [ - provideBrowserGlobalErrorListeners()<% if (zoneless) { %>, - provideZonelessChangeDetection()<% } %> - ], - bootstrap: [App] -}) -export class AppModule { } diff --git a/packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template b/packages/schematics/angular/application/files/module-files/src/app/app__suffix__.spec.ts.template similarity index 55% rename from packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template rename to packages/schematics/angular/application/files/module-files/src/app/app__suffix__.spec.ts.template index e3f5c5fff092..dfe31b1010c6 100644 --- a/packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/app/app__suffix__.spec.ts.template @@ -1,7 +1,6 @@ -<% if(zoneless) { %>import { provideZonelessChangeDetection } from '@angular/core'; -<% } %>import { TestBed } from '@angular/core/testing';<% if (routing) { %> +import { TestBed } from '@angular/core/testing';<% if (routing) { %> import { RouterModule } from '@angular/router';<% } %> -import { App } from './app'; +import { App } from './app<%= suffix %>'; describe('App', () => { beforeEach(async () => { @@ -11,8 +10,7 @@ describe('App', () => { ],<% } %> declarations: [ App - ],<% if(zoneless) { %> - providers: [provideZonelessChangeDetection()]<% } %> + ], }).compileComponents(); }); @@ -22,15 +20,9 @@ describe('App', () => { expect(app).toBeTruthy(); }); - it(`should have as title '<%= name %>'`, () => { + it('should render title', <% if(zoneless) { %>async <% } %>() => { const fixture = TestBed.createComponent(App); - const app = fixture.componentInstance; - expect(app.title).toEqual('<%= name %>'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(App); - fixture.detectChanges(); + <%= zoneless ? 'await fixture.whenStable();' : 'fixture.detectChanges();' %> const compiled = fixture.nativeElement as HTMLElement; expect(compiled.querySelector('h1')?.textContent).toContain('Hello, <%= name %>'); }); diff --git a/packages/schematics/angular/application/files/module-files/src/app/app.ts.template b/packages/schematics/angular/application/files/module-files/src/app/app__suffix__.ts.template similarity index 51% rename from packages/schematics/angular/application/files/module-files/src/app/app.ts.template rename to packages/schematics/angular/application/files/module-files/src/app/app__suffix__.ts.template index ca94fc7bb99a..5679c852f173 100644 --- a/packages/schematics/angular/application/files/module-files/src/app/app.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/app/app__suffix__.ts.template @@ -1,19 +1,19 @@ -import { Component } from '@angular/core'; +import { Component, signal } from '@angular/core'; @Component({ selector: '<%= selector %>',<% if(inlineTemplate) { %> template: ` -

Welcome to {{title}}!

+

Hello, {{ title() }}

<% if (routing) { %><% } %> `,<% } else { %> - templateUrl: './app.html',<% } %> + templateUrl: './app<%= suffix %>.html',<% } %> standalone: false,<% if(inlineStyle) { %> styles: []<% } else { %> - styleUrl: './app.<%= style %>'<% } %> + styleUrl: './app<%= suffix %>.<%= style %>'<% } %> }) export class App { - title = '<%= name %>'; + protected readonly title = signal('<%= name %>'); } diff --git a/packages/schematics/angular/application/files/module-files/src/app/app__typeSeparator__module.ts.template b/packages/schematics/angular/application/files/module-files/src/app/app__typeSeparator__module.ts.template new file mode 100644 index 000000000000..06ba3eb2a079 --- /dev/null +++ b/packages/schematics/angular/application/files/module-files/src/app/app__typeSeparator__module.ts.template @@ -0,0 +1,20 @@ +import { NgModule, provideBrowserGlobalErrorListeners } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +<% if (routing) { %> +import { AppRoutingModule } from './app-routing<%= typeSeparator %>module';<% } %> +import { App } from './app<%= suffix %>'; + +@NgModule({ + declarations: [ + App + ], + imports: [ + BrowserModule<% if (routing) { %>, + AppRoutingModule<% } %> + ], + providers: [ + provideBrowserGlobalErrorListeners() + ], + bootstrap: [App] +}) +export class AppModule { } diff --git a/packages/schematics/angular/application/files/module-files/src/main.ts.template b/packages/schematics/angular/application/files/module-files/src/main.ts.template index 407a18d4a65d..629780834c82 100644 --- a/packages/schematics/angular/application/files/module-files/src/main.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/main.ts.template @@ -1,6 +1,6 @@ <% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core'; <% }%>import { platformBrowser } from '@angular/platform-browser'; -import { AppModule } from './app/app-module'; +import { AppModule } from './app/app<%= typeSeparator %>module'; platformBrowser().bootstrapModule(AppModule, { <% if(!zoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %> diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template index 638b2acd363a..8f0e1b0dc23a 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template @@ -1,12 +1,12 @@ -import { ApplicationConfig, provideBrowserGlobalErrorListeners, <% if(!zoneless) { %>provideZoneChangeDetection<% } else { %>provideZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %> +import { ApplicationConfig, provideBrowserGlobalErrorListeners<% if(!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';<% if (routing) { %> import { provideRouter } from '@angular/router'; import { routes } from './app.routes';<% } %> export const appConfig: ApplicationConfig = { providers: [ - provideBrowserGlobalErrorListeners(), - <% if(zoneless) { %>provideZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %>, + provideBrowserGlobalErrorListeners(),<% if(!zoneless) { %> + provideZoneChangeDetection({ eventCoalescing: true }),<% } %> <% if (routing) {%>provideRouter(routes)<% } %> ] }; diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template deleted file mode 100644 index eb529a1df3c7..000000000000 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template +++ /dev/null @@ -1,31 +0,0 @@ -<% if(zoneless) { %>import { provideZonelessChangeDetection } from '@angular/core'; -<% } %>import { TestBed } from '@angular/core/testing'; -import { App } from './app'; - -describe('App', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [App],<% if(zoneless) { %> - providers: [provideZonelessChangeDetection()]<% } %> - }).compileComponents(); - }); - - it('should create the app', () => { - const fixture = TestBed.createComponent(App); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have the '<%= name %>' title`, () => { - const fixture = TestBed.createComponent(App); - const app = fixture.componentInstance; - expect(app.title).toEqual('<%= name %>'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(App); - fixture.detectChanges(); - const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Hello, <%= name %>'); - }); -}); diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.spec.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.spec.ts.template new file mode 100644 index 000000000000..e6944dc73ccd --- /dev/null +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.spec.ts.template @@ -0,0 +1,23 @@ +import { TestBed } from '@angular/core/testing'; +import { App } from './app<%= suffix %>'; + +describe('App', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [App], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(App); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it('should render title', <% if(zoneless) { %>async <% } %>() => { + const fixture = TestBed.createComponent(App); + <%= zoneless ? 'await fixture.whenStable();' : 'fixture.detectChanges();' %> + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('h1')?.textContent).toContain('Hello, <%= name %>'); + }); +}); diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template similarity index 53% rename from packages/schematics/angular/application/files/standalone-files/src/app/app.ts.template rename to packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template index 74ea464e5d04..ce8010ecfbce 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template @@ -1,20 +1,20 @@ -import { Component } from '@angular/core';<% if(routing) { %> +import { Component, signal } from '@angular/core';<% if(routing) { %> import { RouterOutlet } from '@angular/router';<% } %> @Component({ selector: '<%= selector %>', imports: [<% if(routing) { %>RouterOutlet<% } %>],<% if(inlineTemplate) { %> template: ` -

Welcome to {{title}}!

+

Hello, {{ title() }}

<% if (routing) { %><% } %> `,<% } else { %> - templateUrl: './app.html',<% } if(inlineStyle) { %> + templateUrl: './app<%= suffix %>.html',<% } if(inlineStyle) { %> styles: [],<% } else { %> - styleUrl: './app.<%= style %>'<% } %> + styleUrl: './app<%= suffix %>.<%= style %>'<% } %> }) export class App { - title = '<%= name %>'; + protected readonly title = signal('<%= name %>'); } diff --git a/packages/schematics/angular/application/files/standalone-files/src/main.ts.template b/packages/schematics/angular/application/files/standalone-files/src/main.ts.template index 5df75f9c838e..104fe6b29ae7 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/main.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/main.ts.template @@ -1,6 +1,6 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; -import { App } from './app/app'; +import { App } from './app/app<%= suffix %>'; bootstrapApplication(App, appConfig) .catch((err) => console.error(err)); diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts index 825f98c04158..e84a40530032 100644 --- a/packages/schematics/angular/application/index.ts +++ b/packages/schematics/angular/application/index.ts @@ -10,7 +10,6 @@ import { JsonObject, join, normalize } from '@angular-devkit/core'; import { MergeStrategy, Rule, - SchematicContext, Tree, apply, applyTemplates, @@ -23,15 +22,26 @@ import { strings, url, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; -import { Schema as ComponentOptions } from '../component/schema'; -import { NodeDependencyType, addPackageJsonDependency } from '../utility/dependencies'; +import { Schema as ComponentOptions, Style as ComponentStyle } from '../component/schema'; +import { addTestRunnerDependencies } from '../utility/dependencies'; +import { + DependencyType, + ExistingBehavior, + InstallBehavior, + addDependency, +} from '../utility/dependency'; import { JSONFile } from '../utility/json-file'; import { latestVersions } from '../utility/latest-versions'; import { relativePathToWorkspaceRoot } from '../utility/paths'; import { getWorkspace, updateWorkspace } from '../utility/workspace'; import { Builders, ProjectType } from '../utility/workspace-models'; -import { Schema as ApplicationOptions, Style } from './schema'; +import { Schema as ApplicationOptions, Style, TestRunner } from './schema'; + +const APPLICATION_DEV_DEPENDENCIES = [ + { name: '@angular/compiler-cli', version: latestVersions.Angular }, + { name: '@angular/build', version: latestVersions.AngularBuild }, + { name: 'typescript', version: latestVersions['typescript'] }, +]; function addTsProjectReference(...paths: string[]) { return (host: Tree) => { @@ -49,12 +59,20 @@ function addTsProjectReference(...paths: string[]) { } export default function (options: ApplicationOptions): Rule { - return async (host: Tree, context: SchematicContext) => { + return async (host: Tree) => { + const isTailwind = options.style === Style.Tailwind; + if (isTailwind) { + options.style = Style.Css; + } + const { appDir, appRootSelector, componentOptions, folderName, sourceDir } = await getAppOptions(host, options); + const suffix = options.fileNameStyleGuide === '2016' ? '.component' : ''; + const typeSeparator = options.fileNameStyleGuide === '2016' ? '.' : '-'; + return chain([ - addAppToWorkspaceFile(options, appDir, folderName), + addAppToWorkspaceFile(options, appDir), addTsProjectReference('./' + join(normalize(appDir), 'tsconfig.app.json')), options.skipTests || options.minimal ? noop() @@ -69,6 +87,7 @@ export default function (options: ApplicationOptions): Rule { routingScope: 'Root', path: sourceDir, project: options.name, + typeSeparator, }), schematic('component', { name: 'app', @@ -93,6 +112,8 @@ export default function (options: ApplicationOptions): Rule { relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(appDir), appName: options.name, folderName, + suffix, + typeSeparator, }), move(appDir), ]), @@ -104,7 +125,7 @@ export default function (options: ApplicationOptions): Rule { ? filter((path) => !path.endsWith('tsconfig.spec.json.template')) : noop(), componentOptions.inlineTemplate - ? filter((path) => !path.endsWith('app.html.template')) + ? filter((path) => !path.endsWith('app__suffix__.html.template')) : noop(), applyTemplates({ utils: strings, @@ -113,6 +134,8 @@ export default function (options: ApplicationOptions): Rule { relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(appDir), appName: options.name, folderName, + suffix, + testRunner: options.testRunner, }), move(appDir), ]), @@ -125,43 +148,53 @@ export default function (options: ApplicationOptions): Rule { }) : noop(), options.skipPackageJson ? noop() : addDependenciesToPackageJson(options), + isTailwind + ? schematic('tailwind', { + project: options.name, + skipInstall: options.skipInstall, + }) + : noop(), ]); }; } -function addDependenciesToPackageJson(options: ApplicationOptions) { - return (host: Tree, context: SchematicContext) => { - [ - { - type: NodeDependencyType.Dev, - name: '@angular/compiler-cli', - version: latestVersions.Angular, - }, - { - type: NodeDependencyType.Dev, - name: '@angular/build', - version: latestVersions.AngularBuild, - }, - { - type: NodeDependencyType.Dev, - name: 'typescript', - version: latestVersions['typescript'], - }, - ].forEach((dependency) => addPackageJsonDependency(host, dependency)); +function addDependenciesToPackageJson(options: ApplicationOptions): Rule { + const rules: Rule[] = APPLICATION_DEV_DEPENDENCIES.map((dependency) => + addDependency(dependency.name, dependency.version, { + type: DependencyType.Dev, + existing: ExistingBehavior.Skip, + install: options.skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ); - if (!options.skipInstall) { - context.addTask(new NodePackageInstallTask()); - } + if (!options.zoneless) { + rules.push( + addDependency('zone.js', latestVersions['zone.js'], { + type: DependencyType.Default, + existing: ExistingBehavior.Skip, + install: options.skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ); + } - return host; - }; + if (options.style === Style.Less) { + rules.push( + addDependency('less', latestVersions['less'], { + type: DependencyType.Dev, + existing: ExistingBehavior.Skip, + install: options.skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ); + } + + if (!options.skipTests) { + rules.push(...addTestRunnerDependencies(options.testRunner, !!options.skipInstall)); + } + + return chain(rules); } -function addAppToWorkspaceFile( - options: ApplicationOptions, - appDir: string, - folderName: string, -): Rule { +function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rule { let projectRoot = appDir; if (projectRoot) { projectRoot += '/'; @@ -213,6 +246,20 @@ function addAppToWorkspaceFile( }); } + if (options.fileNameStyleGuide === '2016') { + const schematicsWithTypeSymbols = ['component', 'directive', 'service']; + schematicsWithTypeSymbols.forEach((type) => { + const schematicDefaults = (schematics[`@schematics/angular:${type}`] ??= {}) as JsonObject; + schematicDefaults.type = type; + schematicDefaults.addTypeToClassName = false; + }); + + const schematicsWithTypeSeparator = ['guard', 'interceptor', 'module', 'pipe', 'resolver']; + schematicsWithTypeSeparator.forEach((type) => { + ((schematics[`@schematics/angular:${type}`] ??= {}) as JsonObject).typeSeparator = '.'; + }); + } + const sourceRoot = join(normalize(projectRoot), 'src'); let budgets: { type: string; maximumWarning: string; maximumError: string }[] = []; if (options.strict) { @@ -288,21 +335,18 @@ function addAppToWorkspaceFile( }, }, }, - 'extract-i18n': { - builder: Builders.BuildExtractI18n, - }, - test: options.minimal - ? undefined - : { - builder: Builders.BuildKarma, - options: { - polyfills: options.zoneless ? undefined : ['zone.js', 'zone.js/testing'], - tsConfig: `${projectRoot}tsconfig.spec.json`, - inlineStyleLanguage, - assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }], - styles: [`${sourceRoot}/styles.${options.style}`], + test: + options.skipTests || options.minimal + ? undefined + : { + builder: Builders.BuildUnitTest, + options: + options.testRunner === TestRunner.Vitest + ? {} + : { + runner: 'karma', + }, }, - }, }, }; @@ -358,16 +402,21 @@ function getComponentOptions(options: ApplicationOptions): Partial { expect(_extends).toBe('../../tsconfig.json'); }); + it('should set the right types in the tsconfig.spec.json when testRunner is karma', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { ...defaultOptions, testRunner: 'karma' }, + workspaceTree, + ); + + const { + compilerOptions: { types }, + } = readJsonFile(tree, '/projects/foo/tsconfig.spec.json'); + expect(types).toEqual(['jasmine']); + }); + it('should add project references in the root tsconfig.json', async () => { const tree = await schematicRunner.runSchematic('application', defaultOptions, workspaceTree); @@ -268,6 +281,86 @@ describe('Application Schematic', () => { expect(pkg.devDependencies['typescript']).toEqual(latestVersions['typescript']); }); + it('should include zone.js if "zoneless" option is false', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + zoneless: false, + }, + workspaceTree, + ); + + const pkg = JSON.parse(tree.readContent('/package.json')); + expect(pkg.dependencies['zone.js']).toEqual(latestVersions['zone.js']); + }); + + it('should add "less" to devDependencies when Less is selected as the style option', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + style: Style.Less, + }, + workspaceTree, + ); + + const pkg = JSON.parse(tree.readContent('/package.json')); + expect(pkg.devDependencies['less']).toEqual(latestVersions['less']); + }); + + it('should _not_ include zone.js if "zoneless" option is not present', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + zoneless: undefined, + }, + workspaceTree, + ); + + const pkg = JSON.parse(tree.readContent('/package.json')); + expect(pkg.dependencies['zone.js']).toBeUndefined(); + }); + + it('should not include zone.js if "zoneless" option is true', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + zoneless: true, + }, + workspaceTree, + ); + + const pkg = JSON.parse(tree.readContent('/package.json')); + expect(pkg.dependencies['zone.js']).toBeUndefined(); + }); + + it('should add karma dependencies when testRunner is karma', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + testRunner: 'karma', + }, + workspaceTree, + ); + + const pkg = JSON.parse(tree.readContent('/package.json')); + expect(pkg.devDependencies['karma']).toEqual(latestVersions['karma']); + expect(pkg.devDependencies['karma-chrome-launcher']).toEqual( + latestVersions['karma-chrome-launcher'], + ); + expect(pkg.devDependencies['karma-coverage']).toEqual(latestVersions['karma-coverage']); + expect(pkg.devDependencies['karma-jasmine']).toEqual(latestVersions['karma-jasmine']); + expect(pkg.devDependencies['karma-jasmine-html-reporter']).toEqual( + latestVersions['karma-jasmine-html-reporter'], + ); + expect(pkg.devDependencies['jasmine-core']).toEqual(latestVersions['jasmine-core']); + expect(pkg.devDependencies['@types/jasmine']).toEqual(latestVersions['@types/jasmine']); + }); + it(`should not override existing users dependencies`, async () => { const oldPackageJson = workspaceTree.readContent('package.json'); workspaceTree.overwrite( @@ -333,14 +426,8 @@ describe('Application Schematic', () => { expect(buildOpt.index).toBeUndefined(); expect(buildOpt.browser).toEqual('src/main.ts'); expect(buildOpt.assets).toEqual([{ 'glob': '**/*', 'input': 'public' }]); - expect(buildOpt.polyfills).toEqual(['zone.js']); + expect(buildOpt.polyfills).toBeUndefined(); expect(buildOpt.tsConfig).toEqual('tsconfig.app.json'); - - const testOpt = prj.architect.test.options; - expect(testOpt.tsConfig).toEqual('tsconfig.spec.json'); - expect(testOpt.karmaConfig).toBeUndefined(); - expect(testOpt.assets).toEqual([{ 'glob': '**/*', 'input': 'public' }]); - expect(testOpt.styles).toEqual(['src/styles.css']); }); it('should set values in angular.json correctly when using a style preprocessor', async () => { @@ -351,51 +438,21 @@ describe('Application Schematic', () => { const prj = config.projects.foo; const buildOpt = prj.architect.build.options; expect(buildOpt.styles).toEqual(['src/styles.sass']); - const testOpt = prj.architect.test.options; - expect(testOpt.styles).toEqual(['src/styles.sass']); expect(tree.exists('src/styles.sass')).toBe(true); }); - it('sets "inlineStyleLanguage" in angular.json when using a style preprocessor', async () => { - const options = { ...defaultOptions, projectRoot: '', style: Style.Sass }; - const tree = await schematicRunner.runSchematic('application', options, workspaceTree); - - const config = JSON.parse(tree.readContent('/angular.json')); - const prj = config.projects.foo; - - const buildOpt = prj.architect.build.options; - expect(buildOpt.inlineStyleLanguage).toBe('sass'); - - const testOpt = prj.architect.test.options; - expect(testOpt.inlineStyleLanguage).toBe('sass'); - }); - - it('does not set "inlineStyleLanguage" in angular.json when not using a style preprocessor', async () => { - const options = { ...defaultOptions, projectRoot: '' }; - const tree = await schematicRunner.runSchematic('application', options, workspaceTree); - - const config = JSON.parse(tree.readContent('/angular.json')); - const prj = config.projects.foo; - - const buildOpt = prj.architect.build.options; - expect(buildOpt.inlineStyleLanguage).toBeUndefined(); - - const testOpt = prj.architect.test.options; - expect(testOpt.inlineStyleLanguage).toBeUndefined(); - }); - - it('does not set "inlineStyleLanguage" in angular.json when using CSS styles', async () => { - const options = { ...defaultOptions, projectRoot: '', style: Style.Css }; + it('should set values in angular.json correctly when testRunner is karma', async () => { + const options = { ...defaultOptions, projectRoot: '', testRunner: TestRunner.Karma }; const tree = await schematicRunner.runSchematic('application', options, workspaceTree); const config = JSON.parse(tree.readContent('/angular.json')); const prj = config.projects.foo; - - const buildOpt = prj.architect.build.options; - expect(buildOpt.inlineStyleLanguage).toBeUndefined(); - - const testOpt = prj.architect.test.options; - expect(testOpt.inlineStyleLanguage).toBeUndefined(); + const testOpt = prj.architect.test; + expect(testOpt.builder).toEqual('@angular/build:unit-test'); + expect(testOpt.options.runner).toEqual('karma'); + expect(testOpt.options.tsConfig).toBeUndefined(); + expect(testOpt.options.assets).toBeUndefined(); + expect(testOpt.options.styles).toBeUndefined(); }); it('should set the relative tsconfig paths', async () => { @@ -422,16 +479,10 @@ describe('Application Schematic', () => { expect(project.root).toEqual('foo'); const buildOpt = project.architect.build.options; expect(buildOpt.browser).toEqual('foo/src/main.ts'); - expect(buildOpt.polyfills).toEqual(['zone.js']); + expect(buildOpt.polyfills).toBeUndefined(); expect(buildOpt.tsConfig).toEqual('foo/tsconfig.app.json'); expect(buildOpt.assets).toEqual([{ 'glob': '**/*', 'input': 'foo/public' }]); - const testOpt = project.architect.test.options; - expect(testOpt.tsConfig).toEqual('foo/tsconfig.spec.json'); - expect(testOpt.karmaConfig).toBeUndefined(); - expect(testOpt.assets).toEqual([{ 'glob': '**/*', 'input': 'foo/public' }]); - expect(testOpt.styles).toEqual(['foo/src/styles.css']); - const appTsConfig = readJsonFile(tree, '/foo/tsconfig.app.json'); expect(appTsConfig.extends).toEqual('../tsconfig.json'); const specTsConfig = readJsonFile(tree, '/foo/tsconfig.spec.json'); @@ -594,8 +645,8 @@ describe('Application Schematic', () => { expect(moduleFiles.length).toEqual(0); }); - it('should enable zone event coalescing by default', async () => { - const options = { ...defaultOptions, standalone: true }; + it('should enable zone event coalescing by default for zone.js apps', async () => { + const options = { ...defaultOptions, standalone: true, zoneless: false }; const tree = await schematicRunner.runSchematic('application', options, workspaceTree); const appConfig = tree.readContent('/projects/foo/src/app/app.config.ts'); @@ -636,12 +687,13 @@ describe('Application Schematic', () => { }); describe('standalone=false', () => { - it('should add the ngZoneEventCoalescing option by default', async () => { + it('should add the ngZoneEventCoalescing option by default with zone.js apps', async () => { const tree = await schematicRunner.runSchematic( 'application', { ...defaultOptions, standalone: false, + zoneless: false, }, workspaceTree, ); @@ -744,7 +796,7 @@ describe('Application Schematic', () => { ); }); - it('should add provideZonelessChangeDetection() in app-module.ts when zoneless is true', async () => { + it('should not add provideZonelessChangeDetection() in app-module.ts when zoneless is true', async () => { const tree = await schematicRunner.runSchematic( 'application', { @@ -756,25 +808,10 @@ describe('Application Schematic', () => { ); const path = '/projects/foo/src/app/app-module.ts'; const fileContent = tree.readContent(path); - expect(fileContent).toContain('provideZonelessChangeDetection()'); - }); - - it('should not add provideZonelessChangeDetection() in app-module.ts when zoneless is false', async () => { - const tree = await schematicRunner.runSchematic( - 'application', - { - ...defaultOptions, - zoneless: false, - standalone: false, - }, - workspaceTree, - ); - const path = '/projects/foo/src/app/app-module.ts'; - const fileContent = tree.readContent(path); expect(fileContent).not.toContain('provideZonelessChangeDetection()'); }); - it('should add provideZonelessChangeDetection() when zoneless is true', async () => { + it('should not add any change detection provider when zoneless is true', async () => { const tree = await schematicRunner.runSchematic( 'application', { @@ -785,35 +822,123 @@ describe('Application Schematic', () => { ); const path = '/projects/foo/src/app/app.config.ts'; const fileContent = tree.readContent(path); - expect(fileContent).toContain('provideZonelessChangeDetection()'); + expect(fileContent).not.toMatch(/provideZone(less)?ChangeDetection/gi); }); + }); - it('should not add provideZonelessChangeDetection() when zoneless is false', async () => { - const tree = await schematicRunner.runSchematic( - 'application', - { - ...defaultOptions, - zoneless: false, - }, - workspaceTree, - ); - const path = '/projects/foo/src/app/app.config.ts'; - const fileContent = tree.readContent(path); - expect(fileContent).not.toContain('provideZonelessChangeDetection()'); + it('should add fixture.whenStable() when zoneless application', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + }, + workspaceTree, + ); + + const content = tree.readContent('/projects/foo/src/app/app.spec.ts'); + expect(content).toContain('fixture.whenStable()'); + expect(content).not.toContain('fixture.detectChanges()'); + }); + + it('should not add fixture.whenStable() in initial spec files when its not zoneless application', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { + ...defaultOptions, + zoneless: false, + }, + workspaceTree, + ); + + const content = tree.readContent('/projects/foo/src/app/app.spec.ts'); + expect(content).not.toContain('fixture.whenStable()'); + expect(content).toContain('fixture.detectChanges()'); + }); + + it('should call the tailwind schematic when style is tailwind', async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const options = { ...defaultOptions, style: 'tailwind' as any }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + + expect(tree.exists('/projects/foo/.postcssrc.json')).toBe(true); + + const packageJson = JSON.parse(tree.readContent('/package.json')); + expect(packageJson.devDependencies['tailwindcss']).toBeDefined(); + expect(packageJson.devDependencies['postcss']).toBeDefined(); + expect(packageJson.devDependencies['@tailwindcss/postcss']).toBeDefined(); + + const stylesContent = tree.readContent('/projects/foo/src/styles.css'); + expect(stylesContent).toContain('@import "tailwindcss";'); + }); + + describe(`fileNameStyleGuide: '2016'`, () => { + it('should create a component with the correct template and style urls', async () => { + const options = { ...defaultOptions, fileNameStyleGuide: '2016' as const }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const component = tree.readContent('/projects/foo/src/app/app.component.ts'); + const main = tree.readContent('/projects/foo/src/main.ts'); + expect(component).toContain(`templateUrl: './app.component.html'`); + expect(component).toContain(`styleUrl: './app.component.css'`); + expect(main).toContain(`import { App } from './app/app.component'`); }); - it('should not add provideZoneChangeDetection when zoneless is true', async () => { - const tree = await schematicRunner.runSchematic( - 'application', - { + it('should create a test file with import from the path without suffix', async () => { + const options = { ...defaultOptions, fileNameStyleGuide: '2016' as const }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const componentSpec = tree.readContent('/projects/foo/src/app/app.component.spec.ts'); + expect(componentSpec).toContain(`import { App } from './app.component'`); + }); + + describe('standalone: false', () => { + it('should create a component with the correct template and style urls', async () => { + const options = { ...defaultOptions, - zoneless: true, - }, - workspaceTree, - ); - const path = '/projects/foo/src/app/app.config.ts'; - const fileContent = tree.readContent(path); - expect(fileContent).not.toContain('provideZoneChangeDetection'); + standalone: false, + fileNameStyleGuide: '2016' as const, + }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const component = tree.readContent('/projects/foo/src/app/app.component.ts'); + expect(component).toContain(`templateUrl: './app.component.html'`); + expect(component).toContain(`styleUrl: './app.component.css'`); + }); + + it('should create a test file with import from the path without suffix', async () => { + const options = { + ...defaultOptions, + standalone: false, + fileNameStyleGuide: '2016' as const, + }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const componentSpec = tree.readContent('/projects/foo/src/app/app.component.spec.ts'); + expect(componentSpec).toContain(`import { App } from './app.component'`); + }); + + it('should create a module with the correct suffix', async () => { + const options = { + ...defaultOptions, + standalone: false, + fileNameStyleGuide: '2016' as const, + }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const module = tree.readContent('/projects/foo/src/app/app.module.ts'); + const main = tree.readContent('/projects/foo/src/main.ts'); + expect(module).toContain(`import { App } from './app.component'`); + expect(main).toContain(`import { AppModule } from './app/app.module'`); + }); + + it('should create a routing module with the correct suffix', async () => { + const options = { + ...defaultOptions, + standalone: false, + routing: true, + fileNameStyleGuide: '2016' as const, + }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const module = tree.readContent('/projects/foo/src/app/app.module.ts'); + const routingModule = tree.readContent('/projects/foo/src/app/app-routing.module.ts'); + expect(routingModule).toBeDefined(); + expect(module).toContain(`import { AppRoutingModule } from './app-routing.module'`); + }); }); }); }); diff --git a/packages/schematics/angular/application/schema.json b/packages/schematics/angular/application/schema.json index 85952ef00e3c..f047232c23cc 100644 --- a/packages/schematics/angular/application/schema.json +++ b/packages/schematics/angular/application/schema.json @@ -54,15 +54,19 @@ "description": "The type of stylesheet files to be created for components in the application.", "type": "string", "default": "css", - "enum": ["css", "scss", "sass", "less"], + "enum": ["css", "scss", "sass", "less", "tailwind"], "x-prompt": { - "message": "Which stylesheet format would you like to use?", + "message": "Which stylesheet system would you like to use?", "type": "list", "items": [ { "value": "css", "label": "CSS [ https://developer.mozilla.org/docs/Web/CSS ]" }, + { + "value": "tailwind", + "label": "Tailwind CSS [ https://tailwindcss.com ]" + }, { "value": "scss", "label": "Sass (SCSS) [ https://sass-lang.com/documentation/syntax#scss ]" @@ -85,6 +89,12 @@ "default": false, "alias": "S" }, + "testRunner": { + "description": "The unit testing runner to use.", + "type": "string", + "enum": ["vitest", "karma"], + "default": "vitest" + }, "skipPackageJson": { "type": "boolean", "default": false, @@ -120,9 +130,14 @@ }, "zoneless": { "description": "Generate an application that does not use `zone.js`.", - "x-prompt": "Do you want to create a 'zoneless' application without zone.js (Developer Preview)?", "type": "boolean", - "default": false + "default": true + }, + "fileNameStyleGuide": { + "type": "string", + "enum": ["2016", "2025"], + "default": "2025", + "description": "The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., `app.ts` for the root component), while the '2016' style guide includes the type in the file name (e.g., `app.component.ts`). For more information, see the Angular Style Guide (https://angular.dev/style-guide)." } }, "required": ["name"] diff --git a/packages/schematics/angular/collection.json b/packages/schematics/angular/collection.json index 5f691819544f..8d876cf7cb5b 100755 --- a/packages/schematics/angular/collection.json +++ b/packages/schematics/angular/collection.json @@ -131,6 +131,24 @@ "factory": "./config", "schema": "./config/schema.json", "description": "Generates a configuration file." + }, + "ai-config": { + "factory": "./ai-config", + "schema": "./ai-config/schema.json", + "description": "Generates an AI tool configuration file." + }, + "tailwind": { + "factory": "./tailwind", + "schema": "./tailwind/schema.json", + "hidden": true, + "private": true, + "description": "[INTERNAL] Adds tailwind to a project. Intended for use for ng new/add." + }, + "refactor-jasmine-vitest": { + "factory": "./refactor/jasmine-vitest", + "schema": "./refactor/jasmine-vitest/schema.json", + "description": "[EXPERIMENTAL] Refactors Jasmine tests to use Vitest APIs.", + "hidden": true } } } diff --git a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template index 070ef601b634..74d858ea1e64 100644 --- a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template +++ b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import <% if(!exportDefault) { %>{ <% }%><%= classify(name) %><%= classify(type) %> <% if(!exportDefault) {%>} <% }%>from './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>'; +import <% if(!exportDefault) { %>{ <% }%><%= classifiedName %> <% if(!exportDefault) {%>} <% }%>from './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>'; -describe('<%= classify(name) %><%= classify(type) %>', () => { - let component: <%= classify(name) %><%= classify(type) %>; - let fixture: ComponentFixture<<%= classify(name) %><%= classify(type) %>>; +describe('<%= classifiedName %>', () => { + let component: <%= classifiedName %>; + let fixture: ComponentFixture<<%= classifiedName %>>; beforeEach(async () => { await TestBed.configureTestingModule({ - <%= standalone ? 'imports' : 'declarations' %>: [<%= classify(name) %><%= classify(type) %>] + <%= standalone ? 'imports' : 'declarations' %>: [<%= classifiedName %>] }) .compileComponents(); - fixture = TestBed.createComponent(<%= classify(name) %><%= classify(type) %>); + fixture = TestBed.createComponent(<%= classifiedName %>); component = fixture.componentInstance; - fixture.detectChanges(); + <%= zoneless ? 'await fixture.whenStable();' : 'fixture.detectChanges();' %> }); it('should create', () => { diff --git a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template index b4810e6a24e0..dcea9394edb8 100644 --- a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +++ b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template @@ -8,17 +8,17 @@ import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%

<%= dasherize(name) %> works!

- `<% } else { %> - templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html'<% } if(inlineStyle) { %>, + `,<% } else { %> + templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html',<% } if(inlineStyle) { %> styles: `<% if(displayBlock){ %> :host { display: block; } - <% } %>`<% } else if (style !== 'none') { %>, - styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>'<% } %><% if(!!viewEncapsulation) { %>, - encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>, - changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %> + <% } %>`,<% } else if (style !== 'none') { %> + styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>',<% } %><% if(!!viewEncapsulation) { %> + encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } if (changeDetection !== 'Default') { %> + changeDetection: ChangeDetectionStrategy.<%= changeDetection %>,<% } %> }) -export <% if(exportDefault) {%>default <%}%>class <%= classify(name) %><%= classify(type) %> { +export <% if(exportDefault) {%>default <%}%>class <%= classifiedName %> { } diff --git a/packages/schematics/angular/component/index.ts b/packages/schematics/angular/component/index.ts index acbb82fadca6..1a07f69d1a15 100644 --- a/packages/schematics/angular/component/index.ts +++ b/packages/schematics/angular/component/index.ts @@ -8,9 +8,7 @@ import { FileOperator, - Rule, - SchematicsException, - Tree, + RuleFactory, apply, applyTemplates, chain, @@ -25,8 +23,10 @@ import { import { addDeclarationToNgModule } from '../utility/add-declaration-to-ng-module'; import { findModuleFromOptions } from '../utility/find-module'; import { parseName } from '../utility/parse-name'; +import { createProjectSchematic } from '../utility/project'; +import { isZonelessApp } from '../utility/project-targets'; import { validateClassName, validateHtmlSelector } from '../utility/validation'; -import { buildDefaultPath, getWorkspace } from '../utility/workspace'; +import { buildDefaultPath } from '../utility/workspace'; import { Schema as ComponentOptions, Style } from './schema'; function buildSelector(options: ComponentOptions, projectPrefix: string) { @@ -40,29 +40,13 @@ function buildSelector(options: ComponentOptions, projectPrefix: string) { return selector; } -export default function (options: ComponentOptions): Rule { - return async (host: Tree) => { - const workspace = await getWorkspace(host); - const project = workspace.projects.get(options.project); - - if (!project) { - throw new SchematicsException(`Project "${options.project}" does not exist.`); - } - +const componentSchematic: RuleFactory = createProjectSchematic( + (options, { project, tree }) => { if (options.path === undefined) { options.path = buildDefaultPath(project); } - try { - options.module = findModuleFromOptions(host, options); - } catch { - options.module = findModuleFromOptions(host, { - ...options, - moduleExt: '-module.ts', - routingModuleExt: '-routing-module.ts', - }); - } - + options.module = findModuleFromOptions(tree, options); // Schematic templates require a defined type value options.type ??= ''; @@ -73,7 +57,12 @@ export default function (options: ComponentOptions): Rule { options.selector || buildSelector(options, (project && project.prefix) || ''); validateHtmlSelector(options.selector); - validateClassName(strings.classify(options.name)); + + const classifiedName = + strings.classify(options.name) + + (options.addTypeToClassName && options.type ? strings.classify(options.type) : ''); + validateClassName(classifiedName); + const zoneless = isZonelessApp(project); const skipStyleFile = options.inlineStyle || options.style === Style.None; const templateSource = apply(url('./files'), [ @@ -85,6 +74,9 @@ export default function (options: ComponentOptions): Rule { 'if-flat': (s: string) => (options.flat ? '' : s), 'ngext': options.ngHtml ? '.ng' : '', ...options, + // Add a new variable for the classified name, conditionally including the type + classifiedName, + zoneless, }), !options.type ? forEach(((file) => { @@ -106,5 +98,7 @@ export default function (options: ComponentOptions): Rule { }), mergeWith(templateSource), ]); - }; -} + }, +); + +export default componentSchematic; diff --git a/packages/schematics/angular/component/index_spec.ts b/packages/schematics/angular/component/index_spec.ts index 9140dfcba43f..3aea03309e12 100644 --- a/packages/schematics/angular/component/index_spec.ts +++ b/packages/schematics/angular/component/index_spec.ts @@ -163,7 +163,7 @@ describe('Component Schematic', () => { await expectAsync( schematicRunner.runSchematic('component', options, appTree), - ).toBeRejectedWithError('Class name "404" is invalid.'); + ).toBeRejectedWithError('Class name "404Component" is invalid.'); }); it('should allow dash in selector before a number', async () => { @@ -554,4 +554,38 @@ describe('Component Schematic', () => { const specContent = tree.readContent('/projects/bar/src/app/foo/foo.component.spec.ts'); expect(specContent).toContain("import { FooComponent } from './foo.component';"); }); + + it('should add fixture.whenStable() in spec file when zoneless and standalone apps', async () => { + const tree = await schematicRunner.runSchematic('component', { ...defaultOptions }, appTree); + const tsContent = tree.readContent('/projects/bar/src/app/foo/foo.component.spec.ts'); + + expect(tsContent).toContain('fixture.whenStable()'); + expect(tsContent).not.toContain('fixture.detectChanges()'); + }); + + describe('with zone.js application', () => { + const zoneAppOptions: ApplicationOptions = { + ...appOptions, + name: 'baz', + zoneless: false, + }; + + it('should add not fixture.whenStable() in spec file for standalone', async () => { + appTree = await schematicRunner.runSchematic( + 'application', + { ...zoneAppOptions, standalone: true }, + appTree, + ); + const tree = await schematicRunner.runSchematic( + 'component', + { ...defaultOptions, standalone: true, project: 'baz' }, + appTree, + ); + + const tsContent = tree.readContent('/projects/baz/src/app/foo/foo.component.spec.ts'); + + expect(tsContent).not.toContain('fixture.whenStable()'); + expect(tsContent).toContain('fixture.detectChanges()'); + }); + }); }); diff --git a/packages/schematics/angular/component/schema.json b/packages/schematics/angular/component/schema.json index dfbc702f451e..eaa2c95f197b 100644 --- a/packages/schematics/angular/component/schema.json +++ b/packages/schematics/angular/component/schema.json @@ -24,7 +24,7 @@ }, "name": { "type": "string", - "description": "The name for the new component. This will be used to create the component's class, template, and stylesheet files. For example, if you provide `my-component`, the files will be named `my-component.component.ts`, `my-component.component.html`, and `my-component.component.css`.", + "description": "The name for the new component. This will be used to create the component's class, template, and stylesheet files. For example, if you provide `my-component`, the files will be named `my-component.ts`, `my-component.html`, and `my-component.css`.", "$default": { "$source": "argv", "index": 0 @@ -38,14 +38,14 @@ "alias": "b" }, "inlineStyle": { - "description": "Include the component's styles directly in the `component.ts` file. By default, a separate stylesheet file (e.g., `my-component.component.css`) is created.", + "description": "Include the component's styles directly in the `component.ts` file. By default, a separate stylesheet file (e.g., `my-component.css`) is created.", "type": "boolean", "default": false, "alias": "s", "x-user-analytics": "ep.ng_inline_style" }, "inlineTemplate": { - "description": "Include the component's HTML template directly in the `component.ts` file. By default, a separate template file (e.g., `my-component.component.html`) is created.", + "description": "Include the component's HTML template directly in the `component.ts` file. By default, a separate template file (e.g., `my-component.html`) is created.", "type": "boolean", "default": false, "alias": "t", @@ -95,6 +95,11 @@ "type": "string", "description": "Append a custom type to the component's filename. For example, if you set the type to `container`, the file will be named `my-component.container.ts`." }, + "addTypeToClassName": { + "type": "boolean", + "default": true, + "description": "When true, the 'type' option will be appended to the generated class name. When false, only the file name will include the type." + }, "skipTests": { "type": "boolean", "description": "Skip the generation of unit test files `spec.ts`.", diff --git a/packages/schematics/angular/config/files/.browserslistrc.template b/packages/schematics/angular/config/files/.browserslistrc.template index d11dabc56bdf..fdd9ef8d946c 100644 --- a/packages/schematics/angular/config/files/.browserslistrc.template +++ b/packages/schematics/angular/config/files/.browserslistrc.template @@ -8,4 +8,4 @@ # You can see what browsers were selected by your queries by running: # npx browserslist -<%= config %> +baseline widely available on <%= baselineDate %> diff --git a/packages/schematics/angular/config/files/vitest-base.config.ts.template b/packages/schematics/angular/config/files/vitest-base.config.ts.template new file mode 100644 index 000000000000..1f5a2340af39 --- /dev/null +++ b/packages/schematics/angular/config/files/vitest-base.config.ts.template @@ -0,0 +1,9 @@ +// Learn more about Vitest configuration options at https://vitest.dev/config/ + +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + // ... + }, +}); diff --git a/packages/schematics/angular/config/index.ts b/packages/schematics/angular/config/index.ts index 5878bd8c498a..73818699a134 100644 --- a/packages/schematics/angular/config/index.ts +++ b/packages/schematics/angular/config/index.ts @@ -8,6 +8,7 @@ import { Rule, + RuleFactory, SchematicsException, apply, applyTemplates, @@ -17,89 +18,182 @@ import { strings, url, } from '@angular-devkit/schematics'; -import { readFile } from 'node:fs/promises'; import { posix as path } from 'node:path'; import { relativePathToWorkspaceRoot } from '../utility/paths'; -import { getWorkspace as readWorkspace, updateWorkspace } from '../utility/workspace'; +import { createProjectSchematic } from '../utility/project'; +import { updateWorkspace } from '../utility/workspace'; import { Builders as AngularBuilder } from '../utility/workspace-models'; import { Schema as ConfigOptions, Type as ConfigType } from './schema'; -export default function (options: ConfigOptions): Rule { - switch (options.type) { - case ConfigType.Karma: - return addKarmaConfig(options); - case ConfigType.Browserslist: - return addBrowserslistConfig(options); - default: - throw new SchematicsException(`"${options.type}" is an unknown configuration file type.`); - } -} - -function addBrowserslistConfig(options: ConfigOptions): Rule { - return async (host) => { - const workspace = await readWorkspace(host); - const project = workspace.projects.get(options.project); - if (!project) { - throw new SchematicsException(`Project name "${options.project}" doesn't not exist.`); +const configSchematic: RuleFactory = createProjectSchematic( + (options, { project }) => { + switch (options.type) { + case ConfigType.Karma: + return addKarmaConfig(options); + case ConfigType.Browserslist: + return addBrowserslistConfig(project.root); + case ConfigType.Vitest: + return addVitestConfig(options); + default: + throw new SchematicsException(`"${options.type}" is an unknown configuration file type.`); } + }, +); + +export default configSchematic; + +function addVitestConfig(options: ConfigOptions): Rule { + return (tree, context) => + updateWorkspace((workspace) => { + const project = workspace.projects.get(options.project); + if (!project) { + throw new SchematicsException(`Project name "${options.project}" doesn't not exist.`); + } + + const testTarget = project.targets.get('test'); + if (!testTarget) { + throw new SchematicsException( + `No "test" target found for project "${options.project}".` + + ' A "test" target is required to generate a Vitest configuration.', + ); + } + + if (testTarget.builder !== AngularBuilder.BuildUnitTest) { + throw new SchematicsException( + `Cannot add a Vitest configuration as builder for "test" target in project does not` + + ` use "${AngularBuilder.BuildUnitTest}".`, + ); + } - // Read Angular's default vendored `.browserslistrc` file. - const config = await readFile(path.join(__dirname, '.browserslistrc'), 'utf8'); - - return mergeWith( - apply(url('./files'), [ - filter((p) => p.endsWith('.browserslistrc.template')), - applyTemplates({ config }), - move(project.root), - ]), - ); - }; + testTarget.options ??= {}; + testTarget.options.runnerConfig = true; + + // Check runner option. + if (testTarget.options.runner === 'karma') { + context.logger.warn( + `The "test" target is configured to use the "karma" runner in the main options.` + + ' The generated "vitest-base.config.ts" file may not be used.', + ); + } + + for (const [name, config] of Object.entries(testTarget.configurations ?? {})) { + if ( + config && + typeof config === 'object' && + 'runner' in config && + config.runner === 'karma' + ) { + context.logger.warn( + `The "test" target's "${name}" configuration is configured to use the "karma" runner.` + + ' The generated "vitest-base.config.ts" file may not be used for that configuration.', + ); + } + } + + return mergeWith( + apply(url('./files'), [ + filter((p) => p.endsWith('vitest-base.config.ts.template')), + applyTemplates({}), + move(project.root), + ]), + ); + }); +} + +async function addBrowserslistConfig(projectRoot: string): Promise { + return mergeWith( + apply(url('./files'), [ + filter((p) => p.endsWith('.browserslistrc.template')), + // The below is replaced by bazel `npm_package`. + applyTemplates({ baselineDate: 'BASELINE-DATE-PLACEHOLDER' }), + move(projectRoot), + ]), + ); } function addKarmaConfig(options: ConfigOptions): Rule { - return updateWorkspace((workspace) => { - const project = workspace.projects.get(options.project); - if (!project) { - throw new SchematicsException(`Project name "${options.project}" doesn't not exist.`); - } + return (_, context) => + updateWorkspace((workspace) => { + const project = workspace.projects.get(options.project); + if (!project) { + throw new SchematicsException(`Project name "${options.project}" doesn't not exist.`); + } - const testTarget = project.targets.get('test'); - if (!testTarget) { - throw new SchematicsException( - `No "test" target found for project "${options.project}".` + - ' A "test" target is required to generate a karma configuration.', - ); - } + const testTarget = project.targets.get('test'); + if (!testTarget) { + throw new SchematicsException( + `No "test" target found for project "${options.project}".` + + ' A "test" target is required to generate a karma configuration.', + ); + } - if ( - testTarget.builder !== AngularBuilder.Karma && - testTarget.builder !== AngularBuilder.BuildKarma - ) { - throw new SchematicsException( - `Cannot add a karma configuration as builder for "test" target in project does not` + - ` use "${AngularBuilder.Karma}" or "${AngularBuilder.BuildKarma}".`, - ); - } + if ( + testTarget.builder !== AngularBuilder.Karma && + testTarget.builder !== AngularBuilder.BuildKarma && + testTarget.builder !== AngularBuilder.BuildUnitTest + ) { + throw new SchematicsException( + `Cannot add a karma configuration as builder for "test" target in project does not` + + ` use "${AngularBuilder.Karma}", "${AngularBuilder.BuildKarma}", or ${AngularBuilder.BuildUnitTest}.`, + ); + } - testTarget.options ??= {}; - testTarget.options.karmaConfig = path.join(project.root, 'karma.conf.js'); + testTarget.options ??= {}; + if (testTarget.builder !== AngularBuilder.BuildUnitTest) { + testTarget.options.karmaConfig = path.join(project.root, 'karma.conf.js'); + } else { + // `unit-test` uses the `runnerConfig` option which has configuration discovery if enabled + testTarget.options.runnerConfig = true; - // If scoped project (i.e. "@foo/bar"), convert dir to "foo/bar". - let folderName = options.project.startsWith('@') ? options.project.slice(1) : options.project; - if (/[A-Z]/.test(folderName)) { - folderName = strings.dasherize(folderName); - } + let isKarmaRunnerConfigured = false; + // Check runner option + if (testTarget.options.runner) { + if (testTarget.options.runner === 'karma') { + isKarmaRunnerConfigured = true; + } else { + context.logger.warn( + `The "test" target is configured to use a runner other than "karma" in the main options.` + + ' The generated "karma.conf.js" file may not be used.', + ); + } + } + + for (const [name, config] of Object.entries(testTarget.configurations ?? {})) { + if (config && typeof config === 'object' && 'runner' in config) { + if (config.runner !== 'karma') { + context.logger.warn( + `The "test" target's "${name}" configuration is configured to use a runner other than "karma".` + + ' The generated "karma.conf.js" file may not be used for that configuration.', + ); + } else { + isKarmaRunnerConfigured = true; + } + } + } - return mergeWith( - apply(url('./files'), [ - filter((p) => p.endsWith('karma.conf.js.template')), - applyTemplates({ - relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(project.root), - folderName, - needDevkitPlugin: testTarget.builder === AngularBuilder.Karma, - }), - move(project.root), - ]), - ); - }); + if (!isKarmaRunnerConfigured) { + context.logger.warn( + `The "test" target is not explicitly configured to use the "karma" runner.` + + ' The generated "karma.conf.js" file may not be used as the default runner is "vitest".', + ); + } + } + // If scoped project (i.e. "@foo/bar"), convert dir to "foo/bar". + let folderName = options.project.startsWith('@') ? options.project.slice(1) : options.project; + if (/[A-Z]/.test(folderName)) { + folderName = strings.dasherize(folderName); + } + + return mergeWith( + apply(url('./files'), [ + filter((p) => p.endsWith('karma.conf.js.template')), + applyTemplates({ + relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(project.root), + folderName, + needDevkitPlugin: testTarget.builder === AngularBuilder.Karma, + }), + move(project.root), + ]), + ); + }); } diff --git a/packages/schematics/angular/config/index_spec.ts b/packages/schematics/angular/config/index_spec.ts index c9349bcb609d..bc1715c4866a 100644 --- a/packages/schematics/angular/config/index_spec.ts +++ b/packages/schematics/angular/config/index_spec.ts @@ -50,6 +50,12 @@ describe('Config Schematic', () => { defaultAppOptions, workspaceTree, ); + + // Set builder to a karma builder for testing purposes + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson['projects']['foo']['architect']['test']['builder'] = '@angular/build:karma'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); }); describe(`when 'type' is 'karma'`, () => { @@ -89,12 +95,168 @@ describe('Config Schematic', () => { const { karmaConfig } = prj.architect.test.options; expect(karmaConfig).toBe('projects/foo/karma.conf.js'); }); + + describe('with "unit-test" builder', () => { + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.builder = '@angular/build:unit-test'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + }); + + it(`should not set 'karmaConfig' in test builder`, async () => { + const tree = await runConfigSchematic(ConfigType.Karma); + const config = JSON.parse(tree.readContent('/angular.json')); + const prj = config.projects.foo; + const { karmaConfig } = prj.architect.test.options; + expect(karmaConfig).toBeUndefined(); + }); + + it(`should warn when 'runner' is not specified`, async () => { + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Karma); + expect( + logs.some((v) => v.includes('may not be used as the default runner is "vitest"')), + ).toBeTrue(); + }); + + it(`should warn when 'runner' is 'vitest' in options`, async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.options ??= {}; + angularJson.projects.foo.architect.test.options.runner = 'vitest'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Karma); + expect( + logs.some((v) => v.includes('runner other than "karma" in the main options')), + ).toBeTrue(); + }); + + it(`should warn when 'runner' is 'vitest' in a configuration`, async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.configurations ??= {}; + angularJson.projects.foo.architect.test.configurations.ci = { runner: 'vitest' }; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Karma); + expect( + logs.some((v) => v.includes(`"ci" configuration is configured to use a runner`)), + ).toBeTrue(); + }); + + it(`should not warn when 'runner' is 'karma' in options`, async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.options ??= {}; + angularJson.projects.foo.architect.test.options.runner = 'karma'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Karma); + expect(logs.length).toBe(0); + }); + + it(`should not warn when 'runner' is 'karma' in a configuration`, async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.configurations ??= {}; + angularJson.projects.foo.architect.test.configurations.ci = { runner: 'karma' }; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Karma); + expect(logs.length).toBe(0); + }); + }); }); describe(`when 'type' is 'browserslist'`, () => { it('should create a .browserslistrc file', async () => { const tree = await runConfigSchematic(ConfigType.Browserslist); - expect(tree.readContent('projects/foo/.browserslistrc')).toContain('Chrome >='); + expect(tree.exists('projects/foo/.browserslistrc')).toBeTrue(); + }); + }); + + describe(`when 'type' is 'vitest'`, () => { + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.builder = '@angular/build:unit-test'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + }); + + it('should create a vitest-base.config.ts file', async () => { + const tree = await runConfigSchematic(ConfigType.Vitest); + expect(tree.exists('projects/foo/vitest-base.config.ts')).toBeTrue(); + }); + + it(`should set 'runnerConfig' in test builder`, async () => { + const tree = await runConfigSchematic(ConfigType.Vitest); + const config = JSON.parse(tree.readContent('/angular.json')); + const prj = config.projects.foo; + const { runnerConfig } = prj.architect.test.options; + expect(runnerConfig).toBe(true); + }); + + it('should throw an error if the builder is not "unit-test"', async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.builder = '@angular/build:karma'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + await expectAsync(runConfigSchematic(ConfigType.Vitest)).toBeRejectedWithError( + /Cannot add a Vitest configuration as builder for "test" target/, + ); + }); + + it(`should warn when 'runner' is 'karma' in options`, async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.options ??= {}; + angularJson.projects.foo.architect.test.options.runner = 'karma'; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Vitest); + expect( + logs.some((v) => + v.includes( + `The "test" target is configured to use the "karma" runner in the main options.`, + ), + ), + ).toBeTrue(); + }); + + it(`should warn when 'runner' is 'karma' in a configuration`, async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const angularJson = applicationTree.readJson('angular.json') as any; + angularJson.projects.foo.architect.test.configurations ??= {}; + angularJson.projects.foo.architect.test.configurations.ci = { runner: 'karma' }; + applicationTree.overwrite('angular.json', JSON.stringify(angularJson)); + + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Vitest); + expect( + logs.some((v) => v.includes(`"ci" configuration is configured to use the "karma" runner`)), + ).toBeTrue(); + }); + + it(`should not warn when 'runner' is not set`, async () => { + const logs: string[] = []; + schematicRunner.logger.subscribe(({ message }) => logs.push(message)); + await runConfigSchematic(ConfigType.Vitest); + expect(logs.length).toBe(0); }); }); }); diff --git a/packages/schematics/angular/config/schema.json b/packages/schematics/angular/config/schema.json index 14bb34f07260..dd755e5ac6ae 100644 --- a/packages/schematics/angular/config/schema.json +++ b/packages/schematics/angular/config/schema.json @@ -16,7 +16,7 @@ "type": { "type": "string", "description": "Specifies the type of configuration file to generate.", - "enum": ["karma", "browserslist"], + "enum": ["karma", "browserslist", "vitest"], "x-prompt": "Which type of configuration file would you like to create?", "$default": { "$source": "argv", diff --git a/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.spec.ts.template b/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.spec.ts.template index 59bddc63660a..b6bc80e99be6 100644 --- a/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.spec.ts.template +++ b/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.spec.ts.template @@ -1,8 +1,8 @@ -import { <%= classify(name) %><%= classify(type) %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>'; +import { <%= classifiedName %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>'; -describe('<%= classify(name) %><%= classify(type) %>', () => { +describe('<%= classifiedName %>', () => { it('should create an instance', () => { - const directive = new <%= classify(name) %><%= classify(type) %>(); + const directive = new <%= classifiedName %>(); expect(directive).toBeTruthy(); }); }); diff --git a/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.ts.template b/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.ts.template index 4e55f9d19e6b..624b3cafbec1 100644 --- a/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.ts.template +++ b/packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.ts.template @@ -1,10 +1,10 @@ import { Directive } from '@angular/core'; @Directive({ - selector: '[<%= selector %>]'<% if(!standalone) {%>, - standalone: false<%}%> + selector: '[<%= selector %>]',<% if(!standalone) {%> + standalone: false,<%}%> }) -export class <%= classify(name) %><%= classify(type) %> { +export class <%= classifiedName %> { constructor() { } diff --git a/packages/schematics/angular/directive/index.ts b/packages/schematics/angular/directive/index.ts index e05c64ca9e5b..72aa73b6a219 100644 --- a/packages/schematics/angular/directive/index.ts +++ b/packages/schematics/angular/directive/index.ts @@ -6,13 +6,14 @@ * found in the LICENSE file at https://angular.dev/license */ -import { Rule, SchematicsException, Tree, chain, strings } from '@angular-devkit/schematics'; +import { RuleFactory, chain, strings } from '@angular-devkit/schematics'; import { addDeclarationToNgModule } from '../utility/add-declaration-to-ng-module'; import { findModuleFromOptions } from '../utility/find-module'; import { generateFromFiles } from '../utility/generate-from-files'; import { parseName } from '../utility/parse-name'; +import { createProjectSchematic } from '../utility/project'; import { validateClassName, validateHtmlSelector } from '../utility/validation'; -import { buildDefaultPath, getWorkspace } from '../utility/workspace'; +import { buildDefaultPath } from '../utility/workspace'; import { Schema as DirectiveOptions } from './schema'; function buildSelector(options: DirectiveOptions, projectPrefix: string) { @@ -26,34 +27,23 @@ function buildSelector(options: DirectiveOptions, projectPrefix: string) { return strings.camelize(selector); } -export default function (options: DirectiveOptions): Rule { - return async (host: Tree) => { - const workspace = await getWorkspace(host); - const project = workspace.projects.get(options.project); - if (!project) { - throw new SchematicsException(`Project "${options.project}" does not exist.`); - } - +const directiveSchematic: RuleFactory = createProjectSchematic( + (options, { project, tree }) => { if (options.path === undefined) { options.path = buildDefaultPath(project); } - try { - options.module = findModuleFromOptions(host, options); - } catch { - options.module = findModuleFromOptions(host, { - ...options, - moduleExt: '-module.ts', - routingModuleExt: '-routing-module.ts', - }); - } + options.module = findModuleFromOptions(tree, options); const parsedPath = parseName(options.path, options.name); options.name = parsedPath.name; options.path = parsedPath.path; options.selector = options.selector || buildSelector(options, project.prefix || ''); validateHtmlSelector(options.selector); - validateClassName(strings.classify(options.name)); + const classifiedName = + strings.classify(options.name) + + (options.addTypeToClassName && options.type ? strings.classify(options.type) : ''); + validateClassName(classifiedName); return chain([ addDeclarationToNgModule({ @@ -61,7 +51,12 @@ export default function (options: DirectiveOptions): Rule { ...options, }), - generateFromFiles(options), + generateFromFiles({ + ...options, + classifiedName, + }), ]); - }; -} + }, +); + +export default directiveSchematic; diff --git a/packages/schematics/angular/directive/index_spec.ts b/packages/schematics/angular/directive/index_spec.ts index e5dd8dd058df..870d8f0c78e0 100644 --- a/packages/schematics/angular/directive/index_spec.ts +++ b/packages/schematics/angular/directive/index_spec.ts @@ -137,6 +137,35 @@ describe('Directive Schematic', () => { expect(testContent).toContain("describe('Foo'"); }); + it('should not add type to class name when addTypeToClassName is false', async () => { + const options = { ...defaultOptions, type: 'Directive', addTypeToClassName: false }; + const tree = await schematicRunner.runSchematic('directive', options, appTree); + const content = tree.readContent('/projects/bar/src/app/foo.directive.ts'); + const testContent = tree.readContent('/projects/bar/src/app/foo.directive.spec.ts'); + expect(content).toContain('export class Foo {'); + expect(content).not.toContain('export class FooDirective {'); + expect(testContent).toContain("describe('Foo', () => {"); + expect(testContent).not.toContain("describe('FooDirective', () => {"); + }); + + it('should add type to class name when addTypeToClassName is true', async () => { + const options = { ...defaultOptions, type: 'Directive', addTypeToClassName: true }; + const tree = await schematicRunner.runSchematic('directive', options, appTree); + const content = tree.readContent('/projects/bar/src/app/foo.directive.ts'); + const testContent = tree.readContent('/projects/bar/src/app/foo.directive.spec.ts'); + expect(content).toContain('export class FooDirective {'); + expect(testContent).toContain("describe('FooDirective', () => {"); + }); + + it('should add type to class name by default', async () => { + const options = { ...defaultOptions, type: 'Directive', addTypeToClassName: undefined }; + const tree = await schematicRunner.runSchematic('directive', options, appTree); + const content = tree.readContent('/projects/bar/src/app/foo.directive.ts'); + const testContent = tree.readContent('/projects/bar/src/app/foo.directive.spec.ts'); + expect(content).toContain('export class FooDirective {'); + expect(testContent).toContain("describe('FooDirective', () => {"); + }); + describe('standalone=false', () => { const defaultNonStandaloneOptions: DirectiveOptions = { ...defaultOptions, diff --git a/packages/schematics/angular/directive/schema.json b/packages/schematics/angular/directive/schema.json index 4a4041604fb0..6d672fc4fdeb 100644 --- a/packages/schematics/angular/directive/schema.json +++ b/packages/schematics/angular/directive/schema.json @@ -84,6 +84,11 @@ "type": { "type": "string", "description": "Append a custom type to the directive's filename. For example, if you set the type to `directive`, the file will be named `example.directive.ts`." + }, + "addTypeToClassName": { + "type": "boolean", + "default": true, + "description": "When true, the 'type' option will be appended to the generated class name. When false, only the file name will include the type." } }, "required": ["name", "project"] diff --git a/packages/schematics/angular/environments/index_spec.ts b/packages/schematics/angular/environments/index_spec.ts index 3db69c5d866c..d53026a28a4d 100644 --- a/packages/schematics/angular/environments/index_spec.ts +++ b/packages/schematics/angular/environments/index_spec.ts @@ -50,7 +50,7 @@ describe('Environments Schematic', () => { build.builder = Builders.Browser; build.options = { ...build.options, - main: build.options.browser, + main: 'projects/foo/src/main.ts', browser: undefined, }; diff --git a/packages/schematics/angular/guard/implements-files/__name@dasherize____typeSeparator__guard.ts.template b/packages/schematics/angular/guard/implements-files/__name@dasherize____typeSeparator__guard.ts.template index 918718d3e468..3ce1150879da 100644 --- a/packages/schematics/angular/guard/implements-files/__name@dasherize____typeSeparator__guard.ts.template +++ b/packages/schematics/angular/guard/implements-files/__name@dasherize____typeSeparator__guard.ts.template @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { <%= routerImports %> } from '@angular/router'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class <%= classify(name) %>Guard implements <%= implementations %> { <% if (implements.includes('CanActivate')) { %>canActivate( diff --git a/packages/schematics/angular/library/files/tsconfig.lib.json.template b/packages/schematics/angular/library/files/tsconfig.lib.json.template index 79a2168d3492..779ab5549814 100644 --- a/packages/schematics/angular/library/files/tsconfig.lib.json.template +++ b/packages/schematics/angular/library/files/tsconfig.lib.json.template @@ -6,7 +6,6 @@ "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/lib", "declaration": true, "declarationMap": true, - "inlineSources": true, "types": [] }, "include": [ diff --git a/packages/schematics/angular/library/files/tsconfig.spec.json.template b/packages/schematics/angular/library/files/tsconfig.spec.json.template index 11ab3b8614ff..b2370befce4f 100644 --- a/packages/schematics/angular/library/files/tsconfig.spec.json.template +++ b/packages/schematics/angular/library/files/tsconfig.spec.json.template @@ -5,10 +5,11 @@ "compilerOptions": { "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/spec", "types": [ - "jasmine" + "<%= testTypesPackage %>" ] }, "include": [ - "src/**/*.ts" + "src/**/*.d.ts", + "src/**/*<% if (standalone) { %>.spec<% } %>.ts" ] } diff --git a/packages/schematics/angular/library/index.ts b/packages/schematics/angular/library/index.ts index b409d986dd57..3069664c02d7 100644 --- a/packages/schematics/angular/library/index.ts +++ b/packages/schematics/angular/library/index.ts @@ -8,7 +8,6 @@ import { Rule, - SchematicContext, Tree, apply, applyTemplates, @@ -20,15 +19,28 @@ import { strings, url, } from '@angular-devkit/schematics'; -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import { join } from 'node:path/posix'; -import { NodeDependencyType, addPackageJsonDependency } from '../utility/dependencies'; +import { addTestRunnerDependencies } from '../utility/dependencies'; +import { + DependencyType, + ExistingBehavior, + InstallBehavior, + addDependency, + getDependency, +} from '../utility/dependency'; import { JSONFile } from '../utility/json-file'; import { latestVersions } from '../utility/latest-versions'; import { relativePathToWorkspaceRoot } from '../utility/paths'; import { getWorkspace, updateWorkspace } from '../utility/workspace'; import { Builders, ProjectType } from '../utility/workspace-models'; -import { Schema as LibraryOptions } from './schema'; +import { Schema as LibraryOptions, TestRunner } from './schema'; + +const LIBRARY_DEV_DEPENDENCIES = [ + { name: '@angular/compiler-cli', version: latestVersions.Angular }, + { name: '@angular/build', version: latestVersions.AngularBuild }, + { name: 'ng-packagr', version: latestVersions.NgPackagr }, + { name: 'typescript', version: latestVersions['typescript'] }, +]; function updateTsConfig(packageName: string, ...paths: string[]) { return (host: Tree) => { @@ -58,44 +70,29 @@ function addTsProjectReference(...paths: string[]) { }; } -function addDependenciesToPackageJson() { - return (host: Tree) => { - [ - { - type: NodeDependencyType.Dev, - name: '@angular/compiler-cli', - version: latestVersions.Angular, - }, - { - type: NodeDependencyType.Dev, - name: '@angular/build', - version: latestVersions.AngularBuild, - }, - { - type: NodeDependencyType.Dev, - name: 'ng-packagr', - version: latestVersions.NgPackagr, - }, - { - type: NodeDependencyType.Default, - name: 'tslib', - version: latestVersions['tslib'], - }, - { - type: NodeDependencyType.Dev, - name: 'typescript', - version: latestVersions['typescript'], - }, - ].forEach((dependency) => addPackageJsonDependency(host, dependency)); - - return host; - }; +function addDependenciesToPackageJson({ skipInstall, testRunner }: LibraryOptions): Rule { + return chain([ + ...LIBRARY_DEV_DEPENDENCIES.map((dependency) => + addDependency(dependency.name, dependency.version, { + type: DependencyType.Dev, + existing: ExistingBehavior.Skip, + install: skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ), + ...addTestRunnerDependencies(testRunner, !!skipInstall), + addDependency('tslib', latestVersions['tslib'], { + type: DependencyType.Default, + existing: ExistingBehavior.Skip, + install: skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ]); } function addLibToWorkspaceFile( options: LibraryOptions, projectRoot: string, projectName: string, + hasZoneDependency: boolean, ): Rule { return updateWorkspace((workspace) => { workspace.projects.add({ @@ -117,13 +114,21 @@ function addLibToWorkspaceFile( }, }, }, - test: { - builder: Builders.BuildKarma, - options: { - tsConfig: `${projectRoot}/tsconfig.spec.json`, - polyfills: ['zone.js', 'zone.js/testing'], - }, - }, + test: + options.testRunner === TestRunner.Vitest + ? { + builder: Builders.BuildUnitTest, + options: { + tsConfig: `${projectRoot}/tsconfig.spec.json`, + }, + } + : { + builder: Builders.BuildKarma, + options: { + tsConfig: `${projectRoot}/tsconfig.spec.json`, + polyfills: hasZoneDependency ? ['zone.js', 'zone.js/testing'] : undefined, + }, + }, }, }); }); @@ -168,14 +173,17 @@ export default function (options: LibraryOptions): Rule { angularLatestVersion: latestVersions.Angular.replace(/~|\^/, ''), tsLibLatestVersion: latestVersions['tslib'].replace(/~|\^/, ''), folderName, + testTypesPackage: options.testRunner === TestRunner.Vitest ? 'vitest/globals' : 'jasmine', }), move(libDir), ]); + const hasZoneDependency = getDependency(host, 'zone.js') !== null; + return chain([ mergeWith(templateSource), - addLibToWorkspaceFile(options, libDir, packageName), - options.skipPackageJson ? noop() : addDependenciesToPackageJson(), + addLibToWorkspaceFile(options, libDir, packageName, hasZoneDependency), + options.skipPackageJson ? noop() : addDependenciesToPackageJson(options), options.skipTsConfig ? noop() : updateTsConfig(packageName, './' + distRoot), options.skipTsConfig ? noop() @@ -191,6 +199,9 @@ export default function (options: LibraryOptions): Rule { flat: true, path: sourceDir, project: packageName, + // Explicitly set the `typeSeparator` this also ensures that the generated files are valid even if the `module` schematic + // inherits its `typeSeparator` from the workspace. + typeSeparator: '-', }), schematic('component', { name: options.name, @@ -207,11 +218,6 @@ export default function (options: LibraryOptions): Rule { // inherits its `type` from the workspace. type: '', }), - (_tree: Tree, context: SchematicContext) => { - if (!options.skipPackageJson && !options.skipInstall) { - context.addTask(new NodePackageInstallTask()); - } - }, ]); }; } diff --git a/packages/schematics/angular/library/index_spec.ts b/packages/schematics/angular/library/index_spec.ts index 1d5503d70b38..bf4f8714294e 100644 --- a/packages/schematics/angular/library/index_spec.ts +++ b/packages/schematics/angular/library/index_spec.ts @@ -8,7 +8,6 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; import { parse as parseJson } from 'jsonc-parser'; -import { getFileContent } from '../../angular/utility/test'; import { Schema as ComponentOptions } from '../component/schema'; import { latestVersions } from '../utility/latest-versions'; import { Schema as WorkspaceOptions } from '../workspace/schema'; @@ -16,7 +15,7 @@ import { Schema as GenerateLibrarySchema } from './schema'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function getJsonFileContent(tree: UnitTestTree, path: string): any { - return parseJson(tree.readContent(path).toString()); + return tree.readJson(path); } describe('Library Schematic', () => { @@ -119,7 +118,7 @@ describe('Library Schematic', () => { it('should create a package.json named "foo"', async () => { const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree); - const fileContent = getFileContent(tree, '/projects/foo/package.json'); + const fileContent = tree.readText('/projects/foo/package.json'); expect(fileContent).toMatch(/"name": "foo"/); }); @@ -134,14 +133,14 @@ describe('Library Schematic', () => { it('should add sideEffects: false flag to package.json named "foo"', async () => { const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree); - const fileContent = getFileContent(tree, '/projects/foo/package.json'); + const fileContent = tree.readText('/projects/foo/package.json'); expect(fileContent).toMatch(/"sideEffects": false/); }); it('should create a README.md named "foo"', async () => { const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree); - const fileContent = getFileContent(tree, '/projects/foo/README.md'); + const fileContent = tree.readText('/projects/foo/README.md'); expect(fileContent).toMatch(/# Foo/); }); @@ -195,6 +194,13 @@ describe('Library Schematic', () => { expect(workspace.projects.foo.prefix).toEqual('pre'); }); + it(`should not add zone.js to test polyfills when no zone.js dependency`, async () => { + const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree); + + const workspace = getJsonFileContent(tree, '/angular.json'); + expect(workspace.projects.foo.architect.test.options.polyfills).toBeUndefined(); + }); + it('should handle a pascalCasedName', async () => { const options = { ...defaultOptions, name: 'pascalCasedName' }; const tree = await schematicRunner.runSchematic('library', options, workspaceTree); @@ -401,11 +407,22 @@ describe('Library Schematic', () => { expect(workspace.projects.foo.architect.build.builder).toBe('@angular/build:ng-packagr'); }); - it(`should add 'karma' test builder`, async () => { + it(`should add 'unit-test' test builder`, async () => { + const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree); + + const workspace = JSON.parse(tree.readContent('/angular.json')); + expect(workspace.projects.foo.architect.test.builder).toBe('@angular/build:unit-test'); + }); + + it(`should add 'unit-test' test builder`, async () => { + const packageJson = getJsonFileContent(workspaceTree, 'package.json'); + packageJson['devDependencies']['vitest'] = '^4.0.0'; + workspaceTree.overwrite('package.json', JSON.stringify(packageJson)); + const tree = await schematicRunner.runSchematic('library', defaultOptions, workspaceTree); const workspace = JSON.parse(tree.readContent('/angular.json')); - expect(workspace.projects.foo.architect.test.builder).toBe('@angular/build:karma'); + expect(workspace.projects.foo.architect.test.builder).toBe('@angular/build:unit-test'); }); describe('standalone=false', () => { @@ -418,7 +435,7 @@ describe('Library Schematic', () => { workspaceTree, ); - const fileContent = getFileContent(tree, '/projects/foo/src/lib/foo-module.ts'); + const fileContent = tree.readText('/projects/foo/src/lib/foo-module.ts'); expect(fileContent).toMatch(/exports: \[\n(\s*) {2}Foo\n\1\]/); }); diff --git a/packages/schematics/angular/library/schema.json b/packages/schematics/angular/library/schema.json index 62ffdbb422a0..bb3d227e5245 100644 --- a/packages/schematics/angular/library/schema.json +++ b/packages/schematics/angular/library/schema.json @@ -53,6 +53,12 @@ "type": "boolean", "default": true, "x-user-analytics": "ep.ng_standalone" + }, + "testRunner": { + "description": "The unit testing runner to use.", + "type": "string", + "enum": ["vitest", "karma"], + "default": "vitest" } }, "required": ["name"] diff --git a/packages/schematics/angular/migrations/karma/karma-config-analyzer.ts b/packages/schematics/angular/migrations/karma/karma-config-analyzer.ts new file mode 100644 index 000000000000..cd9d18c12c3d --- /dev/null +++ b/packages/schematics/angular/migrations/karma/karma-config-analyzer.ts @@ -0,0 +1,168 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; + +export interface RequireInfo { + module: string; + export?: string; + isCall?: boolean; + arguments?: KarmaConfigValue[]; +} + +export type KarmaConfigValue = + | string + | boolean + | number + | KarmaConfigValue[] + | { [key: string]: KarmaConfigValue } + | RequireInfo + | undefined; + +export interface KarmaConfigAnalysis { + settings: Map; + hasUnsupportedValues: boolean; +} + +function isRequireInfo(value: KarmaConfigValue): value is RequireInfo { + return typeof value === 'object' && value !== null && !Array.isArray(value) && 'module' in value; +} + +function isSupportedPropertyAssignment( + prop: ts.ObjectLiteralElementLike, +): prop is ts.PropertyAssignment & { name: ts.Identifier | ts.StringLiteral } { + return ( + ts.isPropertyAssignment(prop) && (ts.isIdentifier(prop.name) || ts.isStringLiteral(prop.name)) + ); +} + +/** + * Analyzes the content of a Karma configuration file to extract its settings. + * + * @param content The string content of the `karma.conf.js` file. + * @returns An object containing the configuration settings and a flag indicating if unsupported values were found. + */ +export function analyzeKarmaConfig(content: string): KarmaConfigAnalysis { + const sourceFile = ts.createSourceFile('karma.conf.js', content, ts.ScriptTarget.Latest, true); + const settings = new Map(); + let hasUnsupportedValues = false; + + function visit(node: ts.Node) { + // The Karma configuration is defined within a `config.set({ ... })` call. + if ( + ts.isCallExpression(node) && + ts.isPropertyAccessExpression(node.expression) && + node.expression.expression.getText(sourceFile) === 'config' && + node.expression.name.text === 'set' && + node.arguments.length === 1 && + ts.isObjectLiteralExpression(node.arguments[0]) + ) { + // We found `config.set`, now we extract the properties from the object literal. + for (const prop of node.arguments[0].properties) { + if (isSupportedPropertyAssignment(prop)) { + const key = prop.name.text; + const value = extractValue(prop.initializer); + settings.set(key, value); + } else { + hasUnsupportedValues = true; + } + } + } else { + ts.forEachChild(node, visit); + } + } + + function extractValue(node: ts.Expression): KarmaConfigValue { + switch (node.kind) { + case ts.SyntaxKind.StringLiteral: + return (node as ts.StringLiteral).text; + case ts.SyntaxKind.NumericLiteral: + return Number((node as ts.NumericLiteral).text); + case ts.SyntaxKind.TrueKeyword: + return true; + case ts.SyntaxKind.FalseKeyword: + return false; + case ts.SyntaxKind.Identifier: { + const identifier = (node as ts.Identifier).text; + if (identifier === '__dirname' || identifier === '__filename') { + return identifier; + } + break; + } + case ts.SyntaxKind.CallExpression: { + const callExpr = node as ts.CallExpression; + // Handle require('...') + if ( + ts.isIdentifier(callExpr.expression) && + callExpr.expression.text === 'require' && + callExpr.arguments.length === 1 && + ts.isStringLiteral(callExpr.arguments[0]) + ) { + return { module: callExpr.arguments[0].text }; + } + + // Handle calls on a require, e.g. require('path').join() + const calleeValue = extractValue(callExpr.expression); + if (isRequireInfo(calleeValue)) { + return { + ...calleeValue, + isCall: true, + arguments: callExpr.arguments.map(extractValue), + }; + } + break; + } + case ts.SyntaxKind.PropertyAccessExpression: { + const propAccessExpr = node as ts.PropertyAccessExpression; + + // Handle config constants like `config.LOG_INFO` + if ( + ts.isIdentifier(propAccessExpr.expression) && + propAccessExpr.expression.text === 'config' + ) { + return `config.${propAccessExpr.name.text}`; + } + + const value = extractValue(propAccessExpr.expression); + if (isRequireInfo(value)) { + const currentExport = value.export + ? `${value.export}.${propAccessExpr.name.text}` + : propAccessExpr.name.text; + + return { ...value, export: currentExport }; + } + break; + } + case ts.SyntaxKind.ArrayLiteralExpression: + return (node as ts.ArrayLiteralExpression).elements.map(extractValue); + case ts.SyntaxKind.ObjectLiteralExpression: { + const obj: { [key: string]: KarmaConfigValue } = {}; + for (const prop of (node as ts.ObjectLiteralExpression).properties) { + if (isSupportedPropertyAssignment(prop)) { + // Recursively extract values for nested objects. + obj[prop.name.text] = extractValue(prop.initializer); + } else { + hasUnsupportedValues = true; + } + } + + return obj; + } + } + + // For complex expressions (like variables) that we don't need to resolve, + // we mark the analysis as potentially incomplete. + hasUnsupportedValues = true; + + return undefined; + } + + visit(sourceFile); + + return { settings, hasUnsupportedValues }; +} diff --git a/packages/schematics/angular/migrations/karma/karma-config-analyzer_spec.ts b/packages/schematics/angular/migrations/karma/karma-config-analyzer_spec.ts new file mode 100644 index 000000000000..79af125c8690 --- /dev/null +++ b/packages/schematics/angular/migrations/karma/karma-config-analyzer_spec.ts @@ -0,0 +1,296 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { RequireInfo, analyzeKarmaConfig } from './karma-config-analyzer'; +import { generateDefaultKarmaConfig } from './karma-config-comparer'; + +describe('Karma Config Analyzer', () => { + it('should parse a basic karma config file', () => { + const karmaConf = ` + module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma'), + ], + client: { + clearContext: false, // leave Jasmine Spec Runner output visible in browser + }, + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/test-project'), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true, + }); + }; + `; + + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + expect(settings.get('basePath') as unknown).toBe(''); + expect(settings.get('frameworks') as unknown).toEqual([ + 'jasmine', + '@angular-devkit/build-angular', + ]); + expect(settings.get('port') as unknown).toBe(9876); + expect(settings.get('autoWatch') as boolean).toBe(true); + expect(settings.get('singleRun') as boolean).toBe(false); + expect(settings.get('reporters') as unknown).toEqual(['progress', 'kjhtml']); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const plugins = settings.get('plugins') as any[]; + expect(plugins).toBeInstanceOf(Array); + expect(plugins.length).toBe(5); + expect(plugins[0]).toEqual({ module: 'karma-jasmine' }); + expect(plugins[4]).toEqual({ module: '@angular-devkit/build-angular/plugins/karma' }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const coverageReporter = settings.get('coverageReporter') as any; + const dirInfo = coverageReporter.dir as RequireInfo; + expect(dirInfo.module).toBe('path'); + expect(dirInfo.export).toBe('join'); + expect(dirInfo.isCall).toBe(true); + expect(dirInfo.arguments as unknown).toEqual(['__dirname', './coverage/test-project']); + + expect(settings.get('logLevel') as unknown).toBe('config.LOG_INFO'); + expect(hasUnsupportedValues).toBe(false); + }); + + it('should return an empty map for an empty config file', () => { + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(''); + + expect(settings.size).toBe(0); + expect(hasUnsupportedValues).toBe(false); + }); + + it('should handle a config file with no config.set call', () => { + const karmaConf = ` + module.exports = function (config) { + // No config.set call + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + expect(settings.size).toBe(0); + expect(hasUnsupportedValues).toBe(false); + }); + + it('should detect unsupported values like variables', () => { + const karmaConf = ` + const myBrowsers = ['Chrome', 'Firefox']; + module.exports = function (config) { + config.set({ + browsers: myBrowsers, + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + expect(settings.get('browsers')).toBeUndefined(); + expect(hasUnsupportedValues).toBe(true); + }); + + it('should correctly parse require with nested exports', () => { + const karmaConf = ` + module.exports = function (config) { + config.set({ + reporter: require('some-plugin').reporter.type, + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + const reporter = settings.get('reporter') as RequireInfo; + expect(reporter.module).toBe('some-plugin'); + expect(reporter.export).toBe('reporter.type'); + expect(hasUnsupportedValues).toBe(false); + }); + + it('should handle an array with mixed values', () => { + const karmaConf = ` + module.exports = function (config) { + config.set({ + plugins: [ + 'karma-jasmine', + require('karma-chrome-launcher'), + true, + ], + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const plugins = settings.get('plugins') as any[]; + expect(plugins).toEqual(['karma-jasmine', { module: 'karma-chrome-launcher' }, true]); + expect(hasUnsupportedValues).toBe(false); + }); + + it('should not report unsupported values when all values are literals or requires', () => { + const karmaConf = ` + module.exports = function (config) { + config.set({ + autoWatch: true, + browsers: ['Chrome'], + plugins: [require('karma-jasmine')], + }); + }; + `; + const { hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + expect(hasUnsupportedValues).toBe(false); + }); + + it('should handle path.join with variables and flag as unsupported', () => { + const karmaConf = ` + const myPath = './coverage/test-project'; + module.exports = function (config) { + config.set({ + coverageReporter: { + dir: require('path').join(__dirname, myPath), + }, + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const coverageReporter = settings.get('coverageReporter') as any; + const dirInfo = coverageReporter.dir as RequireInfo; + expect(dirInfo.module).toBe('path'); + expect(dirInfo.export).toBe('join'); + expect(dirInfo.isCall).toBe(true); + expect(dirInfo.arguments as unknown).toEqual(['__dirname', undefined]); // myPath is a variable + expect(hasUnsupportedValues).toBe(true); + }); + + it('should correctly parse the default karma config template', async () => { + const defaultConfig = await generateDefaultKarmaConfig('..', 'test-project', true); + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(defaultConfig); + + expect(hasUnsupportedValues).toBe(false); + expect(settings.get('basePath') as unknown).toBe(''); + expect(settings.get('frameworks') as unknown).toEqual([ + 'jasmine', + '@angular-devkit/build-angular', + ]); + expect(settings.get('plugins') as unknown).toEqual([ + { module: 'karma-jasmine' }, + { module: 'karma-chrome-launcher' }, + { module: 'karma-jasmine-html-reporter' }, + { module: 'karma-coverage' }, + { module: '@angular-devkit/build-angular/plugins/karma' }, + ]); + expect(settings.get('client') as unknown).toEqual({ + jasmine: {}, + }); + expect(settings.get('jasmineHtmlReporter') as unknown).toEqual({ + suppressAll: true, + }); + const coverageReporter = settings.get('coverageReporter') as { + dir: RequireInfo; + subdir: string; + reporters: { type: string }[]; + }; + expect(coverageReporter.dir.module).toBe('path'); + expect(coverageReporter.dir.export).toBe('join'); + expect(coverageReporter.dir.isCall).toBe(true); + expect(coverageReporter.dir.arguments as unknown).toEqual([ + '__dirname', + '../coverage/test-project', + ]); + expect(coverageReporter.subdir).toBe('.'); + expect(coverageReporter.reporters).toEqual([{ type: 'html' }, { type: 'text-summary' }]); + expect(settings.get('reporters') as unknown).toEqual(['progress', 'kjhtml']); + expect(settings.get('browsers') as unknown).toEqual(['Chrome']); + expect(settings.get('restartOnFileChange') as unknown).toBe(true); + }); + + it('should correctly parse require with property access and a call', () => { + const karmaConf = ` + module.exports = function (config) { + config.set({ + reporter: require('some-plugin').reporter.doSomething(), + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + const reporter: RequireInfo = settings.get('reporter') as RequireInfo; + expect(reporter.module).toBe('some-plugin'); + expect(reporter.export).toBe('reporter.doSomething'); + expect(reporter.isCall).toBe(true); + expect(reporter.arguments?.length).toBe(0); + expect(hasUnsupportedValues).toBe(false); + }); + + it('should flag require with a variable as unsupported', () => { + const karmaConf = ` + const myPlugin = 'karma-jasmine'; + module.exports = function (config) { + config.set({ + plugins: [require(myPlugin)], + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + const plugins = settings.get('plugins') as unknown[]; + expect(plugins.length).toBe(1); + expect(plugins[0]).toBeUndefined(); + expect(hasUnsupportedValues).toBe(true); + }); + + it('should flag object with spread assignment as unsupported', () => { + const karmaConf = ` + const otherSettings = { basePath: '' }; + module.exports = function (config) { + config.set({ + ...otherSettings, + port: 9876, + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + expect(settings.get('port') as unknown).toBe(9876); + expect(settings.has('basePath')).toBe(false); + expect(hasUnsupportedValues).toBe(true); + }); + + it('should flag property with computed name as unsupported', () => { + const karmaConf = ` + const myKey = 'port'; + module.exports = function (config) { + config.set({ + [myKey]: 9876, + }); + }; + `; + const { settings, hasUnsupportedValues } = analyzeKarmaConfig(karmaConf); + + expect(settings.size).toBe(0); + expect(hasUnsupportedValues).toBe(true); + }); +}); diff --git a/packages/schematics/angular/migrations/karma/karma-config-comparer.ts b/packages/schematics/angular/migrations/karma/karma-config-comparer.ts new file mode 100644 index 000000000000..0c11a7196f1c --- /dev/null +++ b/packages/schematics/angular/migrations/karma/karma-config-comparer.ts @@ -0,0 +1,162 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { readFile } from 'node:fs/promises'; +import path from 'node:path/posix'; +import { isDeepStrictEqual } from 'node:util'; +import { relativePathToWorkspaceRoot } from '../../utility/paths'; +import { KarmaConfigAnalysis, KarmaConfigValue, analyzeKarmaConfig } from './karma-config-analyzer'; + +/** + * Represents the difference between two Karma configurations. + */ +export interface KarmaConfigDiff { + /** A map of settings that were added in the project's configuration. */ + added: Map; + + /** A map of settings that were removed from the project's configuration. */ + removed: Map; + + /** A map of settings that were modified between the two configurations. */ + modified: Map; + + /** A boolean indicating if the comparison is reliable (i.e., no unsupported values were found). */ + isReliable: boolean; +} + +/** + * Generates the default Karma configuration file content as a string. + * @param relativePathToWorkspaceRoot The relative path from the Karma config file to the workspace root. + * @param projectName The name of the project. + * @param needDevkitPlugin A boolean indicating if the devkit plugin is needed. + * @returns The content of the default `karma.conf.js` file. + */ +export async function generateDefaultKarmaConfig( + relativePathToWorkspaceRoot: string, + projectName: string, + needDevkitPlugin: boolean, +): Promise { + const templatePath = require.resolve('../../config/files/karma.conf.js.template'); + let template = await readFile(templatePath, 'utf-8'); + + // TODO: Replace this with the actual schematic templating logic. + template = template + .replace( + /<%= relativePathToWorkspaceRoot %>/g, + path.normalize(relativePathToWorkspaceRoot).replace(/\\/g, '/'), + ) + .replace(/<%= folderName %>/g, projectName); + + const devkitPluginRegex = /<% if \(needDevkitPlugin\) { %>(.*?)<% } %>/gs; + const replacement = needDevkitPlugin ? '$1' : ''; + template = template.replace(devkitPluginRegex, replacement); + + return template; +} + +/** + * Compares two Karma configuration analyses and returns the difference. + * @param projectAnalysis The analysis of the project's configuration. + * @param defaultAnalysis The analysis of the default configuration to compare against. + * @returns A diff object representing the changes between the two configurations. + */ +export function compareKarmaConfigs( + projectAnalysis: KarmaConfigAnalysis, + defaultAnalysis: KarmaConfigAnalysis, +): KarmaConfigDiff { + const added = new Map(); + const removed = new Map(); + const modified = new Map< + string, + { projectValue: KarmaConfigValue; defaultValue: KarmaConfigValue } + >(); + + const allKeys = new Set([...projectAnalysis.settings.keys(), ...defaultAnalysis.settings.keys()]); + + for (const key of allKeys) { + const projectValue = projectAnalysis.settings.get(key); + const defaultValue = defaultAnalysis.settings.get(key); + + if (projectValue !== undefined && defaultValue === undefined) { + added.set(key, projectValue); + } else if (projectValue === undefined && defaultValue !== undefined) { + removed.set(key, defaultValue); + } else if (projectValue !== undefined && defaultValue !== undefined) { + if (!isDeepStrictEqual(projectValue, defaultValue)) { + modified.set(key, { projectValue, defaultValue }); + } + } + } + + return { + added, + removed, + modified, + isReliable: !projectAnalysis.hasUnsupportedValues && !defaultAnalysis.hasUnsupportedValues, + }; +} + +/** + * Checks if there are any differences in the provided Karma configuration diff. + * @param diff The Karma configuration diff object to check. + * @returns True if there are any differences; false otherwise. + */ +export function hasDifferences(diff: KarmaConfigDiff): boolean { + return diff.added.size > 0 || diff.removed.size > 0 || diff.modified.size > 0; +} + +/** + * Compares a project's Karma configuration with the default configuration. + * @param projectConfigContent The content of the project's `karma.conf.js` file. + * @param projectRoot The root directory of the project. + * @param needDevkitPlugin A boolean indicating if the devkit plugin is needed for the default config. + * @param karmaConfigPath The path to the Karma configuration file, used to resolve relative paths. + * @returns A diff object representing the changes. + */ +export async function compareKarmaConfigToDefault( + projectConfigContent: string, + projectName: string, + karmaConfigPath: string, + needDevkitPlugin: boolean, +): Promise; + +/** + * Compares a project's Karma configuration with the default configuration. + * @param projectAnalysis The analysis of the project's configuration. + * @param projectRoot The root directory of the project. + * @param needDevkitPlugin A boolean indicating if the devkit plugin is needed for the default config. + * @param karmaConfigPath The path to the Karma configuration file, used to resolve relative paths. + * @returns A diff object representing the changes. + */ +export async function compareKarmaConfigToDefault( + projectAnalysis: KarmaConfigAnalysis, + projectName: string, + karmaConfigPath: string, + needDevkitPlugin: boolean, +): Promise; + +export async function compareKarmaConfigToDefault( + projectConfigOrAnalysis: string | KarmaConfigAnalysis, + projectName: string, + karmaConfigPath: string, + needDevkitPlugin: boolean, +): Promise { + const projectAnalysis = + typeof projectConfigOrAnalysis === 'string' + ? analyzeKarmaConfig(projectConfigOrAnalysis) + : projectConfigOrAnalysis; + + const defaultContent = await generateDefaultKarmaConfig( + relativePathToWorkspaceRoot(path.dirname(karmaConfigPath)), + projectName, + needDevkitPlugin, + ); + const defaultAnalysis = analyzeKarmaConfig(defaultContent); + + return compareKarmaConfigs(projectAnalysis, defaultAnalysis); +} diff --git a/packages/schematics/angular/migrations/karma/karma-config-comparer_spec.ts b/packages/schematics/angular/migrations/karma/karma-config-comparer_spec.ts new file mode 100644 index 000000000000..77fafdc4c2b5 --- /dev/null +++ b/packages/schematics/angular/migrations/karma/karma-config-comparer_spec.ts @@ -0,0 +1,307 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { KarmaConfigAnalysis, KarmaConfigValue, RequireInfo } from './karma-config-analyzer'; +import { + compareKarmaConfigToDefault, + compareKarmaConfigs, + generateDefaultKarmaConfig, +} from './karma-config-comparer'; + +describe('Karma Config Comparer', () => { + describe('compareKarmaConfigs', () => { + it('should find no differences for identical configs', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'valueA']]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'valueA']]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(0); + expect(diff.removed.size).toBe(0); + expect(diff.modified.size).toBe(0); + }); + + it('should detect added properties', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + ['propA', 'valueA'], + ['propB', 'valueB'], + ]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'valueA']]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(1); + expect(diff.added.get('propB') as unknown).toBe('valueB'); + expect(diff.removed.size).toBe(0); + expect(diff.modified.size).toBe(0); + }); + + it('should detect removed properties', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'valueA']]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + ['propA', 'valueA'], + ['propB', 'valueB'], + ]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(0); + expect(diff.removed.size).toBe(1); + expect(diff.removed.get('propB') as unknown).toBe('valueB'); + expect(diff.modified.size).toBe(0); + }); + + it('should detect modified properties', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'newValue']]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'oldValue']]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(0); + expect(diff.removed.size).toBe(0); + expect(diff.modified.size).toBe(1); + const modifiedProp = diff.modified.get('propA'); + expect(modifiedProp?.projectValue as unknown).toBe('newValue'); + expect(modifiedProp?.defaultValue as unknown).toBe('oldValue'); + }); + + it('should handle a mix of added, removed, and modified properties', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + ['propA', 'valueA'], // unchanged + ['propB', 'newValueB'], // modified + ['propC', 'valueC'], // added + ]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + ['propA', 'valueA'], + ['propB', 'oldValueB'], + ['propD', 'valueD'], // removed + ]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(1); + expect(diff.added.get('propC') as unknown).toBe('valueC'); + expect(diff.removed.size).toBe(1); + expect(diff.removed.get('propD') as unknown).toBe('valueD'); + expect(diff.modified.size).toBe(1); + const modifiedPropB = diff.modified.get('propB'); + expect(modifiedPropB?.projectValue as unknown).toBe('newValueB'); + expect(modifiedPropB?.defaultValue as unknown).toBe('oldValueB'); + }); + + it('should detect a modified require call', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([['plugin', { module: 'project-plugin' }]]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([['plugin', { module: 'default-plugin' }]]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.modified.size).toBe(1); + const modified = diff.modified.get('plugin'); + expect((modified?.projectValue as RequireInfo).module).toBe('project-plugin'); + expect((modified?.defaultValue as RequireInfo).module).toBe('default-plugin'); + }); + + it('should detect a modified path.join call', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + [ + 'coverageReporter', + { + dir: { + module: 'path', + export: 'join', + isCall: true, + arguments: ['__dirname', 'project-path'], + }, + }, + ], + ]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + [ + 'coverageReporter', + { + dir: { + module: 'path', + export: 'join', + isCall: true, + arguments: ['__dirname', 'default-path'], + }, + }, + ], + ]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.modified.size).toBe(1); + const modified = diff.modified.get('coverageReporter') as { + projectValue: { dir: RequireInfo }; + defaultValue: { dir: RequireInfo }; + }; + expect(modified?.projectValue.dir.arguments as string[]).toEqual([ + '__dirname', + 'project-path', + ]); + expect(modified?.defaultValue.dir.arguments as string[]).toEqual([ + '__dirname', + 'default-path', + ]); + }); + + it('should detect an added require call', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map([ + ['propA', 'valueA'], + ['newPlugin', { module: 'new-plugin' }], + ]), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map([['propA', 'valueA']]), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(1); + expect((diff.added.get('newPlugin') as RequireInfo).module).toBe('new-plugin'); + }); + + it('should flag the diff as unreliable if the project config has unsupported values', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map(), + hasUnsupportedValues: true, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map(), + hasUnsupportedValues: false, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(false); + }); + + it('should flag the diff as unreliable if the default config has unsupported values', () => { + const projectAnalysis: KarmaConfigAnalysis = { + settings: new Map(), + hasUnsupportedValues: false, + }; + const defaultAnalysis: KarmaConfigAnalysis = { + settings: new Map(), + hasUnsupportedValues: true, + }; + + const diff = compareKarmaConfigs(projectAnalysis, defaultAnalysis); + + expect(diff.isReliable).toBe(false); + }); + }); + + describe('compareKarmaConfigToDefault', () => { + let defaultConfig: string; + + beforeAll(async () => { + defaultConfig = await generateDefaultKarmaConfig('.', 'test-project', true); + }); + + it('should find no differences for the default config', async () => { + const diff = await compareKarmaConfigToDefault(defaultConfig, 'test-project', '', true); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(0); + expect(diff.removed.size).toBe(0); + expect(diff.modified.size).toBe(0); + }); + + it('should find differences for a modified config', async () => { + const modifiedConfig = defaultConfig + .replace(`restartOnFileChange: true`, `restartOnFileChange: false`) + .replace(`reporters: ['progress', 'kjhtml']`, `reporters: ['dots']`); + + const diff = await compareKarmaConfigToDefault(modifiedConfig, 'test-project', '', true); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(0); + expect(diff.removed.size).toBe(0); + expect(diff.modified.size).toBe(2); + const restartOnFileChange = diff.modified.get('restartOnFileChange'); + expect(restartOnFileChange?.projectValue as boolean).toBe(false); + expect(restartOnFileChange?.defaultValue as boolean).toBe(true); + const reporters = diff.modified.get('reporters'); + expect(reporters?.projectValue as string[]).toEqual(['dots']); + expect(reporters?.defaultValue as string[]).toEqual(['progress', 'kjhtml']); + }); + + it('should return an unreliable diff if the project config has unsupported values', async () => { + const modifiedConfig = defaultConfig.replace(`browsers: ['Chrome']`, `browsers: myBrowsers`); + const diff = await compareKarmaConfigToDefault(modifiedConfig, 'test-project', '', true); + + expect(diff.isReliable).toBe(false); + expect(diff.removed.has('browsers')).toBe(true); + }); + + it('should find no differences when devkit plugin is not needed', async () => { + const projectConfig = await generateDefaultKarmaConfig('.', 'test-project', false); + const diff = await compareKarmaConfigToDefault(projectConfig, 'test-project', '', false); + + expect(diff.isReliable).toBe(true); + expect(diff.added.size).toBe(0); + expect(diff.removed.size).toBe(0); + expect(diff.modified.size).toBe(0); + }); + }); +}); diff --git a/packages/schematics/angular/migrations/karma/migration.ts b/packages/schematics/angular/migrations/karma/migration.ts new file mode 100644 index 000000000000..ad9192ea432c --- /dev/null +++ b/packages/schematics/angular/migrations/karma/migration.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import type { Rule, Tree } from '@angular-devkit/schematics'; +import { allTargetOptions, updateWorkspace } from '../../utility/workspace'; +import { Builders } from '../../utility/workspace-models'; +import { analyzeKarmaConfig } from './karma-config-analyzer'; +import { compareKarmaConfigToDefault, hasDifferences } from './karma-config-comparer'; + +function updateProjects(tree: Tree): Rule { + return updateWorkspace(async (workspace) => { + const removableKarmaConfigs = new Map(); + + for (const [projectName, project] of workspace.projects) { + for (const [, target] of project.targets) { + let needDevkitPlugin = false; + switch (target.builder) { + case Builders.Karma: + needDevkitPlugin = true; + break; + case Builders.BuildKarma: + break; + default: + continue; + } + + for (const [, options] of allTargetOptions(target, false)) { + const karmaConfig = options['karmaConfig']; + if (typeof karmaConfig !== 'string') { + continue; + } + + let isRemovable = removableKarmaConfigs.get(karmaConfig); + if (isRemovable === undefined && tree.exists(karmaConfig)) { + const content = tree.readText(karmaConfig); + const analysis = analyzeKarmaConfig(content); + + if (analysis.hasUnsupportedValues) { + // Cannot safely determine if the file is removable. + isRemovable = false; + } else { + const diff = await compareKarmaConfigToDefault( + analysis, + projectName, + karmaConfig, + needDevkitPlugin, + ); + isRemovable = !hasDifferences(diff) && diff.isReliable; + } + + removableKarmaConfigs.set(karmaConfig, isRemovable); + + if (isRemovable) { + tree.delete(karmaConfig); + } + } + + if (isRemovable) { + delete options['karmaConfig']; + } + } + } + } + }); +} + +export default function (): Rule { + return updateProjects; +} diff --git a/packages/schematics/angular/migrations/karma/migration_spec.ts b/packages/schematics/angular/migrations/karma/migration_spec.ts new file mode 100644 index 000000000000..458267ff2ad8 --- /dev/null +++ b/packages/schematics/angular/migrations/karma/migration_spec.ts @@ -0,0 +1,458 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + +import { EmptyTree } from '@angular-devkit/schematics'; +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; +import { latestVersions } from '../../utility/latest-versions'; + +const DEFAULT_KARMA_CONFIG_WITH_DEVKIT = ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + jasmine: { + // you can add configuration options for Jasmine here + // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html + // for example, you can disable the random execution with \`random: false\` + // or set a specific seed with \`seed: 4321\` + }, + }, + jasmineHtmlReporter: { + suppressAll: true // removes the duplicated traces + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + restartOnFileChange: true + }); +}; +`; + +const DEFAULT_KARMA_CONFIG_NO_DEVKIT = ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage') + ], + client: { + jasmine: {}, + }, + jasmineHtmlReporter: { + suppressAll: true + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + restartOnFileChange: true + }); +}; +`; + +describe('Migration to remove default Karma configuration', () => { + const schematicRunner = new SchematicTestRunner( + 'migrations', + require.resolve('../migration-collection.json'), + ); + + let tree: UnitTestTree; + beforeEach(() => { + tree = new UnitTestTree(new EmptyTree()); + tree.create( + '/package.json', + JSON.stringify({ + devDependencies: { + '@angular-devkit/build-angular': latestVersions.DevkitBuildAngular, + }, + }), + ); + tree.create( + '/angular.json', + JSON.stringify({ + version: 1, + projects: { + app: { + root: '', + sourceRoot: 'src', + projectType: 'application', + targets: { + test: { + builder: '@angular-devkit/build-angular:karma', + options: { + karmaConfig: 'karma.conf.js', + }, + }, + }, + }, + }, + }), + ); + }); + + it('should delete default karma.conf.js and remove karmaConfig option', async () => { + tree.create('karma.conf.js', DEFAULT_KARMA_CONFIG_WITH_DEVKIT); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects } = newTree.readJson('/angular.json') as any; + expect(projects.app.targets.test.options.karmaConfig).toBeUndefined(); + expect(newTree.exists('karma.conf.js')).toBeFalse(); + }); + + it('should not delete modified karma.conf.js', async () => { + tree.create( + 'karma.conf.js', + ` +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + ], + reporters: ['progress'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + }); +}; +`, + ); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects } = newTree.readJson('/angular.json') as any; + expect(projects.app.targets.test.options.karmaConfig).toBe('karma.conf.js'); + expect(newTree.exists('karma.conf.js')).toBeTrue(); + }); + + it('should not delete karma.conf.js with unsupported values', async () => { + tree.create( + 'karma.conf.js', + ` +const myPlugin = require('my-plugin'); +module.exports = function (config) { + config.set({ + plugins: [myPlugin], + }); +}; +`, + ); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects } = newTree.readJson('/angular.json') as any; + expect(projects.app.targets.test.options.karmaConfig).toBe('karma.conf.js'); + expect(newTree.exists('karma.conf.js')).toBeTrue(); + }); + + it('should handle multiple projects referencing the same karma.conf.js', async () => { + let { projects } = tree.readJson('/angular.json') as any; + projects['app2'] = { + root: 'app2', + sourceRoot: 'app2/src', + projectType: 'application', + targets: { + test: { + builder: '@angular-devkit/build-angular:karma', + options: { + karmaConfig: 'karma.conf.js', + }, + }, + }, + }; + tree.overwrite('/angular.json', JSON.stringify({ version: 1, projects })); + tree.create('karma.conf.js', DEFAULT_KARMA_CONFIG_WITH_DEVKIT); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + projects = (newTree.readJson('/angular.json') as any).projects; + expect(projects.app.targets.test.options.karmaConfig).toBeUndefined(); + expect(projects.app2.targets.test.options.karmaConfig).toBeUndefined(); + expect(newTree.exists('karma.conf.js')).toBeFalse(); + }); + + it('should not error for a non-existent karma config file', async () => { + const { projects } = tree.readJson('/angular.json') as any; + projects.app.targets.test.options.karmaConfig = 'karma.non-existent.conf.js'; + tree.overwrite('/angular.json', JSON.stringify({ version: 1, projects })); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects: newProjects } = newTree.readJson('/angular.json') as any; + expect(newProjects.app.targets.test.options.karmaConfig).toBe('karma.non-existent.conf.js'); + }); + + it('should work for library projects', async () => { + const { projects } = tree.readJson('/angular.json') as any; + projects.app.projectType = 'library'; + tree.overwrite('/angular.json', JSON.stringify({ version: 1, projects })); + tree.create( + 'karma.conf.js', + // NOTE: The client block is slightly different in this test case. + ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + jasmine: {}, + }, + jasmineHtmlReporter: { + suppressAll: true + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + restartOnFileChange: true + }); +}; +`, + ); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects: newProjects } = newTree.readJson('/angular.json') as any; + expect(newProjects.app.targets.test.options.karmaConfig).toBeUndefined(); + expect(newTree.exists('karma.conf.js')).toBeFalse(); + }); + + it('should handle multiple configurations in the test target', async () => { + const { projects } = tree.readJson('/angular.json') as any; + projects.app.targets.test.configurations = { + ci: { + karmaConfig: 'karma.ci.conf.js', + }, + }; + tree.overwrite('/angular.json', JSON.stringify({ version: 1, projects })); + tree.create( + 'karma.conf.js', + // NOTE: The client block is slightly different in this test case. + ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + jasmine: {}, + }, + jasmineHtmlReporter: { + suppressAll: true + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + restartOnFileChange: true + }); +}; +`, + ); + tree.create( + 'karma.ci.conf.js', + ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + browsers: ['ChromeHeadless'], + }); +}; +`, + ); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects: newProjects } = newTree.readJson('/angular.json') as any; + expect(newProjects.app.targets.test.options.karmaConfig).toBeUndefined(); + expect(newProjects.app.targets.test.configurations.ci.karmaConfig).toBe('karma.ci.conf.js'); + expect(newTree.exists('karma.conf.js')).toBeFalse(); + expect(newTree.exists('karma.ci.conf.js')).toBeTrue(); + }); + + it('should handle karma config in a subdirectory', async () => { + const { projects } = tree.readJson('/angular.json') as any; + projects.app.targets.test.options.karmaConfig = 'src/karma.conf.js'; + tree.overwrite('/angular.json', JSON.stringify({ version: 1, projects })); + tree.create( + 'src/karma.conf.js', + ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + jasmine: {}, + }, + jasmineHtmlReporter: { + suppressAll: true + }, + coverageReporter: { + dir: require('path').join(__dirname, '../coverage/app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + restartOnFileChange: true + }); +}; +`, + ); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects: newProjects } = newTree.readJson('/angular.json') as any; + expect(newProjects.app.targets.test.options.karmaConfig).toBeUndefined(); + expect(newTree.exists('src/karma.conf.js')).toBeFalse(); + }); + + it('should not delete almost default karma.conf.js', async () => { + tree.create( + 'karma.conf.js', + ` +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + jasmine: {}, + }, + jasmineHtmlReporter: { + suppressAll: true + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + browsers: ['Chrome'], + restartOnFileChange: true, + singleRun: true + }); +}; +`, + ); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects } = newTree.readJson('/angular.json') as any; + expect(projects.app.targets.test.options.karmaConfig).toBe('karma.conf.js'); + expect(newTree.exists('karma.conf.js')).toBeTrue(); + }); + + it('should delete default karma.conf.js when devkit is not used', async () => { + tree.overwrite( + '/package.json', + JSON.stringify({ + devDependencies: { + '@angular/build': latestVersions.AngularBuild, + }, + }), + ); + const { projects } = tree.readJson('/angular.json') as any; + projects.app.targets.test.builder = '@angular/build:karma'; + tree.overwrite('/angular.json', JSON.stringify({ version: 1, projects })); + tree.create('karma.conf.js', DEFAULT_KARMA_CONFIG_NO_DEVKIT); + + const newTree = await schematicRunner.runSchematic('remove-default-karma-config', {}, tree); + const { projects: newProjects } = newTree.readJson('/angular.json') as any; + expect(newProjects.app.targets.test.options.karmaConfig).toBeUndefined(); + expect(newTree.exists('karma.conf.js')).toBeFalse(); + }); +}); diff --git a/packages/schematics/angular/migrations/migration-collection.json b/packages/schematics/angular/migrations/migration-collection.json index 659dd48728cd..502d121784fd 100644 --- a/packages/schematics/angular/migrations/migration-collection.json +++ b/packages/schematics/angular/migrations/migration-collection.json @@ -1,32 +1,28 @@ { + "encapsulation": false, "schematics": { - "replace-provide-server-rendering-import": { - "version": "20.0.0", - "factory": "./replace-provide-server-rendering-import/migration", - "description": "Migrate imports of 'provideServerRendering' from '@angular/platform-server' to '@angular/ssr'." - }, - "replace-provide-server-routing": { - "version": "20.0.0", - "factory": "./replace-provide-server-routing/migration", - "description": "Migrate 'provideServerRendering' to use 'withRoutes' and remove 'provideServerRouting' from '@angular/ssr'." - }, - "update-module-resolution": { - "version": "20.0.0", - "factory": "./update-module-resolution/migration", - "description": "Update 'moduleResolution' to 'bundler' in TypeScript configurations. You can read more about this, here: https://www.typescriptlang.org/tsconfig/#moduleResolution" - }, - "previous-style-guide": { - "version": "20.0.0", - "factory": "./previous-style-guide/migration", - "description": "Update workspace generation defaults to maintain previous style guide behavior." - }, "use-application-builder": { - "version": "20.0.0", + "version": "21.0.0", "factory": "./use-application-builder/migration", "description": "Migrate application projects to the new build system. Application projects that are using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders will be migrated to use the new 'application' builder. You can read more about this, including known issues and limitations, here: https://angular.dev/tools/cli/build-system-migration", "optional": true, "recommended": true, "documentation": "tools/cli/build-system-migration" + }, + "remove-default-karma-config": { + "version": "21.0.0", + "factory": "./karma/migration", + "description": "Remove any karma configuration files that only contain the default content. The default configuration is automatically available without a specific project file." + }, + "update-typescript-lib": { + "version": "21.0.0", + "factory": "./update-typescript-lib/migration", + "description": "Updates the 'lib' property in tsconfig files to use 'es2022' or a more modern version." + }, + "update-module-resolution": { + "version": "21.0.0", + "factory": "./update-module-resolution/migration", + "description": "Update 'moduleResolution' to 'bundler' in TypeScript configurations. You can read more about this, here: https://www.typescriptlang.org/tsconfig/#moduleResolution" } } } diff --git a/packages/schematics/angular/migrations/previous-style-guide/migration.ts b/packages/schematics/angular/migrations/previous-style-guide/migration.ts deleted file mode 100644 index 1590948b243d..000000000000 --- a/packages/schematics/angular/migrations/previous-style-guide/migration.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import type { Rule } from '@angular-devkit/schematics'; -import { updateWorkspace } from '../../utility/workspace'; - -const TYPE_SCHEMATICS = ['component', 'directive', 'service'] as const; - -const SEPARATOR_SCHEMATICS = ['guard', 'interceptor', 'module', 'pipe', 'resolver'] as const; - -export default function (): Rule { - return updateWorkspace((workspace) => { - let schematicsDefaults = workspace.extensions['schematics']; - - // Ensure "schematics" field is an object - if ( - !schematicsDefaults || - typeof schematicsDefaults !== 'object' || - Array.isArray(schematicsDefaults) - ) { - schematicsDefaults = workspace.extensions['schematics'] = {}; - } - - // Add "type" value for each schematic to continue generating a type suffix. - // New default is an empty type value. - for (const schematicName of TYPE_SCHEMATICS) { - const schematic = (schematicsDefaults[`@schematics/angular:${schematicName}`] ??= {}); - if (typeof schematic === 'object' && !Array.isArray(schematic) && !('type' in schematic)) { - schematic['type'] = schematicName; - } - } - - // Add "typeSeparator" value for each schematic to continue generating "." before type. - // New default is an "-" type value. - for (const schematicName of SEPARATOR_SCHEMATICS) { - const schematic = (schematicsDefaults[`@schematics/angular:${schematicName}`] ??= {}); - if ( - typeof schematic === 'object' && - !Array.isArray(schematic) && - !('typeSeparator' in schematic) - ) { - schematic['typeSeparator'] = '.'; - } - } - }); -} diff --git a/packages/schematics/angular/migrations/previous-style-guide/migration_spec.ts b/packages/schematics/angular/migrations/previous-style-guide/migration_spec.ts deleted file mode 100644 index 342da3910e74..000000000000 --- a/packages/schematics/angular/migrations/previous-style-guide/migration_spec.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { EmptyTree } from '@angular-devkit/schematics'; -import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import { ProjectType, WorkspaceSchema } from '../../utility/workspace-models'; - -function createWorkSpaceConfig(tree: UnitTestTree, initialSchematicsValue?: unknown) { - const angularConfig: WorkspaceSchema = { - version: 1, - projects: { - app: { - root: '/project/lib', - sourceRoot: '/project/app/src', - projectType: ProjectType.Application, - prefix: 'app', - architect: {}, - }, - }, - }; - - if (initialSchematicsValue !== undefined) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (angularConfig as any).schematics = initialSchematicsValue; - } - - tree.create('/angular.json', JSON.stringify(angularConfig, undefined, 2)); -} - -describe(`Migration to update 'angular.json'.`, () => { - const schematicName = 'previous-style-guide'; - const schematicRunner = new SchematicTestRunner( - 'migrations', - require.resolve('../migration-collection.json'), - ); - - let tree: UnitTestTree; - beforeEach(() => { - tree = new UnitTestTree(new EmptyTree()); - }); - - it(`should add defaults if no "schematics" workspace field is present`, async () => { - createWorkSpaceConfig(tree); - - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { schematics } = JSON.parse(newTree.readContent('/angular.json')); - - expect(schematics).toEqual({ - '@schematics/angular:component': { type: 'component' }, - '@schematics/angular:directive': { type: 'directive' }, - '@schematics/angular:service': { type: 'service' }, - '@schematics/angular:guard': { typeSeparator: '.' }, - '@schematics/angular:interceptor': { typeSeparator: '.' }, - '@schematics/angular:module': { typeSeparator: '.' }, - '@schematics/angular:pipe': { typeSeparator: '.' }, - '@schematics/angular:resolver': { typeSeparator: '.' }, - }); - }); - - it(`should add defaults if empty "schematics" workspace field is present`, async () => { - createWorkSpaceConfig(tree, {}); - - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { schematics } = JSON.parse(newTree.readContent('/angular.json')); - - expect(schematics).toEqual({ - '@schematics/angular:component': { type: 'component' }, - '@schematics/angular:directive': { type: 'directive' }, - '@schematics/angular:service': { type: 'service' }, - '@schematics/angular:guard': { typeSeparator: '.' }, - '@schematics/angular:interceptor': { typeSeparator: '.' }, - '@schematics/angular:module': { typeSeparator: '.' }, - '@schematics/angular:pipe': { typeSeparator: '.' }, - '@schematics/angular:resolver': { typeSeparator: '.' }, - }); - }); - - it(`should add defaults if invalid "schematics" workspace field is present`, async () => { - createWorkSpaceConfig(tree, 10); - - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { schematics } = JSON.parse(newTree.readContent('/angular.json')); - - expect(schematics).toEqual({ - '@schematics/angular:component': { type: 'component' }, - '@schematics/angular:directive': { type: 'directive' }, - '@schematics/angular:service': { type: 'service' }, - '@schematics/angular:guard': { typeSeparator: '.' }, - '@schematics/angular:interceptor': { typeSeparator: '.' }, - '@schematics/angular:module': { typeSeparator: '.' }, - '@schematics/angular:pipe': { typeSeparator: '.' }, - '@schematics/angular:resolver': { typeSeparator: '.' }, - }); - }); - - it(`should add defaults if existing unrelated "schematics" workspace defaults are present`, async () => { - createWorkSpaceConfig(tree, { - '@schematics/angular:component': { style: 'scss' }, - }); - - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { schematics } = JSON.parse(newTree.readContent('/angular.json')); - - expect(schematics).toEqual({ - '@schematics/angular:component': { style: 'scss', type: 'component' }, - '@schematics/angular:directive': { type: 'directive' }, - '@schematics/angular:service': { type: 'service' }, - '@schematics/angular:guard': { typeSeparator: '.' }, - '@schematics/angular:interceptor': { typeSeparator: '.' }, - '@schematics/angular:module': { typeSeparator: '.' }, - '@schematics/angular:pipe': { typeSeparator: '.' }, - '@schematics/angular:resolver': { typeSeparator: '.' }, - }); - }); - - it(`should not overwrite defaults if existing "schematics" workspace defaults are present`, async () => { - createWorkSpaceConfig(tree, { - '@schematics/angular:component': { type: 'example' }, - '@schematics/angular:guard': { typeSeparator: '-' }, - }); - - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { schematics } = JSON.parse(newTree.readContent('/angular.json')); - - expect(schematics).toEqual({ - '@schematics/angular:component': { type: 'example' }, - '@schematics/angular:directive': { type: 'directive' }, - '@schematics/angular:service': { type: 'service' }, - '@schematics/angular:guard': { typeSeparator: '-' }, - '@schematics/angular:interceptor': { typeSeparator: '.' }, - '@schematics/angular:module': { typeSeparator: '.' }, - '@schematics/angular:pipe': { typeSeparator: '.' }, - '@schematics/angular:resolver': { typeSeparator: '.' }, - }); - }); -}); diff --git a/packages/schematics/angular/migrations/replace-provide-server-rendering-import/migration.ts b/packages/schematics/angular/migrations/replace-provide-server-rendering-import/migration.ts deleted file mode 100644 index ed8e0d7598f3..000000000000 --- a/packages/schematics/angular/migrations/replace-provide-server-rendering-import/migration.ts +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { DirEntry, Rule } from '@angular-devkit/schematics'; -import * as ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; -import { NodeDependencyType, addPackageJsonDependency } from '../../utility/dependencies'; -import { latestVersions } from '../../utility/latest-versions'; - -function* visit(directory: DirEntry): IterableIterator<[fileName: string, contents: string]> { - for (const path of directory.subfiles) { - if (path.endsWith('.ts') && !path.endsWith('.d.ts')) { - const entry = directory.file(path); - if (entry) { - const content = entry.content; - if ( - content.includes('provideServerRendering') && - content.includes('@angular/platform-server') - ) { - // Only need to rename the import so we can just string replacements. - yield [entry.path, content.toString()]; - } - } - } - } - - for (const path of directory.subdirs) { - if (path === 'node_modules' || path.startsWith('.')) { - continue; - } - - yield* visit(directory.dir(path)); - } -} - -export default function (): Rule { - return async (tree) => { - let angularSSRAdded = false; - - for (const [filePath, content] of visit(tree.root)) { - let updatedContent = content; - const ssrImports = new Set(); - const platformServerImports = new Set(); - const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true); - - sourceFile.forEachChild((node) => { - if (ts.isImportDeclaration(node)) { - const moduleSpecifier = node.moduleSpecifier.getText(sourceFile); - if (moduleSpecifier.includes('@angular/platform-server')) { - const importClause = node.importClause; - if ( - importClause && - importClause.namedBindings && - ts.isNamedImports(importClause.namedBindings) - ) { - const namedImports = importClause.namedBindings.elements.map((e) => - e.getText(sourceFile), - ); - namedImports.forEach((importName) => { - if (importName === 'provideServerRendering') { - ssrImports.add(importName); - } else { - platformServerImports.add(importName); - } - }); - } - updatedContent = updatedContent.replace(node.getFullText(sourceFile), ''); - } else if (moduleSpecifier.includes('@angular/ssr')) { - const importClause = node.importClause; - if ( - importClause && - importClause.namedBindings && - ts.isNamedImports(importClause.namedBindings) - ) { - importClause.namedBindings.elements.forEach((e) => { - ssrImports.add(e.getText(sourceFile)); - }); - } - updatedContent = updatedContent.replace(node.getFullText(sourceFile), ''); - } - } - }); - - if (platformServerImports.size > 0) { - updatedContent = - `import { ${Array.from(platformServerImports).sort().join(', ')} } from '@angular/platform-server';\n` + - updatedContent; - } - - if (ssrImports.size > 0) { - updatedContent = - `import { ${Array.from(ssrImports).sort().join(', ')} } from '@angular/ssr';\n` + - updatedContent; - } - - if (content !== updatedContent) { - tree.overwrite(filePath, updatedContent); - - if (!angularSSRAdded) { - addPackageJsonDependency(tree, { - name: '@angular/ssr', - version: latestVersions.AngularSSR, - type: NodeDependencyType.Default, - overwrite: false, - }); - - angularSSRAdded = true; - } - } - } - }; -} diff --git a/packages/schematics/angular/migrations/replace-provide-server-rendering-import/migration_spec.ts b/packages/schematics/angular/migrations/replace-provide-server-rendering-import/migration_spec.ts deleted file mode 100644 index 6746172882fb..000000000000 --- a/packages/schematics/angular/migrations/replace-provide-server-rendering-import/migration_spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { EmptyTree } from '@angular-devkit/schematics'; -import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; - -describe(`Migration to use the 'provideServerRendering' from '@angular/ssr'`, () => { - const schematicRunner = new SchematicTestRunner( - 'migrations', - require.resolve('../migration-collection.json'), - ); - - let tree: UnitTestTree; - const schematicName = 'replace-provide-server-rendering-import'; - - beforeEach(() => { - tree = new UnitTestTree(new EmptyTree()); - tree.create( - '/package.json', - JSON.stringify({ - dependencies: {}, - }), - ); - }); - - it('should replace provideServerRendering with @angular/ssr and keep other imports', async () => { - tree.create( - 'test.ts', - `import { provideServerRendering, otherFunction } from '@angular/platform-server';`, - ); - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const content = newTree.readContent('test.ts'); - expect(content).toContain("import { provideServerRendering } from '@angular/ssr';"); - expect(content).toContain("import { otherFunction } from '@angular/platform-server';"); - }); - - it('should not replace provideServerRendering that is imported from @angular/ssr', async () => { - tree.create( - 'test.ts', - ` - import { otherFunction } from '@angular/platform-server'; - import { provideServerRendering, provideServerRouting } from '@angular/ssr'; - `, - ); - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const content = newTree.readContent('test.ts'); - expect(content).toContain( - "import { provideServerRendering, provideServerRouting } from '@angular/ssr';", - ); - expect(content).toContain("import { otherFunction } from '@angular/platform-server';"); - }); - - it('should merge with existing @angular/ssr imports', async () => { - tree.create( - 'test.ts', - ` - import { provideServerRouting } from '@angular/ssr'; - import { provideServerRendering } from '@angular/platform-server'; - `, - ); - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const content = newTree.readContent('test.ts'); - expect(content).toContain( - "import { provideServerRendering, provideServerRouting } from '@angular/ssr';", - ); - expect(content.match(/@angular\/ssr/g) || []).toHaveSize(1); - }); - - it(`should add '@angular/ssr' when import has been changed`, async () => { - tree.create('test.ts', `import { provideServerRendering } from '@angular/platform-server';`); - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { dependencies } = newTree.readJson('package.json') as { - dependencies: Record; - }; - expect(dependencies['@angular/ssr']).toBeDefined(); - }); - - it(`should not add '@angular/ssr' dependency if no imports have been updated`, async () => { - tree.create('test.ts', `import { provideClientHydration } from '@angular/platform-browser';`); - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const { dependencies } = newTree.readJson('package.json') as { - dependencies: Record; - }; - expect(dependencies['@angular/ssr']).toBeUndefined(); - }); -}); diff --git a/packages/schematics/angular/migrations/replace-provide-server-routing/migration.ts b/packages/schematics/angular/migrations/replace-provide-server-routing/migration.ts deleted file mode 100644 index 8fc662b6b69a..000000000000 --- a/packages/schematics/angular/migrations/replace-provide-server-routing/migration.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { DirEntry, Rule } from '@angular-devkit/schematics'; -import * as ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; -import { getPackageJsonDependency } from '../../utility/dependencies'; - -function* visit(directory: DirEntry): IterableIterator<[fileName: string, contents: string]> { - for (const path of directory.subfiles) { - if (path.endsWith('.ts') && !path.endsWith('.d.ts')) { - const entry = directory.file(path); - if (entry) { - const content = entry.content; - if (content.includes('provideServerRouting') && content.includes('@angular/ssr')) { - // Only need to rename the import so we can just string replacements. - yield [entry.path, content.toString()]; - } - } - } - } - - for (const path of directory.subdirs) { - if (path === 'node_modules' || path.startsWith('.')) { - continue; - } - - yield* visit(directory.dir(path)); - } -} - -export default function (): Rule { - return async (tree) => { - if (!getPackageJsonDependency(tree, '@angular/ssr')) { - return; - } - - for (const [filePath, content] of visit(tree.root)) { - const recorder = tree.beginUpdate(filePath); - const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true); - - function visit(node: ts.Node) { - if ( - ts.isPropertyAssignment(node) && - ts.isIdentifier(node.name) && - node.name.text === 'providers' && - ts.isArrayLiteralExpression(node.initializer) - ) { - const providersArray = node.initializer; - const newProviders = providersArray.elements - .filter((el) => { - return !( - ts.isCallExpression(el) && - ts.isIdentifier(el.expression) && - el.expression.text === 'provideServerRendering' - ); - }) - .map((el) => { - if ( - ts.isCallExpression(el) && - ts.isIdentifier(el.expression) && - el.expression.text === 'provideServerRouting' - ) { - const [withRouteVal, ...others] = el.arguments.map((arg) => arg.getText()); - - return `provideServerRendering(withRoutes(${withRouteVal})${others.length ? ', ' + others.join(', ') : ''})`; - } - - return el.getText(); - }); - - // Update the 'providers' array in the source file - recorder.remove(providersArray.getStart(), providersArray.getWidth()); - recorder.insertRight(providersArray.getStart(), `[${newProviders.join(', ')}]`); - } - - ts.forEachChild(node, visit); - } - - // Visit all nodes to update 'providers' - visit(sourceFile); - - // Update imports by removing 'provideServerRouting' - const importDecl = sourceFile.statements.find( - (stmt) => - ts.isImportDeclaration(stmt) && - ts.isStringLiteral(stmt.moduleSpecifier) && - stmt.moduleSpecifier.text === '@angular/ssr', - ) as ts.ImportDeclaration | undefined; - - if (importDecl?.importClause?.namedBindings) { - const namedBindings = importDecl?.importClause.namedBindings; - - if (ts.isNamedImports(namedBindings)) { - const elements = namedBindings.elements; - const updatedElements = elements - .map((el) => el.getText()) - .filter((x) => x !== 'provideServerRouting'); - - updatedElements.push('withRoutes'); - - recorder.remove(namedBindings.getStart(), namedBindings.getWidth()); - recorder.insertLeft(namedBindings.getStart(), `{ ${updatedElements.sort().join(', ')} }`); - } - } - - tree.commitUpdate(recorder); - } - }; -} diff --git a/packages/schematics/angular/migrations/replace-provide-server-routing/migration_spec.ts b/packages/schematics/angular/migrations/replace-provide-server-routing/migration_spec.ts deleted file mode 100644 index a0ab33aa15f1..000000000000 --- a/packages/schematics/angular/migrations/replace-provide-server-routing/migration_spec.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { EmptyTree } from '@angular-devkit/schematics'; -import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; - -describe(`Migration to replace 'provideServerRouting' with 'provideServerRendering' from '@angular/ssr'`, () => { - const schematicRunner = new SchematicTestRunner( - 'migrations', - require.resolve('../migration-collection.json'), - ); - - const schematicName = 'replace-provide-server-routing'; - let tree: UnitTestTree; - - beforeEach(async () => { - tree = new UnitTestTree(new EmptyTree()); - tree.create( - '/package.json', - JSON.stringify({ - dependencies: { - '@angular/ssr': '0.0.0', - }, - }), - ); - - tree.create( - 'src/app/app.config.ts', - ` - import { ApplicationConfig } from '@angular/core'; - import { provideServerRendering, provideServerRouting } from '@angular/ssr'; - import { serverRoutes } from './app.routes'; - - const serverConfig: ApplicationConfig = { - providers: [ - provideServerRendering(), - provideServerRouting(serverRoutes) - ] - }; - `, - ); - }); - - it('should add "withRoutes" to the import statement', async () => { - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const content = newTree.readContent('src/app/app.config.ts'); - - expect(content).toContain(`import { provideServerRendering, withRoutes } from '@angular/ssr';`); - }); - - it('should remove "provideServerRouting" and update "provideServerRendering"', async () => { - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const content = newTree.readContent('src/app/app.config.ts'); - - expect(content).toContain(`providers: [provideServerRendering(withRoutes(serverRoutes))]`); - expect(content).not.toContain(`provideServerRouting(serverRoutes)`); - }); - - it('should correctly handle provideServerRouting with extra arguments', async () => { - tree.overwrite( - 'src/app/app.config.ts', - ` - import { ApplicationConfig } from '@angular/core'; - import { provideServerRendering, provideServerRouting } from '@angular/ssr'; - import { serverRoutes } from './app.routes'; - - const serverConfig: ApplicationConfig = { - providers: [ - provideServerRendering(), - provideServerRouting(serverRoutes, withAppShell(AppShellComponent)) - ] - }; - `, - ); - - const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); - const content = newTree.readContent('src/app/app.config.ts'); - - expect(content).toContain( - `providers: [provideServerRendering(withRoutes(serverRoutes), withAppShell(AppShellComponent))]`, - ); - expect(content).not.toContain(`provideServerRouting(serverRoutes)`); - }); -}); diff --git a/packages/schematics/angular/migrations/update-typescript-lib/migration.ts b/packages/schematics/angular/migrations/update-typescript-lib/migration.ts new file mode 100644 index 000000000000..9022bcedf578 --- /dev/null +++ b/packages/schematics/angular/migrations/update-typescript-lib/migration.ts @@ -0,0 +1,94 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { Rule, Tree } from '@angular-devkit/schematics'; +import { JSONFile } from '../../utility/json-file'; +import { getWorkspace } from '../../utility/workspace'; + +export default function (): Rule { + return async (host, context) => { + // Workspace level tsconfig + if (host.exists('tsconfig.json')) { + updateLib(host, 'tsconfig.json'); + } + + const workspace = await getWorkspace(host); + + // Find all tsconfig which are references used by builders + for (const [, project] of workspace.projects) { + for (const [targetName, target] of project.targets) { + if (!target.options) { + continue; + } + + // Update all other known CLI builders that use a tsconfig + const tsConfigs = [target.options, ...Object.values(target.configurations || {})] + .filter((opt) => typeof opt?.tsConfig === 'string') + .map((opt) => (opt as { tsConfig: string }).tsConfig); + + const uniqueTsConfigs = new Set(tsConfigs); + for (const tsConfig of uniqueTsConfigs) { + if (host.exists(tsConfig)) { + updateLib(host, tsConfig); + } else { + context.logger.warn( + `'${tsConfig}' referenced in the '${targetName}' target does not exist.`, + ); + } + } + } + } + }; +} + +function updateLib(host: Tree, tsConfigPath: string): void { + const json = new JSONFile(host, tsConfigPath); + const jsonPath = ['compilerOptions', 'lib']; + const lib = json.get(jsonPath) as string[] | undefined; + + if (!lib || !Array.isArray(lib)) { + return; + } + + const esLibs = lib.filter((l) => typeof l === 'string' && l.toLowerCase().startsWith('es')); + const hasDom = lib.some((l) => typeof l === 'string' && l.toLowerCase() === 'dom'); + + if (esLibs.length === 0) { + return; + } + + const esLibToVersion = new Map(); + for (const l of esLibs) { + const version = l.toLowerCase().match(/^es(next|(\d+))$/)?.[1]; + if (version) { + esLibToVersion.set(l, version === 'next' ? Infinity : Number(version)); + } + } + + if (esLibToVersion.size === 0) { + return; + } + + const latestEsLib = [...esLibToVersion.entries()].sort(([, v1], [, v2]) => v2 - v1)[0]; + const latestVersion = latestEsLib[1]; + + if (hasDom) { + if (latestVersion <= 2022) { + json.remove(jsonPath); + } + + return; + } + + // No 'dom' with 'es' libs, so update 'es' lib. + if (latestVersion < 2022) { + const newLibs = lib.filter((l) => !esLibToVersion.has(l)); + newLibs.push('es2022'); + json.modify(jsonPath, newLibs); + } +} diff --git a/packages/schematics/angular/migrations/update-typescript-lib/migration_spec.ts b/packages/schematics/angular/migrations/update-typescript-lib/migration_spec.ts new file mode 100644 index 000000000000..6cbfe6ebb00a --- /dev/null +++ b/packages/schematics/angular/migrations/update-typescript-lib/migration_spec.ts @@ -0,0 +1,159 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { isJsonObject } from '@angular-devkit/core'; +import { EmptyTree } from '@angular-devkit/schematics'; +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; +import { Builders, ProjectType, WorkspaceSchema } from '../../utility/workspace-models'; + +describe('Migration to update TypeScript lib', () => { + const schematicName = 'update-typescript-lib'; + + const schematicRunner = new SchematicTestRunner( + 'migrations', + require.resolve('../migration-collection.json'), + ); + + function createJsonFile(tree: UnitTestTree, filePath: string, content: {}): void { + const stringifiedContent = JSON.stringify(content, undefined, 2); + if (tree.exists(filePath)) { + tree.overwrite(filePath, stringifiedContent); + } else { + tree.create(filePath, stringifiedContent); + } + } + + function getCompilerOptions(tree: UnitTestTree, filePath: string): Record { + const json = tree.readJson(filePath); + if (isJsonObject(json) && isJsonObject(json.compilerOptions)) { + return json.compilerOptions; + } + + throw new Error(`Cannot retrieve 'compilerOptions'.`); + } + + function createWorkSpaceConfig(tree: UnitTestTree) { + const angularConfig: WorkspaceSchema = { + version: 1, + projects: { + app: { + root: '', + sourceRoot: 'src', + projectType: ProjectType.Application, + prefix: 'app', + architect: { + build: { + builder: Builders.Browser, + options: { + tsConfig: 'src/tsconfig.app.json', + main: '', + polyfills: '', + }, + configurations: { + production: { + tsConfig: 'src/tsconfig.app.prod.json', + }, + }, + }, + test: { + builder: Builders.Karma, + options: { + karmaConfig: '', + tsConfig: 'src/tsconfig.spec.json', + }, + }, + }, + }, + }, + }; + + createJsonFile(tree, 'angular.json', angularConfig); + } + + let tree: UnitTestTree; + beforeEach(() => { + tree = new UnitTestTree(new EmptyTree()); + createWorkSpaceConfig(tree); + + // Create tsconfigs + const compilerOptions = { lib: ['es2020', 'dom'] }; + const configWithExtends = { extends: './tsconfig.json', compilerOptions }; + + // Workspace + createJsonFile(tree, 'tsconfig.json', { compilerOptions }); + + // Application + createJsonFile(tree, 'src/tsconfig.app.json', configWithExtends); + createJsonFile(tree, 'src/tsconfig.app.prod.json', configWithExtends); + createJsonFile(tree, 'src/tsconfig.spec.json', { compilerOptions }); + }); + + it(`should remove 'lib' when 'dom' is present and ES version is less than 2022`, async () => { + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const compilerOptions = getCompilerOptions(newTree, 'tsconfig.json'); + expect(compilerOptions.lib).toBeUndefined(); + }); + + it(`should remove 'lib' when 'dom' is present and ES version is 2022`, async () => { + createJsonFile(tree, 'tsconfig.json', { compilerOptions: { lib: ['es2022', 'dom'] } }); + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const compilerOptions = getCompilerOptions(newTree, 'tsconfig.json'); + expect(compilerOptions.lib).toBeUndefined(); + }); + + it(`should not remove 'lib' when 'dom' is present and ES version is 'esnext'`, async () => { + createJsonFile(tree, 'tsconfig.json', { compilerOptions: { lib: ['esnext', 'dom'] } }); + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const compilerOptions = getCompilerOptions(newTree, 'tsconfig.json'); + expect(compilerOptions.lib).toEqual(['esnext', 'dom']); + }); + + it(`should update 'lib' to 'es2022' when 'dom' is not present and ES version is less than 2022`, async () => { + createJsonFile(tree, 'tsconfig.json', { compilerOptions: { lib: ['es2020'] } }); + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const compilerOptions = getCompilerOptions(newTree, 'tsconfig.json'); + expect(compilerOptions.lib).toEqual(['es2022']); + }); + + it(`should not update 'lib' when 'dom' is not present and ES version is 2022`, async () => { + createJsonFile(tree, 'tsconfig.json', { compilerOptions: { lib: ['es2022'] } }); + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const compilerOptions = getCompilerOptions(newTree, 'tsconfig.json'); + expect(compilerOptions.lib).toEqual(['es2022']); + }); + + it(`should not update 'lib' when 'dom' is not present and ES version is 'esnext'`, async () => { + createJsonFile(tree, 'tsconfig.json', { compilerOptions: { lib: ['esnext'] } }); + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const compilerOptions = getCompilerOptions(newTree, 'tsconfig.json'); + expect(compilerOptions.lib).toEqual(['esnext']); + }); + + it('should not error when a tsconfig is not found', async () => { + tree.delete('src/tsconfig.spec.json'); + await schematicRunner.runSchematic(schematicName, {}, tree); + }); + + it('should not error when compilerOptions is not defined', async () => { + createJsonFile(tree, 'tsconfig.json', {}); + await schematicRunner.runSchematic(schematicName, {}, tree); + }); + + it(`should not error when 'lib' is not defined`, async () => { + createJsonFile(tree, 'tsconfig.json', { compilerOptions: {} }); + await schematicRunner.runSchematic(schematicName, {}, tree); + }); + + it(`should remove 'lib' from all tsconfigs`, async () => { + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + expect(getCompilerOptions(newTree, 'tsconfig.json').lib).toBeUndefined(); + expect(getCompilerOptions(newTree, 'src/tsconfig.app.json').lib).toBeUndefined(); + expect(getCompilerOptions(newTree, 'src/tsconfig.app.prod.json').lib).toBeUndefined(); + expect(getCompilerOptions(newTree, 'src/tsconfig.spec.json').lib).toBeUndefined(); + }); +}); diff --git a/packages/schematics/angular/migrations/use-application-builder/migration.ts b/packages/schematics/angular/migrations/use-application-builder/migration.ts index 396ba48430d2..b481c4f30034 100644 --- a/packages/schematics/angular/migrations/use-application-builder/migration.ts +++ b/packages/schematics/angular/migrations/use-application-builder/migration.ts @@ -7,7 +7,6 @@ */ import { - DirEntry, Rule, SchematicContext, SchematicsException, @@ -15,25 +14,27 @@ import { chain, externalSchematic, } from '@angular-devkit/schematics'; -import { basename, dirname, extname, join } from 'node:path/posix'; -import { removePackageJsonDependency } from '../../utility/dependencies'; +import { dirname, join } from 'node:path/posix'; import { DependencyType, ExistingBehavior, - InstallBehavior, addDependency, + removeDependency, } from '../../utility/dependency'; import { JSONFile } from '../../utility/json-file'; import { latestVersions } from '../../utility/latest-versions'; import { TargetDefinition, - WorkspaceDefinition, allTargetOptions, allWorkspaceTargets, updateWorkspace, } from '../../utility/workspace'; import { Builders, ProjectType } from '../../utility/workspace-models'; -import { findImports } from './css-import-lexer'; +import { + hasLessStylesheets, + hasPostcssConfiguration, + updateStyleImports, +} from './stylesheet-updates'; function* updateBuildTarget( projectName: string, @@ -173,7 +174,11 @@ function updateProjects(tree: Tree, context: SchematicContext) { } const buildTarget = project.targets.get('build'); - if (!buildTarget || buildTarget.builder === Builders.Application) { + if ( + !buildTarget || + buildTarget.builder === Builders.Application || + buildTarget.builder === Builders.BuildApplication + ) { continue; } @@ -232,6 +237,8 @@ function updateProjects(tree: Tree, context: SchematicContext) { // Use @angular/build directly if there is no devkit package usage if (!hasAngularDevkitUsage) { + const karmaConfigFiles = new Set(); + for (const [, target] of allWorkspaceTargets(workspace)) { switch (target.builder) { case Builders.Application: @@ -245,9 +252,15 @@ function updateProjects(tree: Tree, context: SchematicContext) { break; case Builders.Karma: target.builder = '@angular/build:karma'; - // Remove "builderMode" option since the builder will always use "application" for (const [, karmaOptions] of allTargetOptions(target)) { + // Remove "builderMode" option since the builder will always use "application" delete karmaOptions['builderMode']; + + // Collect custom karma configurations for @angular-devkit/build-angular plugin removal + const karmaConfig = karmaOptions['karmaConfig']; + if (karmaConfig && typeof karmaConfig === 'string') { + karmaConfigFiles.add(karmaConfig); + } } break; case Builders.NgPackagr: @@ -260,13 +273,10 @@ function updateProjects(tree: Tree, context: SchematicContext) { rules.push( addDependency('@angular/build', latestVersions.DevkitBuildAngular, { type: DependencyType.Dev, - // Always is set here since removePackageJsonDependency below does not automatically - // trigger the package manager execution. - install: InstallBehavior.Always, existing: ExistingBehavior.Replace, }), + removeDependency('@angular-devkit/build-angular'), ); - removePackageJsonDependency(tree, '@angular-devkit/build-angular'); // Add less dependency if any projects contain a Less stylesheet file. // This check does not consider Node.js packages due to the performance @@ -292,172 +302,38 @@ function updateProjects(tree: Tree, context: SchematicContext) { }), ); } - } - - return chain(rules); - }); -} - -/** - * Searches the schematic tree for files that have a `.less` extension. - * - * @param tree A Schematics tree instance to search - * @returns true if Less stylesheet files are found; otherwise, false - */ -function hasLessStylesheets(tree: Tree) { - const directories = [tree.getDir('/')]; - - let current; - while ((current = directories.pop())) { - for (const path of current.subfiles) { - if (path.endsWith('.less')) { - return true; - } - } - - for (const path of current.subdirs) { - if (path === 'node_modules' || path.startsWith('.')) { - continue; - } - directories.push(current.dir(path)); - } - } -} - -/** - * Searches for a Postcss configuration file within the workspace root - * or any of the project roots. - * - * @param tree A Schematics tree instance to search - * @param workspace A Workspace to check for projects - * @returns true, if a Postcss configuration file is found; otherwise, false - */ -function hasPostcssConfiguration(tree: Tree, workspace: WorkspaceDefinition) { - // Add workspace root - const searchDirectories = ['']; - - // Add each project root - for (const { root } of workspace.projects.values()) { - if (root) { - searchDirectories.push(root); - } - } - - return searchDirectories.some( - (dir) => - tree.exists(join(dir, 'postcss.config.json')) || tree.exists(join(dir, '.postcssrc.json')), - ); -} - -function* visit( - directory: DirEntry, -): IterableIterator<[fileName: string, contents: string, sass: boolean]> { - for (const path of directory.subfiles) { - const sass = path.endsWith('.scss'); - if (path.endsWith('.css') || sass) { - const entry = directory.file(path); - if (entry) { - const content = entry.content; - - yield [entry.path, content.toString(), sass]; - } - } - } - - for (const path of directory.subdirs) { - if (path === 'node_modules' || path.startsWith('.')) { - continue; - } - yield* visit(directory.dir(path)); - } -} - -// Based on https://github.com/sass/dart-sass/blob/44d6bb6ac72fe6b93f5bfec371a1fffb18e6b76d/lib/src/importer/utils.dart -function* potentialSassImports( - specifier: string, - base: string, - fromImport: boolean, -): Iterable { - const directory = join(base, dirname(specifier)); - const extension = extname(specifier); - const hasStyleExtension = extension === '.scss' || extension === '.sass' || extension === '.css'; - // Remove the style extension if present to allow adding the `.import` suffix - const filename = basename(specifier, hasStyleExtension ? extension : undefined); - - if (hasStyleExtension) { - if (fromImport) { - yield join(directory, filename + '.import' + extension); - yield join(directory, '_' + filename + '.import' + extension); - } - yield join(directory, filename + extension); - yield join(directory, '_' + filename + extension); - } else { - if (fromImport) { - yield join(directory, filename + '.import.scss'); - yield join(directory, filename + '.import.sass'); - yield join(directory, filename + '.import.css'); - yield join(directory, '_' + filename + '.import.scss'); - yield join(directory, '_' + filename + '.import.sass'); - yield join(directory, '_' + filename + '.import.css'); - } - yield join(directory, filename + '.scss'); - yield join(directory, filename + '.sass'); - yield join(directory, filename + '.css'); - yield join(directory, '_' + filename + '.scss'); - yield join(directory, '_' + filename + '.sass'); - yield join(directory, '_' + filename + '.css'); - } -} + for (const karmaConfigFile of karmaConfigFiles) { + if (!tree.exists(karmaConfigFile)) { + continue; + } -function updateStyleImports(tree: Tree, projectSourceRoot: string, buildTarget: TargetDefinition) { - const external = new Set(); - let needWorkspaceIncludePath = false; - for (const file of visit(tree.getDir(projectSourceRoot))) { - const [path, content, sass] = file; - const relativeBase = dirname(path); - - let updater; - for (const { start, specifier, fromUse } of findImports(content, sass)) { - if (specifier[0] === '~') { - updater ??= tree.beginUpdate(path); - // start position includes the opening quote - updater.remove(start + 1, 1); - } else if (specifier[0] === '^') { - updater ??= tree.beginUpdate(path); - // start position includes the opening quote - updater.remove(start + 1, 1); - // Add to externalDependencies - external.add(specifier.slice(1)); - } else if ( - sass && - [...potentialSassImports(specifier, relativeBase, !fromUse)].every( - (v) => !tree.exists(v), - ) && - [...potentialSassImports(specifier, '/', !fromUse)].some((v) => tree.exists(v)) - ) { - needWorkspaceIncludePath = true; + try { + const originalKarmaConfigText = tree.readText(karmaConfigFile); + const updatedKarmaConfigText = originalKarmaConfigText + .replaceAll(`require('@angular-devkit/build-angular/plugins/karma'),`, '') + .replaceAll(`require('@angular-devkit/build-angular/plugins/karma')`, ''); + + if (updatedKarmaConfigText.includes('@angular-devkit/build-angular/plugins')) { + throw new Error( + 'Migration does not support found usage of "@angular-devkit/build-angular".', + ); + } else { + tree.overwrite(karmaConfigFile, updatedKarmaConfigText); + } + } catch (error) { + const reason = error instanceof Error ? `Reason: ${error.message}` : ''; + context.logger.warn( + `Unable to update custom karma configuration file ("${karmaConfigFile}"). ` + + reason + + '\nReferences to the "@angular-devkit/build-angular" package within the file may need to be removed manually.', + ); + } } } - if (updater) { - tree.commitUpdate(updater); - } - } - - if (needWorkspaceIncludePath) { - buildTarget.options ??= {}; - buildTarget.options['stylePreprocessorOptions'] ??= {}; - ((buildTarget.options['stylePreprocessorOptions'] as { includePaths?: string[] })[ - 'includePaths' - ] ??= []).push('.'); - } - if (external.size > 0) { - buildTarget.options ??= {}; - ((buildTarget.options['externalDependencies'] as string[] | undefined) ??= []).push( - ...external, - ); - } + return chain(rules); + }); } function deleteFile(path: string): Rule { @@ -490,7 +366,14 @@ export default function (): Rule { ), // Update main tsconfig updateJsonFile('tsconfig.json', (rootJson) => { - rootJson.modify(['compilerOptions', 'esModuleInterop'], true); + const module = rootJson.get(['compilerOptions', 'module']); + const hasPreserveModule = typeof module === 'string' && module.toLowerCase() === 'preserve'; + + if (!hasPreserveModule) { + rootJson.modify(['compilerOptions', 'esModuleInterop'], true); + rootJson.modify(['compilerOptions', 'moduleResolution'], 'bundler'); + } + rootJson.modify(['compilerOptions', 'downlevelIteration'], undefined); rootJson.modify(['compilerOptions', 'allowSyntheticDefaultImports'], undefined); }), diff --git a/packages/schematics/angular/migrations/use-application-builder/migration_spec.ts b/packages/schematics/angular/migrations/use-application-builder/migration_spec.ts index 3adef7d419eb..fd10352c6eac 100644 --- a/packages/schematics/angular/migrations/use-application-builder/migration_spec.ts +++ b/packages/schematics/angular/migrations/use-application-builder/migration_spec.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ +import { JsonObject } from '@angular-devkit/core'; import { EmptyTree } from '@angular-devkit/schematics'; import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; import { Builders, ProjectType, WorkspaceSchema } from '../../utility/workspace-models'; @@ -130,6 +131,103 @@ describe(`Migration to use the application builder`, () => { expect(builderMode).toBeUndefined(); }); + it(`should update file for 'karmaConfig' karma option (no require trailing comma)`, async () => { + addWorkspaceTarget(tree, 'test', { + 'builder': Builders.Karma, + 'options': { + 'karmaConfig': './karma.conf.js', + 'polyfills': ['zone.js', 'zone.js/testing'], + 'tsConfig': 'projects/app-a/tsconfig.spec.json', + }, + }); + tree.create( + './karma.conf.js', + ` + module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma') + ] + }); + };`, + ); + + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const { + projects: { app }, + } = JSON.parse(newTree.readContent('/angular.json')); + + const { karmaConfig } = app.architect['test'].options; + expect(karmaConfig).toBe('./karma.conf.js'); + + const karmaConfigText = newTree.readText('./karma.conf.js'); + expect(karmaConfigText).not.toContain(`require('@angular-devkit/build-angular/plugins/karma')`); + }); + + it(`should update file for 'karmaConfig' karma option (require trailing comma)`, async () => { + addWorkspaceTarget(tree, 'test', { + 'builder': Builders.Karma, + 'options': { + 'karmaConfig': './karma.conf.js', + 'polyfills': ['zone.js', 'zone.js/testing'], + 'tsConfig': 'projects/app-a/tsconfig.spec.json', + }, + }); + tree.create( + './karma.conf.js', + ` + module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage'), + require('@angular-devkit/build-angular/plugins/karma'), + ] + }); + };`, + ); + + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const { + projects: { app }, + } = JSON.parse(newTree.readContent('/angular.json')); + + const { karmaConfig } = app.architect['test'].options; + expect(karmaConfig).toBe('./karma.conf.js'); + + const karmaConfigText = newTree.readText('./karma.conf.js'); + expect(karmaConfigText).not.toContain(`require('@angular-devkit/build-angular/plugins/karma')`); + }); + + it(`should ignore missing file for 'karmaConfig' karma option`, async () => { + addWorkspaceTarget(tree, 'test', { + 'builder': Builders.Karma, + 'options': { + 'karmaConfig': './karma.conf.js', + 'polyfills': ['zone.js', 'zone.js/testing'], + 'tsConfig': 'projects/app-a/tsconfig.spec.json', + }, + }); + + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const { + projects: { app }, + } = JSON.parse(newTree.readContent('/angular.json')); + + const { karmaConfig } = app.architect['test'].options; + expect(karmaConfig).toBe('./karma.conf.js'); + }); + it('should remove tilde prefix from CSS @import specifiers', async () => { // Replace outputPath tree.create( @@ -351,4 +449,16 @@ describe(`Migration to use the application builder`, () => { expect(devDependencies['postcss']).toBeUndefined(); }); + + it('it should not add esModuleInterop and moduleResolution when module is preserve', async () => { + tree.overwrite( + 'tsconfig.json', + JSON.stringify({ + compilerOptions: { module: 'preserve' }, + }), + ); + const newTree = await schematicRunner.runSchematic(schematicName, {}, tree); + const { compilerOptions } = newTree.readJson('tsconfig.json') as JsonObject; + expect(compilerOptions).toEqual({ module: 'preserve' }); + }); }); diff --git a/packages/schematics/angular/migrations/use-application-builder/stylesheet-updates.ts b/packages/schematics/angular/migrations/use-application-builder/stylesheet-updates.ts new file mode 100644 index 000000000000..ea3eef03ace1 --- /dev/null +++ b/packages/schematics/angular/migrations/use-application-builder/stylesheet-updates.ts @@ -0,0 +1,282 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { DirEntry, Tree } from '@angular-devkit/schematics'; +import { basename, dirname, extname, join } from 'node:path/posix'; +import { TargetDefinition, WorkspaceDefinition } from '../../utility/workspace'; +import { findImports } from './css-import-lexer'; + +/** A list of all supported SASS style extensions. + * Order of extension is important and matches Sass behavior. + */ +const SASS_EXTENSIONS = ['.scss', '.sass', '.css']; + +/** The prefix used to indicate a SASS partial file. */ +const SASS_PARTIAL_PREFIX = '_'; + +/** + * An object containing the results of analyzing a single stylesheet file. + */ +interface StylesheetAnalysis { + /** Whether the stylesheet requires the workspace root to be added to the SASS include paths. */ + needsWorkspaceIncludePath: boolean; + + /** A set of external dependencies that were discovered in the stylesheet. */ + externalDependencies: Set; + + /** A list of content changes that need to be applied to the stylesheet. */ + contentChanges: { start: number; length: number }[]; +} + +/** + * Searches the schematic tree for files that have a `.less` extension. + * This is used to determine if the `less` package should be added as a dependency. + * + * @param tree A Schematics tree instance to search. + * @returns `true` if Less stylesheet files are found; otherwise, `false`. + */ +export function hasLessStylesheets(tree: Tree): boolean { + const directories = [tree.getDir('/')]; + + let current; + while ((current = directories.pop())) { + for (const path of current.subfiles) { + if (path.endsWith('.less')) { + return true; + } + } + + for (const path of current.subdirs) { + if (path === 'node_modules' || path.startsWith('.')) { + continue; + } + directories.push(current.dir(path)); + } + } + + return false; +} + +/** + * Searches for a PostCSS configuration file within the workspace root or any of the project roots. + * This is used to determine if the `postcss` package should be added as a dependency. + * + * @param tree A Schematics tree instance to search. + * @param workspace A Workspace to check for projects. + * @returns `true` if a PostCSS configuration file is found; otherwise, `false`. + */ +export function hasPostcssConfiguration(tree: Tree, workspace: WorkspaceDefinition): boolean { + const projectRoots = [...workspace.projects.values()].map((p) => p.root).filter(Boolean); + const searchDirectories = new Set(['', ...projectRoots]); + + for (const dir of searchDirectories) { + if ( + tree.exists(join(dir, 'postcss.config.json')) || + tree.exists(join(dir, '.postcssrc.json')) + ) { + return true; + } + } + + return false; +} + +/** + * Recursively visits all stylesheet files in a directory and yields their path and content. + * + * @param directory The directory to visit. + */ +function* visitStylesheets(directory: DirEntry): IterableIterator<[path: string, content: string]> { + for (const path of directory.subfiles) { + if (path.endsWith('.css') || path.endsWith('.scss') || path.endsWith('.sass')) { + const entry = directory.file(path); + if (entry) { + yield [entry.path, entry.content.toString()]; + } + } + } + + for (const path of directory.subdirs) { + if (path === 'node_modules' || path.startsWith('.')) { + continue; + } + + yield* visitStylesheets(directory.dir(path)); + } +} + +/** + * Determines if a Sass import is likely intended to be relative to the workspace root. + * This is considered true if the import cannot be resolved relative to the containing file, + * but can be resolved relative to the workspace root. + * + * @param specifier The import specifier to check. + * @param filePath The path of the file containing the import. + * @param tree A Schematics tree instance. + * @param fromImport Whether the specifier is from an `@import` rule. + * @returns `true` if the import is likely workspace-relative; otherwise, `false`. + */ +function isWorkspaceRelativeSassImport( + specifier: string, + filePath: string, + tree: Tree, + fromImport: boolean, +): boolean { + const relativeBase = dirname(filePath); + const potentialWorkspacePaths = [...potentialSassImports(specifier, '/', fromImport)]; + + if (potentialWorkspacePaths.some((p) => tree.exists(p))) { + const potentialRelativePaths = [...potentialSassImports(specifier, relativeBase, fromImport)]; + + return potentialRelativePaths.every((p) => !tree.exists(p)); + } + + return false; +} + +/** + * Analyzes a single stylesheet's content for import patterns that need to be updated. + * + * @param filePath The path of the stylesheet file. + * @param content The content of the stylesheet file. + * @param tree A Schematics tree instance. + * @returns A `StylesheetAnalysis` object containing the results of the analysis. + */ +function analyzeStylesheet(filePath: string, content: string, tree: Tree): StylesheetAnalysis { + const isSass = filePath.endsWith('.scss') || filePath.endsWith('.sass'); + const analysis: StylesheetAnalysis = { + needsWorkspaceIncludePath: false, + externalDependencies: new Set(), + contentChanges: [], + }; + + for (const { start, specifier, fromUse } of findImports(content, isSass)) { + if (specifier.startsWith('~')) { + analysis.contentChanges.push({ start: start + 1, length: 1 }); + } else if (specifier.startsWith('^')) { + analysis.contentChanges.push({ start: start + 1, length: 1 }); + analysis.externalDependencies.add(specifier.slice(1)); + } else if (isSass && isWorkspaceRelativeSassImport(specifier, filePath, tree, !fromUse)) { + analysis.needsWorkspaceIncludePath = true; + } + } + + return analysis; +} + +/** + * The main orchestrator function for updating stylesheets. + * It iterates through all stylesheets in a project, analyzes them, and applies the necessary + * changes to the files and the build configuration. + * + * @param tree A Schematics tree instance. + * @param projectSourceRoot The source root of the project being updated. + * @param buildTarget The build target of the project being updated. + */ +export function updateStyleImports( + tree: Tree, + projectSourceRoot: string, + buildTarget: TargetDefinition, +): void { + const allExternalDeps = new Set(); + let projectNeedsIncludePath = false; + + for (const [path, content] of visitStylesheets(tree.getDir(projectSourceRoot))) { + const { needsWorkspaceIncludePath, externalDependencies, contentChanges } = analyzeStylesheet( + path, + content, + tree, + ); + + if (needsWorkspaceIncludePath) { + projectNeedsIncludePath = true; + } + + for (const dep of externalDependencies) { + allExternalDeps.add(dep); + } + + if (contentChanges.length > 0) { + const updater = tree.beginUpdate(path); + // Apply changes in reverse to avoid index shifting + for (const change of contentChanges.sort((a, b) => b.start - a.start)) { + updater.remove(change.start, change.length); + } + tree.commitUpdate(updater); + } + } + + if (projectNeedsIncludePath) { + buildTarget.options ??= {}; + const styleOptions = (buildTarget.options['stylePreprocessorOptions'] ??= {}); + const includePaths = ((styleOptions as { includePaths?: string[] })['includePaths'] ??= []); + if (Array.isArray(includePaths)) { + includePaths.push('.'); + } + } + + if (allExternalDeps.size > 0) { + buildTarget.options ??= {}; + const externalDeps = ((buildTarget.options['externalDependencies'] as string[] | undefined) ??= + []); + if (Array.isArray(externalDeps)) { + externalDeps.push(...allExternalDeps); + } + } +} + +/** + * A helper generator that yields potential Sass import candidates for a given filename and extensions. + * + * @param directory The directory in which to resolve the candidates. + * @param filename The base filename of the import. + * @param extensions The file extensions to try. + * @param fromImport Whether the specifier is from an `@import` rule. + * @returns An iterable of potential import file paths. + */ +function* yieldSassImportCandidates( + directory: string, + filename: string, + extensions: readonly string[], + fromImport: boolean, +): Iterable { + if (fromImport) { + for (const ext of extensions) { + yield join(directory, filename + '.import' + ext); + yield join(directory, SASS_PARTIAL_PREFIX + filename + '.import' + ext); + } + } + for (const ext of extensions) { + yield join(directory, filename + ext); + yield join(directory, SASS_PARTIAL_PREFIX + filename + ext); + } +} + +/** + * Generates a sequence of potential file paths that the Sass compiler would attempt to resolve + * for a given import specifier, following the official Sass resolution algorithm. + * Based on https://github.com/sass/dart-sass/blob/44d6bb6ac72fe6b93f5bfec371a1fffb18e6b76d/lib/src/importer/utils.dart + * + * @param specifier The import specifier to resolve. + * @param base The base path from which to resolve the specifier. + * @param fromImport Whether the specifier is from an `@import` rule. + * @returns An iterable of potential file paths. + */ +function* potentialSassImports( + specifier: string, + base: string, + fromImport: boolean, +): Iterable { + const directory = join(base, dirname(specifier)); + const extension = extname(specifier); + const hasStyleExtension = SASS_EXTENSIONS.includes(extension); + const filename = basename(specifier, hasStyleExtension ? extension : undefined); + + const extensionsToTry = hasStyleExtension ? [extension] : SASS_EXTENSIONS; + yield* yieldSassImportCandidates(directory, filename, extensionsToTry, fromImport); +} diff --git a/packages/schematics/angular/migrations/use-application-builder/stylesheet-updates_spec.ts b/packages/schematics/angular/migrations/use-application-builder/stylesheet-updates_spec.ts new file mode 100644 index 000000000000..fb188cb2ca5f --- /dev/null +++ b/packages/schematics/angular/migrations/use-application-builder/stylesheet-updates_spec.ts @@ -0,0 +1,179 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { Tree } from '@angular-devkit/schematics'; +import { ProjectDefinition, TargetDefinition, WorkspaceDefinition } from '../../utility/workspace'; +import { + hasLessStylesheets, + hasPostcssConfiguration, + updateStyleImports, +} from './stylesheet-updates'; + +interface StylePreprocessorOptions { + includePaths?: string[]; + otherOption?: boolean; +} + +describe('Migration to use application builder: stylesheet updates', () => { + let tree: Tree; + let workspace: WorkspaceDefinition; + let buildTarget: TargetDefinition; + + beforeEach(() => { + tree = Tree.empty(); + buildTarget = { + builder: '@angular-devkit/build-angular:browser', + options: {}, + }; + + const testProject: ProjectDefinition = { + root: 'test', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + targets: new Map([['build', buildTarget]]) as any, + prefix: 'app', + sourceRoot: 'test/src', + extensions: {}, + }; + + workspace = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + projects: new Map([['test', testProject]]) as any, + extensions: {}, + }; + + // Create some common files for testing + tree.create('/node_modules/@angular/material/_index.scss', '// Fake Angular Material styles'); + tree.create('/test/src/styles.scss', '@import "./app/app.component.scss";'); + }); + + describe('hasLessStylesheets', () => { + it('should return true if a .less file exists in the root', () => { + tree.create('/test.less', ''); + expect(hasLessStylesheets(tree)).toBe(true); + }); + + it('should return true if a .less file exists in a subdirectory', () => { + tree.create('/src/app.less', ''); + expect(hasLessStylesheets(tree)).toBe(true); + }); + + it('should return false if no .less files exist', () => { + tree.create('/src/app.css', ''); + expect(hasLessStylesheets(tree)).toBe(false); + }); + + it('should ignore files in node_modules', () => { + tree.create('/node_modules/library/style.less', ''); + expect(hasLessStylesheets(tree)).toBe(false); + }); + + it('should ignore files in dot-prefixed directories', () => { + tree.create('/.hidden/style.less', ''); + expect(hasLessStylesheets(tree)).toBe(false); + }); + }); + + describe('hasPostcssConfiguration', () => { + it('should return true if postcss.config.json exists in the root', () => { + tree.create('/postcss.config.json', '{}'); + expect(hasPostcssConfiguration(tree, workspace)).toBe(true); + }); + + it('should return true if .postcssrc.json exists in the root', () => { + tree.create('/.postcssrc.json', '{}'); + expect(hasPostcssConfiguration(tree, workspace)).toBe(true); + }); + + it('should return true if postcss.config.json exists in a project root', () => { + tree.create('/test/postcss.config.json', '{}'); + expect(hasPostcssConfiguration(tree, workspace)).toBe(true); + }); + + it('should return false if no config files exist', () => { + expect(hasPostcssConfiguration(tree, workspace)).toBe(false); + }); + }); + + describe('updateStyleImports', () => { + it('should remove "~" from an @import rule', () => { + tree.create('/test/src/app/app.component.scss', '@import "~@angular/material";'); + updateStyleImports(tree, 'test/src', buildTarget); + const content = tree.readText('/test/src/app/app.component.scss'); + expect(content).toBe('@import "@angular/material";'); + }); + + it('should remove "~" from a @use rule', () => { + tree.create('/test/src/app/app.component.scss', '@use "~@angular/material";'); + updateStyleImports(tree, 'test/src', buildTarget); + const content = tree.readText('/test/src/app/app.component.scss'); + expect(content).toBe('@use "@angular/material";'); + }); + + it('should remove "^" and add to externalDependencies', () => { + tree.create('/test/src/app/app.component.scss', '@import "^my-lib/styles.css";'); + updateStyleImports(tree, 'test/src', buildTarget); + const content = tree.readText('/test/src/app/app.component.scss'); + expect(content).toBe('@import "my-lib/styles.css";'); + expect(buildTarget.options?.['externalDependencies']).toEqual(['my-lib/styles.css']); + }); + + it('should aggregate multiple external dependencies', () => { + tree.create('/test/src/app/app.component.scss', '@import "^lib-a";'); + tree.create('/test/src/app/other.component.scss', '@import "^lib-b";'); + updateStyleImports(tree, 'test/src', buildTarget); + expect(buildTarget.options?.['externalDependencies']).toEqual(['lib-a', 'lib-b']); + }); + + it('should identify a workspace-relative import and add includePaths', () => { + tree.create('/assets/styles/theme.scss', '// Theme file'); + tree.create('/test/src/app/app.component.scss', '@import "assets/styles/theme.scss";'); + updateStyleImports(tree, 'test/src', buildTarget); + const styleOptions = buildTarget.options?.['stylePreprocessorOptions'] as + | StylePreprocessorOptions + | undefined; + expect(styleOptions?.includePaths).toEqual(['.']); + }); + + it('should not identify a standard relative import as workspace-relative', () => { + tree.create('/test/src/app/theme.scss', '// Theme file'); + tree.create('/test/src/app/app.component.scss', '@import "./theme.scss";'); + updateStyleImports(tree, 'test/src', buildTarget); + const styleOptions = buildTarget.options?.['stylePreprocessorOptions']; + expect(styleOptions).toBeUndefined(); + }); + + it('should correctly add includePaths when stylePreprocessorOptions already exists', () => { + buildTarget.options ??= {}; + buildTarget.options['stylePreprocessorOptions'] = { + otherOption: true, + }; + tree.create('/assets/styles/theme.scss', '// Theme file'); + tree.create('/test/src/app/app.component.scss', '@import "assets/styles/theme.scss";'); + updateStyleImports(tree, 'test/src', buildTarget); + const styleOptions = buildTarget.options?.['stylePreprocessorOptions'] as + | StylePreprocessorOptions + | undefined; + expect(styleOptions?.includePaths).toEqual(['.']); + expect(styleOptions?.otherOption).toBe(true); + }); + + it('should correctly add includePaths when includePaths already exists', () => { + buildTarget.options ??= {}; + buildTarget.options['stylePreprocessorOptions'] = { + includePaths: ['/some/other/path'], + }; + tree.create('/assets/styles/theme.scss', '// Theme file'); + tree.create('/test/src/app/app.component.scss', '@import "assets/styles/theme.scss";'); + updateStyleImports(tree, 'test/src', buildTarget); + const styleOptions = buildTarget.options?.['stylePreprocessorOptions'] as + | StylePreprocessorOptions + | undefined; + expect(styleOptions?.includePaths).toEqual(['/some/other/path', '.']); + }); + }); +}); diff --git a/packages/schematics/angular/module/index.ts b/packages/schematics/angular/module/index.ts index f7657783d866..6811ab55f3f1 100644 --- a/packages/schematics/angular/module/index.ts +++ b/packages/schematics/angular/module/index.ts @@ -8,6 +8,7 @@ import { Rule, + RuleFactory, Tree, apply, applyTemplates, @@ -27,11 +28,14 @@ import { addImportToModule, addRouteDeclarationToModule } from '../utility/ast-u import { InsertChange } from '../utility/change'; import { MODULE_EXT, + MODULE_EXT_LEGACY, ROUTING_MODULE_EXT, + ROUTING_MODULE_EXT_LEGACY, buildRelativePath, findModuleFromOptions, } from '../utility/find-module'; import { parseName } from '../utility/parse-name'; +import { createProjectSchematic } from '../utility/project'; import { validateClassName } from '../utility/validation'; import { createDefaultPath } from '../utility/workspace'; import { Schema as ModuleOptions, RoutingScope } from './schema'; @@ -114,11 +118,11 @@ function addRouteDeclarationToNgModule( function getRoutingModulePath(host: Tree, modulePath: string): string | undefined { const routingModulePath = - modulePath.endsWith(ROUTING_MODULE_EXT) || modulePath.endsWith('-routing-module.ts') + modulePath.endsWith(ROUTING_MODULE_EXT_LEGACY) || modulePath.endsWith(ROUTING_MODULE_EXT) ? modulePath : modulePath - .replace(MODULE_EXT, ROUTING_MODULE_EXT) - .replace('-module.ts', '-routing-module.ts'); + .replace(MODULE_EXT_LEGACY, ROUTING_MODULE_EXT_LEGACY) + .replace(MODULE_EXT, ROUTING_MODULE_EXT); return host.exists(routingModulePath) ? routingModulePath : undefined; } @@ -131,29 +135,21 @@ function buildRoute(options: ModuleOptions, modulePath: string) { return `{ path: '${options.route}', loadChildren: ${loadChildren} }`; } -export default function (options: ModuleOptions): Rule { - return async (host: Tree) => { +const moduleSchematic: RuleFactory = createProjectSchematic( + async (options, { tree }) => { if (options.path === undefined) { - options.path = await createDefaultPath(host, options.project); + options.path = await createDefaultPath(tree, options.project); } if (options.module) { - try { - options.module = findModuleFromOptions(host, options); - } catch { - options.module = findModuleFromOptions(host, { - ...options, - moduleExt: '-module.ts', - routingModuleExt: '-routing-module.ts', - }); - } + options.module = findModuleFromOptions(tree, options); } let routingModulePath; const isLazyLoadedModuleGen = !!(options.route && options.module); if (isLazyLoadedModuleGen) { options.routingScope = RoutingScope.Child; - routingModulePath = getRoutingModulePath(host, options.module as string); + routingModulePath = getRoutingModulePath(tree, options.module as string); } const parsedPath = parseName(options.path, options.name); @@ -195,5 +191,7 @@ export default function (options: ModuleOptions): Rule { mergeWith(templateSource), isLazyLoadedModuleGen ? schematic('component', componentOptions) : noop(), ]); - }; -} + }, +); + +export default moduleSchematic; diff --git a/packages/schematics/angular/ng-new/index.ts b/packages/schematics/angular/ng-new/index.ts index e9362726d4d1..856343e82b8f 100644 --- a/packages/schematics/angular/ng-new/index.ts +++ b/packages/schematics/angular/ng-new/index.ts @@ -23,8 +23,9 @@ import { RepositoryInitializerTask, } from '@angular-devkit/schematics/tasks'; import { Schema as ApplicationOptions } from '../application/schema'; +import { JSONFile } from '../utility/json-file'; import { Schema as WorkspaceOptions } from '../workspace/schema'; -import { Schema as NgNewOptions } from './schema'; +import { Schema as NgNewOptions, TestRunner } from './schema'; export default function (options: NgNewOptions): Rule { if (!options.directory) { @@ -50,6 +51,7 @@ export default function (options: NgNewOptions): Rule { routing: options.routing, style: options.style, skipTests: options.skipTests, + testRunner: options.testRunner, skipPackageJson: false, // always 'skipInstall' here, so that we do it after the move skipInstall: true, @@ -58,13 +60,28 @@ export default function (options: NgNewOptions): Rule { standalone: options.standalone, ssr: options.ssr, zoneless: options.zoneless, + fileNameStyleGuide: options.fileNameStyleGuide, }; return chain([ mergeWith( apply(empty(), [ schematic('workspace', workspaceOptions), + (tree: Tree) => { + if (options.testRunner === TestRunner.Karma) { + const file = new JSONFile(tree, 'angular.json'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const schematics = file.get(['schematics']) ?? ({} as any); + (schematics['@schematics/angular:application'] ??= {}).testRunner = TestRunner.Karma; + (schematics['@schematics/angular:library'] ??= {}).testRunner = TestRunner.Karma; + + file.modify(['schematics'], schematics); + } + }, options.createApplication ? schematic('application', applicationOptions) : noop, + schematic('ai-config', { + tool: options.aiConfig?.length ? options.aiConfig : undefined, + }), move(options.directory), ]), ), diff --git a/packages/schematics/angular/ng-new/index_spec.ts b/packages/schematics/angular/ng-new/index_spec.ts index 413cc6841934..28e1c13f315b 100644 --- a/packages/schematics/angular/ng-new/index_spec.ts +++ b/packages/schematics/angular/ng-new/index_spec.ts @@ -7,7 +7,7 @@ */ import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; -import { Schema as NgNewOptions } from './schema'; +import { Schema as NgNewOptions, TestRunner } from './schema'; describe('Ng New Schematic', () => { const schematicRunner = new SchematicTestRunner( @@ -58,7 +58,7 @@ describe('Ng New Schematic', () => { ); }); - it('should should set the prefix in angular.json and in app.ts', async () => { + it('should set the prefix in angular.json and in app.ts', async () => { const options = { ...defaultOptions, prefix: 'pre' }; const tree = await schematicRunner.runSchematic('ng-new', options); @@ -103,4 +103,95 @@ describe('Ng New Schematic', () => { const { cli } = JSON.parse(tree.readContent('/bar/angular.json')); expect(cli.packageManager).toBe('npm'); }); + + it('should add ai config file when aiConfig is set', async () => { + const options = { ...defaultOptions, aiConfig: ['gemini', 'claude'] }; + + const tree = await schematicRunner.runSchematic('ng-new', options); + const files = tree.files; + expect(files).toContain('/bar/.gemini/GEMINI.md'); + expect(files).toContain('/bar/.claude/CLAUDE.md'); + }); + + it('should create a tailwind project when style is tailwind', async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const options = { ...defaultOptions, style: 'tailwind' as any }; + const tree = await schematicRunner.runSchematic('ng-new', options); + + expect(tree.exists('/bar/.postcssrc.json')).toBe(true); + + const packageJson = JSON.parse(tree.readContent('/bar/package.json')); + expect(packageJson.devDependencies['tailwindcss']).toBeDefined(); + expect(packageJson.devDependencies['postcss']).toBeDefined(); + expect(packageJson.devDependencies['@tailwindcss/postcss']).toBeDefined(); + + const stylesContent = tree.readContent('/bar/src/styles.css'); + expect(stylesContent).toContain('@import "tailwindcss";'); + }); + + it(`should create files with file name style guide '2016'`, async () => { + const options = { ...defaultOptions, fileNameStyleGuide: '2016' }; + + const tree = await schematicRunner.runSchematic('ng-new', options); + const files = tree.files; + expect(files).toEqual( + jasmine.arrayContaining([ + '/bar/src/app/app.component.css', + '/bar/src/app/app.component.html', + '/bar/src/app/app.component.spec.ts', + '/bar/src/app/app.component.ts', + ]), + ); + + const { + projects: { + 'foo': { schematics }, + }, + } = JSON.parse(tree.readContent('/bar/angular.json')); + expect(schematics['@schematics/angular:component'].type).toBe('component'); + expect(schematics['@schematics/angular:directive'].type).toBe('directive'); + expect(schematics['@schematics/angular:service'].type).toBe('service'); + expect(schematics['@schematics/angular:guard'].typeSeparator).toBe('.'); + expect(schematics['@schematics/angular:interceptor'].typeSeparator).toBe('.'); + expect(schematics['@schematics/angular:module'].typeSeparator).toBe('.'); + expect(schematics['@schematics/angular:pipe'].typeSeparator).toBe('.'); + expect(schematics['@schematics/angular:resolver'].typeSeparator).toBe('.'); + }); + + it(`should set 'testRunner' to 'karma'`, async () => { + const options = { ...defaultOptions, testRunner: TestRunner.Karma }; + const tree = await schematicRunner.runSchematic('ng-new', options); + + const { + projects: { + 'foo': { + architect: { test }, + }, + }, + } = JSON.parse(tree.readContent('/bar/angular.json')); + expect(test.builder).toBe('@angular/build:unit-test'); + expect(test.options).toEqual({ runner: 'karma' }); + + const { devDependencies } = JSON.parse(tree.readContent('/bar/package.json')); + expect(devDependencies['karma']).toBeDefined(); + expect(devDependencies['jasmine-core']).toBeDefined(); + }); + + it(`should set 'testRunner' to 'karma' in workspace schematic options`, async () => { + const options = { ...defaultOptions, testRunner: TestRunner.Karma }; + const tree = await schematicRunner.runSchematic('ng-new', options); + + const { schematics } = JSON.parse(tree.readContent('/bar/angular.json')); + expect(schematics['@schematics/angular:application'].testRunner).toBe('karma'); + expect(schematics['@schematics/angular:library'].testRunner).toBe('karma'); + }); + + it(`should not add type to class name when file name style guide is '2016'`, async () => { + const options = { ...defaultOptions, fileNameStyleGuide: '2016' }; + + const tree = await schematicRunner.runSchematic('ng-new', options); + const appComponentContent = tree.readContent('/bar/src/app/app.component.ts'); + expect(appComponentContent).toContain('export class App {'); + expect(appComponentContent).not.toContain('export class AppComponent {'); + }); }); diff --git a/packages/schematics/angular/ng-new/schema.json b/packages/schematics/angular/ng-new/schema.json index d6381afce198..3bbb0eb3dee4 100644 --- a/packages/schematics/angular/ng-new/schema.json +++ b/packages/schematics/angular/ng-new/schema.json @@ -99,7 +99,7 @@ "style": { "description": "The type of stylesheet files to be created for components in the initial project.", "type": "string", - "enum": ["css", "scss", "sass", "less"], + "enum": ["css", "scss", "sass", "less", "tailwind"], "x-user-analytics": "ep.ng_style" }, "skipTests": { @@ -108,6 +108,12 @@ "default": false, "alias": "S" }, + "testRunner": { + "description": "The unit testing runner to use.", + "type": "string", + "enum": ["vitest", "karma"], + "default": "vitest" + }, "createApplication": { "description": "Create a new initial application project in the new workspace. When false, creates an empty workspace with no initial application. You can then use the `ng generate application` command to create applications in the `projects` directory.", "type": "boolean", @@ -126,7 +132,7 @@ "packageManager": { "description": "The package manager used to install dependencies.", "type": "string", - "enum": ["npm", "yarn", "pnpm", "cnpm", "bun"] + "enum": ["npm", "yarn", "pnpm", "bun"] }, "standalone": { "description": "Creates an application based upon the standalone API, without NgModules.", @@ -141,9 +147,22 @@ }, "zoneless": { "description": "Create an initial application that does not utilize `zone.js`.", - "x-prompt": "Do you want to create a 'zoneless' application without zone.js (Developer Preview)?", - "type": "boolean", - "default": false + "type": "boolean" + }, + "aiConfig": { + "type": "array", + "uniqueItems": true, + "description": "Specifies which AI tools to generate configuration files for. These file are used to improve the outputs of AI tools by following the best practices.", + "items": { + "type": "string", + "enum": ["none", "gemini", "copilot", "claude", "cursor", "jetbrains", "windsurf", "agents"] + } + }, + "fileNameStyleGuide": { + "type": "string", + "enum": ["2016", "2025"], + "default": "2025", + "description": "The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., `app.ts` for the root component), while the '2016' style guide includes the type in the file name (e.g., `app.component.ts`). For more information, see the Angular Style Guide (https://angular.dev/style-guide)." } }, "required": ["name", "version"] diff --git a/packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.ts.template b/packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.ts.template index 2e917b4b0503..57765121531e 100644 --- a/packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.ts.template +++ b/packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.ts.template @@ -1,8 +1,8 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: '<%= camelize(name) %>'<% if(!standalone) {%>, - standalone: false<%}%> + name: '<%= camelize(name) %>',<% if(!standalone) {%> + standalone: false,<%}%> }) export class <%= classify(name) %>Pipe implements PipeTransform { diff --git a/packages/schematics/angular/pipe/index.ts b/packages/schematics/angular/pipe/index.ts index 150b0bc20c57..c74307b1c6df 100644 --- a/packages/schematics/angular/pipe/index.ts +++ b/packages/schematics/angular/pipe/index.ts @@ -6,28 +6,20 @@ * found in the LICENSE file at https://angular.dev/license */ -import { Rule, Tree, chain, strings } from '@angular-devkit/schematics'; +import { RuleFactory, chain, strings } from '@angular-devkit/schematics'; import { addDeclarationToNgModule } from '../utility/add-declaration-to-ng-module'; import { findModuleFromOptions } from '../utility/find-module'; import { generateFromFiles } from '../utility/generate-from-files'; import { parseName } from '../utility/parse-name'; +import { createProjectSchematic } from '../utility/project'; import { validateClassName } from '../utility/validation'; import { createDefaultPath } from '../utility/workspace'; import { Schema as PipeOptions } from './schema'; -export default function (options: PipeOptions): Rule { - return async (host: Tree) => { - options.path ??= await createDefaultPath(host, options.project); - try { - options.module = findModuleFromOptions(host, options); - } catch { - options.module = findModuleFromOptions(host, { - ...options, - moduleExt: '-module.ts', - routingModuleExt: '-routing-module.ts', - }); - } - +const pipeSchematic: RuleFactory = createProjectSchematic( + async (options, { tree }) => { + options.path ??= await createDefaultPath(tree, options.project); + options.module = findModuleFromOptions(tree, options); const parsedPath = parseName(options.path, options.name); options.name = parsedPath.name; options.path = parsedPath.path; @@ -40,5 +32,7 @@ export default function (options: PipeOptions): Rule { }), generateFromFiles(options), ]); - }; -} + }, +); + +export default pipeSchematic; diff --git a/packages/schematics/angular/pipe/index_spec.ts b/packages/schematics/angular/pipe/index_spec.ts index 51f890e54ee1..677995a4bab9 100644 --- a/packages/schematics/angular/pipe/index_spec.ts +++ b/packages/schematics/angular/pipe/index_spec.ts @@ -8,7 +8,7 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; import { Schema as ApplicationOptions } from '../application/schema'; -import { createAppModule, getFileContent } from '../utility/test'; +import { createAppModule } from '../utility/test'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as PipeOptions } from './schema'; @@ -58,7 +58,7 @@ describe('Pipe Schematic', () => { const files = tree.files; expect(files).toContain('/projects/bar/src/app/foo-pipe.spec.ts'); expect(files).toContain('/projects/bar/src/app/foo-pipe.ts'); - const moduleContent = getFileContent(tree, '/projects/bar/src/app/app-module.ts'); + const moduleContent = tree.readText('/projects/bar/src/app/app-module.ts'); expect(moduleContent).toMatch(/import.*Foo.*from '.\/foo-pipe'/); expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooPipe\r?\n/m); const fileContent = tree.readContent('/projects/bar/src/app/foo-pipe.ts'); @@ -77,7 +77,7 @@ describe('Pipe Schematic', () => { const files = tree.files; expect(files).toContain('/projects/bar/src/app/foo.pipe.spec.ts'); expect(files).toContain('/projects/bar/src/app/foo.pipe.ts'); - const moduleContent = getFileContent(tree, '/projects/bar/src/app/app-module.ts'); + const moduleContent = tree.readText('/projects/bar/src/app/app-module.ts'); expect(moduleContent).toMatch(/import.*Foo.*from '.\/foo.pipe'/); expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooPipe\r?\n/m); const fileContent = tree.readContent('/projects/bar/src/app/foo.pipe.ts'); @@ -96,7 +96,7 @@ describe('Pipe Schematic', () => { const files = tree.files; expect(files).toContain('/projects/bar/src/app/foo-pipe.spec.ts'); expect(files).toContain('/projects/bar/src/app/foo-pipe.ts'); - const moduleContent = getFileContent(tree, '/projects/bar/src/app/app-module.ts'); + const moduleContent = tree.readText('/projects/bar/src/app/app-module.ts'); expect(moduleContent).toMatch(/import.*Foo.*from '.\/foo-pipe'/); expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooPipe\r?\n/m); const fileContent = tree.readContent('/projects/bar/src/app/foo-pipe.ts'); @@ -107,7 +107,7 @@ describe('Pipe Schematic', () => { const options = { ...defaultNonStandaloneOptions, module: 'app-module.ts' }; const tree = await schematicRunner.runSchematic('pipe', options, appTree); - const appModule = getFileContent(tree, '/projects/bar/src/app/app-module.ts'); + const appModule = tree.readText('/projects/bar/src/app/app-module.ts'); expect(appModule).toMatch(/import { FooPipe } from '.\/foo-pipe'/); }); @@ -139,7 +139,7 @@ describe('Pipe Schematic', () => { const options = { ...defaultNonStandaloneOptions, export: true }; const tree = await schematicRunner.runSchematic('pipe', options, appTree); - const appModuleContent = getFileContent(tree, '/projects/bar/src/app/app-module.ts'); + const appModuleContent = tree.readText('/projects/bar/src/app/app-module.ts'); expect(appModuleContent).toMatch(/exports: \[\n(\s*) {2}FooPipe\n\1\]/); }); @@ -150,7 +150,7 @@ describe('Pipe Schematic', () => { const files = tree.files; expect(files).toContain('/projects/bar/src/app/foo/foo-pipe.spec.ts'); expect(files).toContain('/projects/bar/src/app/foo/foo-pipe.ts'); - const moduleContent = getFileContent(tree, '/projects/bar/src/app/app-module.ts'); + const moduleContent = tree.readText('/projects/bar/src/app/app-module.ts'); expect(moduleContent).toMatch(/import.*Foo.*from '.\/foo\/foo-pipe'/); expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooPipe\r?\n/m); }); @@ -161,7 +161,7 @@ describe('Pipe Schematic', () => { const newTree = createAppModule(appTree, routingModulePath); const options = { ...defaultNonStandaloneOptions, module: routingFileName }; const tree = await schematicRunner.runSchematic('pipe', options, newTree); - const content = getFileContent(tree, routingModulePath); + const content = tree.readText(routingModulePath); expect(content).toMatch(/import { FooPipe } from '.\/foo-pipe/); }); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/index.ts b/packages/schematics/angular/refactor/jasmine-vitest/index.ts new file mode 100644 index 000000000000..0e2f2e35b9e7 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/index.ts @@ -0,0 +1,140 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { + DirEntry, + Rule, + SchematicContext, + SchematicsException, + Tree, +} from '@angular-devkit/schematics'; +import { join, normalize } from 'node:path/posix'; +import { ProjectDefinition, getWorkspace } from '../../utility/workspace'; +import { Schema } from './schema'; +import { transformJasmineToVitest } from './test-file-transformer'; +import { RefactorReporter } from './utils/refactor-reporter'; + +async function getProject( + tree: Tree, + projectName: string | undefined, +): Promise<{ project: ProjectDefinition; name: string }> { + const workspace = await getWorkspace(tree); + + if (projectName) { + const project = workspace.projects.get(projectName); + if (!project) { + throw new SchematicsException(`Project "${projectName}" not found.`); + } + + return { project, name: projectName }; + } + + if (workspace.projects.size === 1) { + const [name, project] = Array.from(workspace.projects.entries())[0]; + + return { project, name }; + } + + const projectNames = Array.from(workspace.projects.keys()); + throw new SchematicsException( + `Multiple projects found: [${projectNames.join(', ')}]. Please specify a project name.`, + ); +} + +const DIRECTORIES_TO_SKIP = new Set(['node_modules', '.git', 'dist', '.angular']); + +function findTestFiles(directory: DirEntry, fileSuffix: string): string[] { + const files: string[] = []; + const stack: DirEntry[] = [directory]; + + let current: DirEntry | undefined; + while ((current = stack.pop())) { + for (const path of current.subfiles) { + if (path.endsWith(fileSuffix)) { + files.push(current.path + '/' + path); + } + } + + for (const path of current.subdirs) { + if (DIRECTORIES_TO_SKIP.has(path)) { + continue; + } + stack.push(current.dir(path)); + } + } + + return files; +} + +export default function (options: Schema): Rule { + return async (tree: Tree, context: SchematicContext) => { + const reporter = new RefactorReporter(context.logger); + const { project, name: projectName } = await getProject(tree, options.project); + const projectRoot = project.root; + const fileSuffix = options.fileSuffix ?? '.spec.ts'; + + let files: string[]; + let searchScope: string; + + if (options.include) { + const normalizedInclude = options.include.replace(/\\/g, '/'); + const includePath = normalize(join(projectRoot, normalizedInclude)); + searchScope = options.include; + + let dirEntry: DirEntry | null = null; + try { + dirEntry = tree.getDir(includePath); + } catch { + // Path is not a directory. + } + + // Approximation of a directory exists check + if (dirEntry && (dirEntry.subdirs.length > 0 || dirEntry.subfiles.length > 0)) { + // It is a directory + files = findTestFiles(dirEntry, fileSuffix); + } else if (tree.exists(includePath)) { + // It is a file + files = [includePath]; + } else { + throw new SchematicsException( + `The specified include path '${options.include}' does not exist.`, + ); + } + } else { + searchScope = `project '${projectName}'`; + files = findTestFiles(tree.getDir(projectRoot), fileSuffix); + } + + if (files.length === 0) { + throw new SchematicsException( + `No files ending with '${fileSuffix}' found in ${searchScope}.`, + ); + } + + for (const file of files) { + reporter.incrementScannedFiles(); + const content = tree.readText(file); + const newContent = transformJasmineToVitest(file, content, reporter, { + addImports: !!options.addImports, + browserMode: !!options.browerMode, + }); + + if (content !== newContent) { + tree.overwrite(file, newContent); + reporter.incrementTransformedFiles(); + } + } + + if (options.report) { + const reportContent = reporter.generateReportContent(); + tree.create(`jasmine-vitest-${new Date().toISOString()}.md`, reportContent); + } + + reporter.printSummary(options.verbose); + }; +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/index_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/index_spec.ts new file mode 100644 index 000000000000..fcb804886286 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/index_spec.ts @@ -0,0 +1,237 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; +import { Schema as ApplicationOptions } from '../../application/schema'; +import { Schema as WorkspaceOptions } from '../../workspace/schema'; + +describe('Jasmine to Vitest Schematic', () => { + const schematicRunner = new SchematicTestRunner( + '@schematics/angular', + require.resolve('../../collection.json'), + ); + + let appTree: UnitTestTree; + + const workspaceOptions: WorkspaceOptions = { + name: 'workspace', + newProjectRoot: 'projects', + version: '20.0.0', + }; + + const appOptions: ApplicationOptions = { + name: 'bar', + inlineStyle: false, + inlineTemplate: false, + routing: false, + skipTests: false, + skipPackageJson: false, + }; + + beforeEach(async () => { + appTree = await schematicRunner.runSchematic('workspace', workspaceOptions); + appTree = await schematicRunner.runSchematic('application', appOptions, appTree); + }); + + it('should transform a basic Jasmine test file', async () => { + const specFilePath = 'projects/bar/src/app/app.spec.ts'; + const content = ` + describe('AppComponent', () => { + it('should create the app', () => { + const service = { myMethod: () => {} }; + spyOn(service, 'myMethod'); + service.myMethod(); + expect(service.myMethod).toHaveBeenCalled(); + }); + }); + `; + appTree.overwrite(specFilePath, content); + + const tree = await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar' }, + appTree, + ); + + const newContent = tree.readContent(specFilePath); + expect(newContent).toContain(`vi.spyOn(service, 'myMethod');`); + }); + + it('should only transform files matching the fileSuffix option', async () => { + const specFilePath = 'projects/bar/src/app/app.spec.ts'; + const specFileContent = ` + describe('AppComponent', () => { + it('should test something', () => { + spyOn(window, 'alert'); + }); + }); + `; + appTree.overwrite(specFilePath, specFileContent); + + const testFilePath = 'projects/bar/src/app/app.test.ts'; + const testFileContent = ` + describe('AppComponent Test', () => { + it('should test another thing', () => { + spyOn(window, 'confirm'); + }); + }); + `; + appTree.create(testFilePath, testFileContent); + + const tree = await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar', fileSuffix: '.test.ts' }, + appTree, + ); + + const unchangedContent = tree.readContent(specFilePath); + expect(unchangedContent).toContain(`spyOn(window, 'alert');`); + expect(unchangedContent).not.toContain(`vi.spyOn(window, 'alert');`); + + const changedContent = tree.readContent(testFilePath); + expect(changedContent).toContain(`vi.spyOn(window, 'confirm');`); + }); + + it('should print verbose logs when the verbose option is true', async () => { + const specFilePath = 'projects/bar/src/app/app.spec.ts'; + const content = ` + describe('AppComponent', () => { + it('should create the app', () => { + const service = { myMethod: () => {} }; + spyOn(service, 'myMethod'); + }); + }); + `; + appTree.overwrite(specFilePath, content); + + const logs: string[] = []; + schematicRunner.logger.subscribe((entry) => logs.push(entry.message)); + + await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar', verbose: true }, + appTree, + ); + + expect(logs).toContain('Detailed Transformation Log:'); + expect(logs).toContain(`Processing: /${specFilePath}`); + expect(logs.some((log) => log.includes('Transformed `spyOn` to `vi.spyOn`'))).toBe(true); + }); + + describe('with `include` option', () => { + beforeEach(() => { + // Create a nested structure for testing directory-specific inclusion + appTree.create( + 'projects/bar/src/app/nested/nested.spec.ts', + `describe('Nested', () => { it('should work', () => { spyOn(window, 'confirm'); }); });`, + ); + appTree.overwrite( + 'projects/bar/src/app/app.spec.ts', + `describe('App', () => { it('should work', () => { spyOn(window, 'alert'); }); });`, + ); + }); + + it('should only transform the specified file', async () => { + const tree = await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar', include: 'src/app/nested/nested.spec.ts' }, + appTree, + ); + + const changedContent = tree.readContent('projects/bar/src/app/nested/nested.spec.ts'); + expect(changedContent).toContain(`vi.spyOn(window, 'confirm');`); + + const unchangedContent = tree.readContent('projects/bar/src/app/app.spec.ts'); + expect(unchangedContent).toContain(`spyOn(window, 'alert');`); + }); + + it('should handle a Windows-style path', async () => { + const tree = await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar', include: 'src\\app\\nested\\nested.spec.ts' }, + appTree, + ); + + const changedContent = tree.readContent('projects/bar/src/app/nested/nested.spec.ts'); + expect(changedContent).toContain(`vi.spyOn(window, 'confirm');`); + + const unchangedContent = tree.readContent('projects/bar/src/app/app.spec.ts'); + expect(unchangedContent).toContain(`spyOn(window, 'alert');`); + }); + + it('should only transform files in the specified directory', async () => { + appTree.create( + 'projects/bar/src/other/other.spec.ts', + `describe('Other', () => { it('should work', () => { spyOn(window, 'close'); }); });`, + ); + + const tree = await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar', include: 'src/app' }, + appTree, + ); + + const changedAppContent = tree.readContent('projects/bar/src/app/app.spec.ts'); + expect(changedAppContent).toContain(`vi.spyOn(window, 'alert');`); + + const changedNestedContent = tree.readContent('projects/bar/src/app/nested/nested.spec.ts'); + expect(changedNestedContent).toContain(`vi.spyOn(window, 'confirm');`); + + const unchangedContent = tree.readContent('projects/bar/src/other/other.spec.ts'); + expect(unchangedContent).toContain(`spyOn(window, 'close');`); + }); + + it('should process all files if `include` is not provided', async () => { + const tree = await schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar' }, + appTree, + ); + + const changedAppContent = tree.readContent('projects/bar/src/app/app.spec.ts'); + expect(changedAppContent).toContain(`vi.spyOn(window, 'alert');`); + + const changedNestedContent = tree.readContent('projects/bar/src/app/nested/nested.spec.ts'); + expect(changedNestedContent).toContain(`vi.spyOn(window, 'confirm');`); + }); + + it('should throw if the include path does not exist', async () => { + await expectAsync( + schematicRunner.runSchematic( + 'refactor-jasmine-vitest', + { project: 'bar', include: 'src/non-existent' }, + appTree, + ), + ).toBeRejectedWithError(`The specified include path 'src/non-existent' does not exist.`); + }); + }); + + it('should print a summary report after running', async () => { + const specFilePath = 'projects/bar/src/app/app.spec.ts'; + const content = ` + describe('AppComponent', () => { + it('should create the app', () => { + const service = { myMethod: () => {} }; + jasmine.spyOnAllFunctions(service); + }); + }); + `; + appTree.overwrite(specFilePath, content); + + const logs: string[] = []; + schematicRunner.logger.subscribe((entry) => logs.push(entry.message)); + + await schematicRunner.runSchematic('refactor-jasmine-vitest', {}, appTree); + + expect(logs).toContain('Jasmine to Vitest Refactoring Summary:'); + expect(logs).toContain('- 1 test file(s) scanned.'); + expect(logs).toContain('- 1 file(s) transformed.'); + expect(logs).toContain('- 1 TODO(s) added for manual review:'); + expect(logs).toContain(' - 1x spyOnAllFunctions'); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/schema.json b/packages/schematics/angular/refactor/jasmine-vitest/schema.json new file mode 100644 index 000000000000..4192a27367fd --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/schema.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "SchematicsAngularJasmineToVitest", + "title": "Angular Jasmine to Vitest Schematic", + "type": "object", + "description": "Refactors a Jasmine test file to use Vitest.", + "properties": { + "include": { + "type": "string", + "description": "A path to a specific file or directory to refactor. If not provided, all test files in the project will be refactored." + }, + "fileSuffix": { + "type": "string", + "description": "The file suffix to identify test files (e.g., '.spec.ts', '.test.ts').", + "default": ".spec.ts" + }, + "project": { + "type": "string", + "description": "The name of the project where the tests should be refactored. If not specified, the CLI will determine the project from the current directory.", + "$default": { + "$source": "projectName" + } + }, + "verbose": { + "type": "boolean", + "description": "Enable verbose logging to see detailed information about the transformations being applied.", + "default": false + }, + "addImports": { + "type": "boolean", + "description": "Whether to add imports for the Vitest API. The Angular `unit-test` system automatically uses the Vitest globals option, which means explicit imports for global APIs like `describe`, `it`, `expect`, and `vi` are often not strictly necessary unless Vitest has been configured not to use globals.", + "default": false + }, + "browserMode": { + "type": "boolean", + "description": "Whether the tests are intended to run in browser mode. If true, the `toHaveClass` assertions are left as is because Vitest browser mode has such an assertion. Otherwise they're migrated to an equivalent assertion.", + "default": false + }, + "report": { + "type": "boolean", + "description": "Whether to generate a summary report file (jasmine-vitest-.md) in the project root.", + "default": true + } + } +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts new file mode 100644 index 000000000000..d037ed5c7f08 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts @@ -0,0 +1,501 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { logging } from '@angular-devkit/core'; +import { format } from 'prettier'; +import { transformJasmineToVitest } from './test-file-transformer'; +import { RefactorReporter } from './utils/refactor-reporter'; + +async function expectTransformation( + input: string, + expected: string, + options: { addImports: boolean; browserMode: boolean } = { + addImports: false, + browserMode: false, + }, +): Promise { + const logger = new logging.NullLogger(); + const reporter = new RefactorReporter(logger); + const transformed = transformJasmineToVitest('spec.ts', input, reporter, options); + const formattedTransformed = await format(transformed, { parser: 'typescript' }); + const formattedExpected = await format(expected, { parser: 'typescript' }); + + expect(formattedTransformed).toBe(formattedExpected); +} + +describe('Jasmine to Vitest Transformer - Integration Tests', () => { + it('should transform a basic component test file', async () => { + const jasmineCode = ` + import { ComponentFixture, TestBed } from '@angular/core/testing'; + import { MyComponent } from './my.component'; + import { MyService } from './my.service'; + + describe('MyComponent', () => { + let component: MyComponent; + let fixture: ComponentFixture; + let myService: MyService; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [MyComponent], + providers: [MyService], + }); + + fixture = TestBed.createComponent(MyComponent); + component = fixture.componentInstance; + myService = TestBed.inject(MyService); + spyOn(myService, 'getValue').and.returnValue('mock value'); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should get value from service on init', () => { + fixture.detectChanges(); + expect(myService.getValue).toHaveBeenCalled(); + expect(component.value).toBe('mock value'); + }); + + it('should handle user click', () => { + spyOn(window, 'alert'); + const button = fixture.nativeElement.querySelector('button'); + button.click(); + fixture.detectChanges(); + expect(window.alert).toHaveBeenCalledWith('button clicked'); + }); + + xit('a skipped test', () => { + // This test is skipped + }); + }); + `; + + const vitestCode = ` + import { ComponentFixture, TestBed } from '@angular/core/testing'; + import { MyComponent } from './my.component'; + import { MyService } from './my.service'; + + describe('MyComponent', () => { + let component: MyComponent; + let fixture: ComponentFixture; + let myService: MyService; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [MyComponent], + providers: [MyService], + }); + + fixture = TestBed.createComponent(MyComponent); + component = fixture.componentInstance; + myService = TestBed.inject(MyService); + vi.spyOn(myService, 'getValue').mockReturnValue('mock value'); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should get value from service on init', () => { + fixture.detectChanges(); + expect(myService.getValue).toHaveBeenCalled(); + expect(component.value).toBe('mock value'); + }); + + it('should handle user click', () => { + vi.spyOn(window, 'alert'); + const button = fixture.nativeElement.querySelector('button'); + button.click(); + fixture.detectChanges(); + expect(window.alert).toHaveBeenCalledWith('button clicked'); + }); + + it.skip('a skipped test', () => { + // This test is skipped + }); + }); + `; + + await expectTransformation(jasmineCode, vitestCode); + }); + + it('should transform a service test with async operations and timer mocks', async () => { + const jasmineCode = ` + import { TestBed } from '@angular/core/testing'; + import { MyService } from './my.service'; + + describe('MyService', () => { + let service: MyService; + + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [MyService], + }); + service = TestBed.inject(MyService); + jasmine.clock().install(); + }); + + afterEach(() => { + jasmine.clock().uninstall(); + }); + + it('should do something async with done', (done) => { + service.fetchData().then(data => { + expect(data).toEqual({ value: 'real data' }); + done(); + }); + }); + + it('should handle timeouts', () => { + let value = ''; + setTimeout(() => { + value = 'done'; + }, 1000); + + jasmine.clock().tick(500); + expect(value).toBe(''); + jasmine.clock().tick(500); + expect(value).toBe('done'); + }); + + fit('a focused test for async behavior', async () => { + const promise = Promise.resolve('resolved'); + await expectAsync(promise).toBeResolvedTo('resolved'); + }); + }); + `; + + const vitestCode = ` + import { TestBed } from '@angular/core/testing'; + import { MyService } from './my.service'; + + describe('MyService', () => { + let service: MyService; + + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [MyService], + }); + service = TestBed.inject(MyService); + vi.useFakeTimers(); + }); + + afterEach(() => { + vi.useRealTimers(); + }); + + it('should do something async with done', async () => { + await service.fetchData().then(data => { + expect(data).toEqual({ value: 'real data' }); + }); + }); + + it('should handle timeouts', () => { + let value = ''; + setTimeout(() => { + value = 'done'; + }, 1000); + + vi.advanceTimersByTime(500); + expect(value).toBe(''); + vi.advanceTimersByTime(500); + expect(value).toBe('done'); + }); + + it.only('a focused test for async behavior', async () => { + const promise = Promise.resolve('resolved'); + await expect(promise).resolves.toEqual('resolved'); + }); + }); + `; + + await expectTransformation(jasmineCode, vitestCode); + }); + + it('should transform a file with complex spies and matchers', async () => { + const jasmineCode = ` + describe('Complex Scenarios', () => { + let serviceMock; + + beforeEach(() => { + serviceMock = jasmine.createSpyObj('MyService', { + getData: jasmine.any(String), + process: undefined, + }); + }); + + it('should use asymmetric matchers correctly', () => { + const result = serviceMock.getData(); + expect(result).toEqual(jasmine.any(String)); + expect({ foo: 'bar', baz: 'qux' }).toEqual(jasmine.objectContaining({ foo: 'bar' })); + }); + + it('should handle array contents checking', () => { + const arr = [1, 2, 3]; + expect(arr).toEqual(jasmine.arrayWithExactContents([3, 2, 1])); + }); + + it('should handle spy call order', () => { + const spyA = jasmine.createSpy('spyA'); + const spyB = jasmine.createSpy('spyB'); + spyA(); + spyB(); + expect(spyA).toHaveBeenCalledBefore(spyB); + }); + + it('should handle called once with', () => { + serviceMock.process('data'); + expect(serviceMock.process).toHaveBeenCalledOnceWith('data'); + }); + + it('should handle spy inspection', () => { + serviceMock.process('arg1', 'arg2'); + expect(serviceMock.process.calls.mostRecent().args).toEqual(['arg1', 'arg2']); + expect(serviceMock.process.calls.count()).toBe(1); + }); + }); + `; + + /* eslint-disable max-len */ + const vitestCode = ` + describe('Complex Scenarios', () => { + let serviceMock; + + beforeEach(() => { + serviceMock = { + getData: vi.fn().mockName("MyService.getData").mockReturnValue(expect.any(String)), + process: vi.fn().mockName("MyService.process").mockReturnValue(undefined), + }; + }); + + it('should use asymmetric matchers correctly', () => { + const result = serviceMock.getData(); + expect(result).toEqual(expect.any(String)); + expect({ foo: 'bar', baz: 'qux' }).toEqual(expect.objectContaining({ foo: 'bar' })); + }); + + it('should handle array contents checking', () => { + const arr = [1, 2, 3]; + // TODO: vitest-migration: Verify this matches strict array content (multiset equality). Vitest's arrayContaining is a subset check. + expect(arr).toHaveLength(3); + expect(arr).toEqual(expect.arrayContaining([3, 2, 1])); + }); + + it('should handle spy call order', () => { + const spyA = vi.fn(); + const spyB = vi.fn(); + spyA(); + spyB(); + expect(Math.min(...vi.mocked(spyA).mock.invocationCallOrder)).toBeLessThan(Math.min(...vi.mocked(spyB).mock.invocationCallOrder)); + }); + + it('should handle called once with', () => { + serviceMock.process('data'); + expect(serviceMock.process).toHaveBeenCalledTimes(1); + expect(serviceMock.process).toHaveBeenCalledWith('data'); + }); + + it('should handle spy inspection', () => { + serviceMock.process('arg1', 'arg2'); + expect(vi.mocked(serviceMock.process).mock.lastCall).toEqual(['arg1', 'arg2']); + expect(vi.mocked(serviceMock.process).mock.calls.length).toBe(1); + }); + }); + `; + /* eslint-enable max-len */ + + await expectTransformation(jasmineCode, vitestCode); + }); + + it('should handle various other Jasmine APIs', async () => { + const jasmineCode = ` + describe('Miscellaneous APIs', () => { + let el: HTMLElement; + + beforeEach(() => { + el = document.createElement('div'); + jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + }); + + it('should handle DOM matchers like toHaveClass', () => { + el.classList.add('my-class'); + expect(el).withContext('element should have my-class').toHaveClass('my-class'); + el.classList.remove('my-class'); + expect(el).not.toHaveClass('my-class'); + }); + + it('should handle pending tests', () => { + pending('This test is not yet implemented.'); + }); + + it('should handle fail()', () => { + if (true) { + fail('This should not have happened'); + } + }); + + it('should handle spyOnProperty', () => { + const obj = { get myProp() { return 'original'; } }; + spyOnProperty(obj, 'myProp', 'get').and.returnValue('mocked'); + expect(obj.myProp).toBe('mocked'); + }); + + it('should handle spies throwing errors', () => { + const spy = jasmine.createSpy('mySpy').and.throwError('Test Error'); + expect(() => spy()).toThrowError('Test Error'); + }); + }); + `; + + const vitestCode = ` + describe('Miscellaneous APIs', () => { + let el: HTMLElement; + + beforeEach(() => { + el = document.createElement('div'); + vi.setConfig({ testTimeout: 10000 }); + }); + + it('should handle DOM matchers like toHaveClass', () => { + el.classList.add('my-class'); + expect(el.classList.contains('my-class'), 'element should have my-class').toBe(true); + el.classList.remove('my-class'); + expect(el.classList.contains('my-class')).toBe(false); + }); + + it.skip('should handle pending tests', () => { + // TODO: vitest-migration: The pending() function was converted to a skipped test (\`it.skip\`). See: https://vitest.dev/api/vi.html#it-skip + // pending('This test is not yet implemented.'); + }); + + it('should handle fail()', () => { + if (true) { + throw new Error('This should not have happened'); + } + }); + + it('should handle spyOnProperty', () => { + const obj = { get myProp() { return 'original'; } }; + vi.spyOn(obj, 'myProp', 'get').mockReturnValue('mocked'); + expect(obj.myProp).toBe('mocked'); + }); + + it('should handle spies throwing errors', () => { + const spy = vi.fn().mockImplementation(() => { throw new Error('Test Error') }); + expect(() => spy()).toThrowError('Test Error'); + }); + }); + `; + + await expectTransformation(jasmineCode, vitestCode); + }); + + it('should not transform toHaveClass in browser mode', async () => { + const jasmineCode = ` + describe('toHaveClass in browser mode', () => { + let el: HTMLElement; + + beforeEach(() => { + el = document.createElement('div'); + }); + + it('should handle DOM matchers like toHaveClass', () => { + el.classList.add('my-class'); + expect(el).withContext('element should have my-class').toHaveClass('my-class'); + el.classList.remove('my-class'); + expect(el).not.toHaveClass('my-class'); + }); + }); + `; + + const vitestCode = ` + describe('toHaveClass in browser mode', () => { + let el: HTMLElement; + + beforeEach(() => { + el = document.createElement('div'); + }); + + it('should handle DOM matchers like toHaveClass', () => { + el.classList.add('my-class'); + expect(el, 'element should have my-class').toHaveClass('my-class'); + el.classList.remove('my-class'); + expect(el).not.toHaveClass('my-class'); + }); + }); + `; + + await expectTransformation(jasmineCode, vitestCode, { addImports: false, browserMode: true }); + }); + + it('should add TODOs for unsupported Jasmine features', async () => { + const jasmineCode = ` + describe('Unsupported Features', () => { + beforeAll(() => { + jasmine.addMatchers({ + toBeAwesome: () => ({ + compare: (actual) => ({ pass: actual === 'awesome' }) + }) + }); + }); + + it('should use a custom matcher', () => { + // This will not be transformed, but a TODO should be present. + expect('awesome').toBeAwesome(); + }); + + it('should handle spyOnAllFunctions', () => { + const myObj = { func1: () => {}, func2: () => {} }; + jasmine.spyOnAllFunctions(myObj); + myObj.func1(); + expect(myObj.func1).toHaveBeenCalled(); + }); + + it('should handle unknown jasmine properties', () => { + const env = jasmine.getEnv(); + env.configure({ random: false }); + }); + }); + `; + + const vitestCode = ` + describe('Unsupported Features', () => { + beforeAll(() => { + // TODO: vitest-migration: jasmine.addMatchers is not supported. Please manually migrate to expect.extend(). See: https://vitest.dev/api/expect.html#expect-extend + jasmine.addMatchers({ + toBeAwesome: () => ({ + compare: (actual) => ({ pass: actual === 'awesome' }) + }) + }); + }); + + it('should use a custom matcher', () => { + // This will not be transformed, but a TODO should be present. + expect('awesome').toBeAwesome(); + }); + + it('should handle spyOnAllFunctions', () => { + const myObj = { func1: () => {}, func2: () => {} }; + // TODO: vitest-migration: Vitest does not have a direct equivalent for jasmine.spyOnAllFunctions(). Please spy on individual methods manually using vi.spyOn(). See: https://vitest.dev/api/vi.html#vi-spyon + jasmine.spyOnAllFunctions(myObj); + myObj.func1(); + expect(myObj.func1).toHaveBeenCalled(); + }); + + it('should handle unknown jasmine properties', () => { + // TODO: vitest-migration: Unsupported jasmine property "getEnv" found. Please migrate this manually. + const env = jasmine.getEnv(); + env.configure({ random: false }); + }); + }); + `; + + await expectTransformation(jasmineCode, vitestCode); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.ts b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.ts new file mode 100644 index 000000000000..db225a0a4473 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.ts @@ -0,0 +1,270 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This is the main entry point for the Jasmine to Vitest transformation. + * It orchestrates the application of various AST transformers to convert Jasmine test + * syntax and APIs to their Vitest equivalents. It also handles import management, + * blank line preservation, and reporting of transformation details. + */ + +import ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { + transformDoneCallback, + transformFocusedAndSkippedTests, + transformPending, +} from './transformers/jasmine-lifecycle'; +import { + transformArrayWithExactContents, + transformAsymmetricMatchers, + transformCalledOnceWith, + transformComplexMatchers, + transformExpectAsync, + transformExpectNothing, + transformSyntacticSugarMatchers, + transformToHaveClass, + transformWithContext, + transformtoHaveBeenCalledBefore, +} from './transformers/jasmine-matcher'; +import { + transformDefaultTimeoutInterval, + transformFail, + transformGlobalFunctions, + transformTimerMocks, + transformUnknownJasmineProperties, + transformUnsupportedJasmineCalls, +} from './transformers/jasmine-misc'; +import { + transformCreateSpyObj, + transformSpies, + transformSpyCallInspection, + transformSpyReset, +} from './transformers/jasmine-spy'; +import { transformJasmineTypes } from './transformers/jasmine-type'; +import { addVitestValueImport, getVitestAutoImports } from './utils/ast-helpers'; +import { RefactorContext } from './utils/refactor-context'; +import { RefactorReporter } from './utils/refactor-reporter'; + +/** + * A placeholder used to temporarily replace blank lines in the source code. + * This is necessary because TypeScript's printer removes blank lines by default. + */ +const BLANK_LINE_PLACEHOLDER = '// __PRESERVE_BLANK_LINE__'; + +/** + * Vitest function names that should be imported when using the --add-imports option. + */ +const VITEST_FUNCTION_NAMES = new Set([ + 'describe', + 'it', + 'expect', + 'beforeEach', + 'afterEach', + 'beforeAll', + 'afterAll', +]); + +/** + * Replaces blank lines in the content with a placeholder to prevent TypeScript's printer + * from removing them. This ensures that the original formatting of blank lines is preserved. + * @param content The source code content. + * @returns The content with blank lines replaced by placeholders. + */ +function preserveBlankLines(content: string): string { + return content + .split('\n') + .map((line) => (line.trim() === '' ? BLANK_LINE_PLACEHOLDER : line)) + .join('\n'); +} + +/** + * Restores blank lines in the content by replacing the placeholder with actual blank lines. + * This is called after TypeScript's printer has processed the file. + * @param content The content with blank line placeholders. + * @returns The content with blank lines restored. + */ +function restoreBlankLines(content: string): string { + const regex = /^\s*\/\/ __PRESERVE_BLANK_LINE__\s*$/gm; + + return content.replace(regex, ''); +} + +/** + * A collection of transformers that operate on `ts.CallExpression` nodes. + * These are applied in stages to ensure correct order of operations: + * 1. High-Level & Context-Sensitive: Transformations that fundamentally change the call. + * 2. Core Matcher & Spy: Bulk conversions for `expect(...)` and `spyOn(...)`. + * 3. Global Functions & Cleanup: Handles global Jasmine functions and unsupported APIs. + */ +const callExpressionTransformers = [ + // **Stage 1: High-Level & Context-Sensitive Transformations** + // These transformers often wrap or fundamentally change the nature of the call, + // so they need to run before more specific matchers. + transformWithContext, + transformExpectAsync, + transformFocusedAndSkippedTests, + transformPending, + transformDoneCallback, + + // **Stage 2: Core Matcher & Spy Transformations** + // This is the bulk of the `expect(...)` and `spyOn(...)` conversions. + transformSyntacticSugarMatchers, + transformComplexMatchers, + transformSpies, + transformCreateSpyObj, + transformSpyReset, + transformSpyCallInspection, + transformtoHaveBeenCalledBefore, + transformToHaveClass, + + // **Stage 3: Global Functions & Cleanup** + // These handle global Jasmine functions and catch-alls for unsupported APIs. + transformTimerMocks, + transformGlobalFunctions, + transformUnsupportedJasmineCalls, +]; + +/** + * A collection of transformers that operate on `ts.PropertyAccessExpression` nodes. + * These primarily handle `jasmine.any()` and other `jasmine.*` properties. + */ +const propertyAccessExpressionTransformers = [ + // These transformers handle `jasmine.any()` and other `jasmine.*` properties. + transformAsymmetricMatchers, + transformSpyCallInspection, + transformUnknownJasmineProperties, +]; + +/** + * A collection of transformers that operate on `ts.ExpressionStatement` nodes. + * These are mutually exclusive; the first one that matches will be applied. + */ +const expressionStatementTransformers = [ + transformCalledOnceWith, + transformArrayWithExactContents, + transformExpectNothing, + transformFail, + transformDefaultTimeoutInterval, +]; + +/** + * Transforms a string of Jasmine test code to Vitest test code. + * This is the main entry point for the transformation. + * @param filePath The path to the file being transformed. + * @param content The source code to transform. + * @param reporter The reporter to track TODOs. + * @param options Transformation options, including whether to add Vitest API imports. + * @returns The transformed code. + */ +export function transformJasmineToVitest( + filePath: string, + content: string, + reporter: RefactorReporter, + options: { addImports: boolean; browserMode: boolean }, +): string { + const contentWithPlaceholders = preserveBlankLines(content); + + const sourceFile = ts.createSourceFile( + filePath, + contentWithPlaceholders, + ts.ScriptTarget.Latest, + true, + ts.ScriptKind.TS, + ); + + const pendingVitestValueImports = new Set(); + const pendingVitestTypeImports = new Set(); + + const transformer: ts.TransformerFactory = (context) => { + const refactorCtx: RefactorContext = { + sourceFile, + reporter, + tsContext: context, + pendingVitestValueImports, + pendingVitestTypeImports, + }; + + const visitor: ts.Visitor = (node) => { + let transformedNode: ts.Node | readonly ts.Node[] = node; + + // Transform the node itself based on its type + if (ts.isCallExpression(transformedNode)) { + if (options.addImports && ts.isIdentifier(transformedNode.expression)) { + const name = transformedNode.expression.text; + if (VITEST_FUNCTION_NAMES.has(name)) { + addVitestValueImport(pendingVitestValueImports, name); + } + } + + for (const transformer of callExpressionTransformers) { + if (!(options.browserMode && transformer === transformToHaveClass)) { + transformedNode = transformer(transformedNode, refactorCtx); + } + } + } else if (ts.isPropertyAccessExpression(transformedNode)) { + for (const transformer of propertyAccessExpressionTransformers) { + transformedNode = transformer(transformedNode, refactorCtx); + } + } else if (ts.isExpressionStatement(transformedNode)) { + // Statement-level transformers are mutually exclusive. The first one that + // matches will be applied, and then the visitor will stop for this node. + for (const transformer of expressionStatementTransformers) { + const result = transformer(transformedNode, refactorCtx); + if (result !== transformedNode) { + transformedNode = result; + break; + } + } + } else if (ts.isQualifiedName(transformedNode) || ts.isTypeReferenceNode(transformedNode)) { + transformedNode = transformJasmineTypes(transformedNode, refactorCtx); + } + + // Visit the children of the node to ensure they are transformed + if (Array.isArray(transformedNode)) { + return transformedNode.map((node) => ts.visitEachChild(node, visitor, context)); + } else { + return ts.visitEachChild(transformedNode as ts.Node, visitor, context); + } + }; + + return (node) => ts.visitEachChild(node, visitor, context); + }; + + const result = ts.transform(sourceFile, [transformer]); + let transformedSourceFile = result.transformed[0]; + + const hasPendingValueImports = pendingVitestValueImports.size > 0; + const hasPendingTypeImports = pendingVitestTypeImports.size > 0; + + if ( + transformedSourceFile === sourceFile && + !reporter.hasTodos && + !hasPendingValueImports && + !hasPendingTypeImports + ) { + return content; + } + + if (hasPendingTypeImports || (options.addImports && hasPendingValueImports)) { + const vitestImport = getVitestAutoImports( + options.addImports ? pendingVitestValueImports : new Set(), + pendingVitestTypeImports, + ); + if (vitestImport) { + transformedSourceFile = ts.factory.updateSourceFile(transformedSourceFile, [ + vitestImport, + ...transformedSourceFile.statements, + ]); + } + } + + const printer = ts.createPrinter(); + const transformedContentWithPlaceholders = printer.printFile(transformedSourceFile); + + return restoreBlankLines(transformedContentWithPlaceholders); +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer_add-imports_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer_add-imports_spec.ts new file mode 100644 index 000000000000..1fd4beb6546e --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer_add-imports_spec.ts @@ -0,0 +1,121 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from './test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('addImports option', () => { + it('should add value imports when addImports is true', async () => { + const input = `spyOn(foo, 'bar');`; + const expected = ` + import { vi } from 'vitest'; + vi.spyOn(foo, 'bar'); + `; + await expectTransformation(input, expected, true); + }); + + it('should generate a single, combined import for value and type imports when addImports is true', async () => { + const input = ` + let mySpy: jasmine.Spy; + spyOn(foo, 'bar'); + `; + const expected = ` + import { type Mock, vi } from 'vitest'; + + let mySpy: Mock; + vi.spyOn(foo, 'bar'); + `; + await expectTransformation(input, expected, true); + }); + + it('should only add type imports when addImports is false', async () => { + const input = ` + let mySpy: jasmine.Spy; + spyOn(foo, 'bar'); + `; + const expected = ` + import type { Mock } from 'vitest'; + + let mySpy: Mock; + vi.spyOn(foo, 'bar'); + `; + await expectTransformation(input, expected, false); + }); + + it('should not add an import if no Vitest APIs are used, even when addImports is true', async () => { + const input = `const a = 1;`; + const expected = `const a = 1;`; + await expectTransformation(input, expected, true); + }); + + it('should add imports for top-level describe and it when addImports is true', async () => { + const input = ` + describe('My Suite', () => { + it('should do something', () => { + // test content + }); + }); + `; + const expected = ` + import { describe, it } from 'vitest'; + + describe('My Suite', () => { + it('should do something', () => { + // test content + }); + }); + `; + await expectTransformation(input, expected, true); + }); + + it('should add imports for top-level expect when addImports is true', async () => { + const input = `expect(true).toBe(true);`; + const expected = ` + import { expect } from 'vitest'; + expect(true).toBe(true); + `; + await expectTransformation(input, expected, true); + }); + + it('should add imports for beforeEach and afterEach when addImports is true', async () => { + const input = ` + describe('My Suite', () => { + beforeEach(() => {}); + afterEach(() => {}); + }); + `; + const expected = ` + import { afterEach, beforeEach, describe } from 'vitest'; + + describe('My Suite', () => { + beforeEach(() => {}); + afterEach(() => {}); + }); + `; + await expectTransformation(input, expected, true); + }); + + it('should add imports for beforeAll and afterAll when addImports is true', async () => { + const input = ` + describe('My Suite', () => { + beforeAll(() => {}); + afterAll(() => {}); + }); + `; + const expected = ` + import { afterAll, beforeAll, describe } from 'vitest'; + + describe('My Suite', () => { + beforeAll(() => {}); + afterAll(() => {}); + }); + `; + await expectTransformation(input, expected, true); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer_spec.ts new file mode 100644 index 000000000000..abe1f3655cdd --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer_spec.ts @@ -0,0 +1,208 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from './test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('Nested Transformations', () => { + const testCases = [ + { + description: 'should handle nested transforms like a spy returning an asymmetric matcher', + input: `spyOn(service, 'getValue').and.returnValue(jasmine.any(Number));`, + expected: `vi.spyOn(service, 'getValue').mockReturnValue(expect.any(Number));`, + }, + { + description: 'should handle expectAsync resolving to an asymmetric matcher', + input: `await expectAsync(myPromise).toBeResolvedTo(jasmine.any(Number));`, + expected: `await expect(myPromise).resolves.toEqual(expect.any(Number));`, + }, + { + description: + 'should handle spying on a property that returns a promise and using expectAsync', + input: ` + spyOnProperty(service, 'myProp', 'get').and.returnValue(Promise.resolve(42)); + await expectAsync(service.myProp).toBeResolvedTo(42); + `, + expected: ` + vi.spyOn(service, 'myProp', 'get').mockReturnValue(Promise.resolve(42)); + await expect(service.myProp).resolves.toEqual(42); + `, + }, + { + description: 'should handle a done callback that also uses timer mocks', + input: ` + it('should handle timers and async', (done) => { + jasmine.clock().install(); + setTimeout(() => { + expect(true).toBe(true); + jasmine.clock().uninstall(); + done(); + }, 100); + jasmine.clock().tick(100); + }); + `, + expected: ` + it('should handle timers and async', async () => { + vi.useFakeTimers(); + setTimeout(() => { + expect(true).toBe(true); + vi.useRealTimers(); + }, 100); + vi.advanceTimersByTime(100); + }); + `, + }, + { + description: 'should handle toHaveBeenCalledOnceWith using an asymmetric matcher', + input: `expect(mySpy).toHaveBeenCalledOnceWith(jasmine.objectContaining({ id: 1 }));`, + expected: ` + expect(mySpy).toHaveBeenCalledTimes(1); + expect(mySpy).toHaveBeenCalledWith(expect.objectContaining({ id: 1 })); + `, + }, + { + description: 'should handle withContext combined with a multi-statement matcher', + input: `expect(mySpy).withContext('custom message').toHaveBeenCalledOnceWith('foo');`, + expected: ` + expect(mySpy, 'custom message').toHaveBeenCalledTimes(1); + expect(mySpy, 'custom message').toHaveBeenCalledWith('foo'); + `, + }, + { + description: 'should handle createSpyObj with complex return values', + input: `const spy = jasmine.createSpyObj('MyService', { getPromise: Promise.resolve(jasmine.any(String)) });`, + expected: ` + const spy = { + getPromise: vi.fn().mockName("MyService.getPromise").mockReturnValue(Promise.resolve(expect.any(String))), + }; + `, + }, + { + description: 'should handle arrayWithExactContents containing nested asymmetric matchers', + input: `expect(myArray).toEqual(jasmine.arrayWithExactContents([jasmine.objectContaining({ id: 1 })]));`, + /* eslint-disable max-len */ + expected: ` + // TODO: vitest-migration: Verify this matches strict array content (multiset equality). Vitest's arrayContaining is a subset check. + expect(myArray).toHaveLength(1); + expect(myArray).toEqual(expect.arrayContaining([expect.objectContaining({ id: 1 })])); + `, + /* eslint-enable max-len */ + }, + { + description: 'should handle a spy rejecting with an asymmetric matcher', + input: `spyOn(service, 'myMethod').and.rejectWith(jasmine.objectContaining({ code: 'ERROR' }));`, + expected: `vi.spyOn(service, 'myMethod').mockRejectedValue(expect.objectContaining({ code: 'ERROR' }));`, + }, + { + description: 'should handle a complex spy object with a property map and subsequent spyOn', + input: ` + const myService = jasmine.createSpyObj('MyService', ['methodA'], { propA: 'valueA' }); + spyOn(myService, 'methodA').and.returnValue('mocked value'); + myService.methodA('test'); + expect(myService.methodA).toHaveBeenCalledWith('test'); + `, + expected: ` + const myService = { + methodA: vi.fn().mockName("MyService.methodA"), + propA: 'valueA', + }; + vi.spyOn(myService, 'methodA').mockReturnValue('mocked value'); + myService.methodA('test'); + expect(myService.methodA).toHaveBeenCalledWith('test'); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('Comment Preservation', () => { + const testCases = [ + { + description: 'should preserve a comment before a spy', + input: ` + // This is an important spy + spyOn(service, 'myMethod').and.returnValue(true); + `, + expected: ` + // This is an important spy + vi.spyOn(service, 'myMethod').mockReturnValue(true); + `, + }, + { + description: 'should preserve a multi-line comment between chained calls', + input: ` + spyOn(service, 'myMethod') + /* + * This spy needs to return a specific value. + */ + .and.returnValue(true); + `, + expected: ` + vi.spyOn(service, 'myMethod') + /* + * This spy needs to return a specific value. + */ + .mockReturnValue(true); + `, + }, + { + description: 'should preserve a trailing comment on a matcher line', + input: ` + expect(mySpy).toHaveBeenCalledWith('foo'); // Trailing comment + `, + expected: ` + expect(mySpy).toHaveBeenCalledWith('foo'); // Trailing comment + `, + }, + { + description: 'should preserve comments inside a done callback function', + input: ` + it('should do something async', (done) => { + // Start the async operation + setTimeout(() => { + // It's done now + done(); + }, 100); + }); + `, + expected: ` + it('should do something async', async () => { + // Start the async operation + setTimeout(() => { + // It's done now + }, 100); + }); + `, + }, + { + description: 'should preserve comments around a multi-statement transformation', + input: ` + // Check if the spy was called correctly + expect(mySpy).toHaveBeenCalledOnceWith('foo'); + `, + expected: ` + // Check if the spy was called correctly + expect(mySpy).toHaveBeenCalledTimes(1); + expect(mySpy).toHaveBeenCalledWith('foo'); + `, + skipped: true, + }, + ]; + + testCases.forEach(({ description, input, expected, skipped }) => { + (skipped ? xit : it)(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/test-helpers.ts b/packages/schematics/angular/refactor/jasmine-vitest/test-helpers.ts new file mode 100644 index 000000000000..9aa6532206da --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/test-helpers.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { logging } from '@angular-devkit/core'; +import { format } from 'prettier'; +import { transformJasmineToVitest } from './test-file-transformer'; +import { RefactorReporter } from './utils/refactor-reporter'; + +/** + * A test helper to run the Jasmine to Vitest transformer on a given code + * snippet and compare it to an expected output. + * + * This function automatically handles the setup of a `RefactorReporter` and + * formats both the transformed and expected code using Prettier. This ensures + * that test comparisons are consistent and not affected by minor formatting + * differences. + * + * @param input The Jasmine code snippet to be transformed. + * @param expected The expected Vitest code snippet after transformation. + */ +export async function expectTransformation( + input: string, + expected: string, + addImports = false, +): Promise { + const logger = new logging.NullLogger(); + const reporter = new RefactorReporter(logger); + const transformed = transformJasmineToVitest('spec.ts', input, reporter, { + addImports, + browserMode: false, + }); + const formattedTransformed = await format(transformed, { parser: 'typescript' }); + const formattedExpected = await format(expected, { parser: 'typescript' }); + + expect(formattedTransformed).toBe(formattedExpected); +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle.ts new file mode 100644 index 000000000000..9b0c61b6dca9 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle.ts @@ -0,0 +1,466 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file contains transformers that convert Jasmine lifecycle functions + * and test setup/teardown patterns to their Vitest equivalents. This includes handling + * focused/skipped tests (fdescribe, fit, xdescribe, xit), pending tests, and asynchronous + * operations that use the `done` callback. + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { createPropertyAccess } from '../utils/ast-helpers'; +import { addTodoComment } from '../utils/comment-helpers'; +import { RefactorContext } from '../utils/refactor-context'; + +const FOCUSED_SKIPPED_RENAMES = new Map([ + ['fdescribe', { newBase: 'describe', newName: 'only' }], + ['fit', { newBase: 'it', newName: 'only' }], + ['xdescribe', { newBase: 'describe', newName: 'skip' }], + ['xit', { newBase: 'it', newName: 'skip' }], +]); + +export function transformFocusedAndSkippedTests( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) { + return node; + } + + const oldName = node.expression.text; + const rename = FOCUSED_SKIPPED_RENAMES.get(oldName); + if (rename) { + reporter.reportTransformation( + sourceFile, + node, + `Transformed \`${oldName}\` to \`${rename.newBase}.${rename.newName}\`.`, + ); + + const newPropAccess = createPropertyAccess(rename.newBase, rename.newName); + + return ts.factory.updateCallExpression(node, newPropAccess, node.typeArguments, node.arguments); + } + + return node; +} + +export function transformPending( + node: ts.Node, + { sourceFile, reporter, tsContext }: RefactorContext, +): ts.Node { + if ( + !ts.isCallExpression(node) || + !ts.isIdentifier(node.expression) || + node.expression.text !== 'it' + ) { + return node; + } + + const testFn = node.arguments[1]; + if (!testFn || (!ts.isArrowFunction(testFn) && !ts.isFunctionExpression(testFn))) { + return node; + } + + let hasPending = false; + const bodyTransformVisitor = (bodyNode: ts.Node): ts.Node | undefined => { + if ( + ts.isExpressionStatement(bodyNode) && + ts.isCallExpression(bodyNode.expression) && + ts.isIdentifier(bodyNode.expression.expression) && + bodyNode.expression.expression.text === 'pending' + ) { + hasPending = true; + const replacement = ts.factory.createEmptyStatement(); + const originalText = bodyNode.getFullText().trim(); + + reporter.reportTransformation( + sourceFile, + bodyNode, + 'Converted `pending()` to a skipped test (`it.skip`).', + ); + const category = 'pending'; + reporter.recordTodo(category, sourceFile, bodyNode); + addTodoComment(replacement, category); + ts.addSyntheticLeadingComment( + replacement, + ts.SyntaxKind.SingleLineCommentTrivia, + ` ${originalText}`, + true, + ); + + return replacement; + } + + return ts.visitEachChild(bodyNode, bodyTransformVisitor, tsContext); + }; + + const newBody = ts.visitNode(testFn.body, bodyTransformVisitor) as ts.ConciseBody | undefined; + + if (!hasPending) { + return node; + } + + const newExpression = createPropertyAccess(node.expression, 'skip'); + const newTestFn = ts.isArrowFunction(testFn) + ? ts.factory.updateArrowFunction( + testFn, + testFn.modifiers, + testFn.typeParameters, + testFn.parameters, + testFn.type, + testFn.equalsGreaterThanToken, + newBody ?? ts.factory.createBlock([]), + ) + : ts.factory.updateFunctionExpression( + testFn, + testFn.modifiers, + testFn.asteriskToken, + testFn.name, + testFn.typeParameters, + testFn.parameters, + testFn.type, + (newBody as ts.Block) ?? ts.factory.createBlock([]), + ); + + const newArgs = [node.arguments[0], newTestFn, ...node.arguments.slice(2)]; + + return ts.factory.updateCallExpression(node, newExpression, node.typeArguments, newArgs); +} + +function transformComplexDoneCallback( + node: ts.Node, + doneIdentifier: ts.Identifier, + refactorCtx: RefactorContext, +): ts.Node | ts.Node[] | undefined { + const { sourceFile, reporter } = refactorCtx; + if ( + !ts.isExpressionStatement(node) || + !ts.isCallExpression(node.expression) || + !ts.isPropertyAccessExpression(node.expression.expression) + ) { + return node; + } + + const call = node.expression; + const pae = call.expression; + + if (!ts.isPropertyAccessExpression(pae)) { + return node; + } + + if (pae.name.text !== 'then' || call.arguments.length !== 1) { + return node; + } + + const thenCallback = call.arguments[0]; + if (!ts.isArrowFunction(thenCallback) && !ts.isFunctionExpression(thenCallback)) { + return node; + } + + // Re-create the .then() call but with a modified callback that has `done()` removed. + const thenCallbackBody = ts.isBlock(thenCallback.body) + ? thenCallback.body + : ts.factory.createBlock([ts.factory.createExpressionStatement(thenCallback.body)]); + + const newStatements = thenCallbackBody.statements.filter((stmt) => { + return ( + !ts.isExpressionStatement(stmt) || + !ts.isCallExpression(stmt.expression) || + !ts.isIdentifier(stmt.expression.expression) || + stmt.expression.expression.text !== doneIdentifier.text + ); + }); + + if (newStatements.length === thenCallbackBody.statements.length) { + // No "done()" call was removed, so don't transform. + return node; + } + + reporter.reportTransformation( + sourceFile, + node, + 'Transformed promise `.then()` with `done()` to `await`.', + ); + + const newThenCallback = ts.isArrowFunction(thenCallback) + ? ts.factory.updateArrowFunction( + thenCallback, + thenCallback.modifiers, + thenCallback.typeParameters, + thenCallback.parameters, + thenCallback.type, + thenCallback.equalsGreaterThanToken, + ts.factory.updateBlock(thenCallbackBody, newStatements), + ) + : ts.factory.updateFunctionExpression( + thenCallback, + thenCallback.modifiers, + thenCallback.asteriskToken, + thenCallback.name, + thenCallback.typeParameters, + thenCallback.parameters, + thenCallback.type, + ts.factory.updateBlock(thenCallbackBody, newStatements), + ); + + const newCall = ts.factory.updateCallExpression(call, call.expression, call.typeArguments, [ + newThenCallback, + ]); + + return ts.factory.createExpressionStatement(ts.factory.createAwaitExpression(newCall)); +} + +function transformPromiseBasedDone( + callExpr: ts.CallExpression, + doneIdentifier: ts.Identifier, + refactorCtx: RefactorContext, +): ts.Node | undefined { + const { sourceFile, reporter } = refactorCtx; + if ( + ts.isPropertyAccessExpression(callExpr.expression) && + (callExpr.expression.name.text === 'then' || callExpr.expression.name.text === 'catch') + ) { + const promiseHandler = callExpr.arguments[0]; + if (promiseHandler) { + let isDoneHandler = false; + // promise.then(done) + if (ts.isIdentifier(promiseHandler) && promiseHandler.text === doneIdentifier.text) { + isDoneHandler = true; + } + // promise.catch(done.fail) + if ( + ts.isPropertyAccessExpression(promiseHandler) && + ts.isIdentifier(promiseHandler.expression) && + promiseHandler.expression.text === doneIdentifier.text && + promiseHandler.name.text === 'fail' + ) { + isDoneHandler = true; + } + // promise.then(() => done()) + if (ts.isArrowFunction(promiseHandler) && !promiseHandler.parameters.length) { + const body = promiseHandler.body; + if ( + ts.isCallExpression(body) && + ts.isIdentifier(body.expression) && + body.expression.text === doneIdentifier.text + ) { + isDoneHandler = true; + } + if (ts.isBlock(body) && body.statements.length === 1) { + const stmt = body.statements[0]; + if ( + ts.isExpressionStatement(stmt) && + ts.isCallExpression(stmt.expression) && + ts.isIdentifier(stmt.expression.expression) && + stmt.expression.expression.text === doneIdentifier.text + ) { + isDoneHandler = true; + } + } + } + + if (isDoneHandler) { + reporter.reportTransformation( + sourceFile, + callExpr, + 'Transformed promise `.then(done)` to `await`.', + ); + + return ts.factory.createExpressionStatement( + ts.factory.createAwaitExpression(callExpr.expression.expression), + ); + } + } + } + + return undefined; +} + +function countDoneUsages(node: ts.Node, doneIdentifier: ts.Identifier): number { + let count = 0; + const visitor = (n: ts.Node) => { + if (ts.isIdentifier(n) && n.text === doneIdentifier.text) { + count++; + } + ts.forEachChild(n, visitor); + }; + ts.forEachChild(node, visitor); + + return count; +} + +export function transformDoneCallback(node: ts.Node, refactorCtx: RefactorContext): ts.Node { + const { sourceFile, reporter, tsContext } = refactorCtx; + if ( + !ts.isCallExpression(node) || + !ts.isIdentifier(node.expression) || + !['it', 'beforeEach', 'afterEach', 'beforeAll', 'afterAll'].includes(node.expression.text) + ) { + return node; + } + + const functionArg = node.arguments.find( + (arg) => ts.isArrowFunction(arg) || ts.isFunctionExpression(arg), + ); + + if (!functionArg || (!ts.isArrowFunction(functionArg) && !ts.isFunctionExpression(functionArg))) { + return node; + } + + if (functionArg.parameters.length !== 1) { + return node; + } + + const doneParam = functionArg.parameters[0]; + if (!ts.isIdentifier(doneParam.name)) { + return node; + } + const doneIdentifier = doneParam.name; + + // Count total usages of 'done' in the body + const totalUsages = countDoneUsages(functionArg.body, doneIdentifier); + let handledUsages = 0; + let doneWasUsed = false; + + const bodyVisitor = (bodyNode: ts.Node): ts.Node | ts.Node[] | undefined => { + const complexTransformed = transformComplexDoneCallback(bodyNode, doneIdentifier, refactorCtx); + if (complexTransformed !== bodyNode) { + doneWasUsed = true; + handledUsages++; // complex transform handles one usage + + return complexTransformed; + } + + if (ts.isExpressionStatement(bodyNode) && ts.isCallExpression(bodyNode.expression)) { + const callExpr = bodyNode.expression; + + // Transform `done.fail('message')` to `throw new Error('message')` + if ( + ts.isPropertyAccessExpression(callExpr.expression) && + ts.isIdentifier(callExpr.expression.expression) && + callExpr.expression.expression.text === doneIdentifier.text && + callExpr.expression.name.text === 'fail' + ) { + doneWasUsed = true; + handledUsages++; + reporter.reportTransformation( + sourceFile, + bodyNode, + 'Transformed `done.fail()` to `throw new Error()`.', + ); + const errorArgs = callExpr.arguments.length > 0 ? [callExpr.arguments[0]] : []; + + return ts.factory.createThrowStatement( + ts.factory.createNewExpression( + ts.factory.createIdentifier('Error'), + undefined, + errorArgs, + ), + ); + } + + // Transform `promise.then(done)` or `promise.catch(done.fail)` to `await promise` + const promiseTransformed = transformPromiseBasedDone(callExpr, doneIdentifier, refactorCtx); + if (promiseTransformed) { + doneWasUsed = true; + handledUsages++; + + return promiseTransformed; + } + + // Remove `done()` + if ( + ts.isIdentifier(callExpr.expression) && + callExpr.expression.text === doneIdentifier.text + ) { + doneWasUsed = true; + handledUsages++; + + return ts.setTextRange(ts.factory.createEmptyStatement(), callExpr.expression); + } + } + + return ts.visitEachChild(bodyNode, bodyVisitor, tsContext); + }; + + const newBody = ts.visitNode(functionArg.body, (node: ts.Node) => { + if (ts.isBlock(node)) { + const newStatements = node.statements.flatMap( + (stmt) => bodyVisitor(stmt) as ts.Statement | ts.Statement[] | undefined, + ); + + return ts.factory.updateBlock( + node, + newStatements.filter((s) => !!s), + ); + } + + return bodyVisitor(node); + }); + + // Safety check: if we found usages but didn't handle all of them, abort. + if (handledUsages < totalUsages) { + reporter.reportTransformation( + sourceFile, + node, + `Found unhandled usage of \`${doneIdentifier.text}\` callback. Skipping transformation.`, + ); + const category = 'unhandled-done-usage'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + + return node; + } + + if (!doneWasUsed) { + return node; + } + + reporter.reportTransformation( + sourceFile, + node, + `Converted test with \`done\` callback to an \`async\` test.`, + ); + + const newModifiers = [ + ts.factory.createModifier(ts.SyntaxKind.AsyncKeyword), + ...(ts.getModifiers(functionArg) ?? []).filter( + (mod) => mod.kind !== ts.SyntaxKind.AsyncKeyword, + ), + ]; + + let newFunction: ts.ArrowFunction | ts.FunctionExpression; + if (ts.isArrowFunction(functionArg)) { + newFunction = ts.factory.updateArrowFunction( + functionArg, + newModifiers, + functionArg.typeParameters, + [], // remove parameters + functionArg.type, + functionArg.equalsGreaterThanToken, + (newBody as ts.ConciseBody) ?? ts.factory.createBlock([]), + ); + } else { + // isFunctionExpression + newFunction = ts.factory.updateFunctionExpression( + functionArg, + newModifiers, + functionArg.asteriskToken, + functionArg.name, + functionArg.typeParameters, + [], // remove parameters + functionArg.type, + (newBody as ts.Block) ?? ts.factory.createBlock([]), + ); + } + + const newArgs = node.arguments.map((arg) => (arg === functionArg ? newFunction : arg)); + + return ts.factory.updateCallExpression(node, node.expression, node.typeArguments, newArgs); +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle_spec.ts new file mode 100644 index 000000000000..f41f5fa7ae32 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle_spec.ts @@ -0,0 +1,253 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from '../test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('transformDoneCallback', () => { + const testCases = [ + { + description: 'should transform an `it` block with a done callback to an async function', + input: ` + it('should do something async', (done) => { + setTimeout(() => { + expect(true).toBe(true); + done(); + }, 100); + }); + `, + expected: ` + it('should do something async', async () => { + setTimeout(() => { + expect(true).toBe(true); + }, 100); + }); + `, + }, + { + description: 'should transform a promise chain with a done callback to await', + input: ` + beforeEach((done) => { + service.init().then(() => done()); + }); + `, + expected: ` + beforeEach(async () => { + await service.init().then(() => {}); + }); + `, + }, + { + description: 'should transform done.fail() to throw new Error()', + input: ` + it('should fail', (done) => { + done.fail('it failed'); + }); + `, + expected: ` + it('should fail', async () => { + throw new Error('it failed'); + }); + `, + }, + { + description: 'should transform an `afterEach` block with a done callback', + input: 'afterEach((done) => { promise.then(done); });', + expected: 'afterEach(async () => { await promise; });', + }, + { + description: 'should transform a test with a function(done) signature', + input: ` + it('should work with a function expression', function(done) { + done(); + }); + `, + expected: ` + it('should work with a function expression', async function() {}); + `, + }, + { + description: 'should transform done.fail() without a message', + input: `it('fails', (done) => { done.fail(); });`, + expected: `it('fails', async () => { throw new Error(); });`, + }, + { + description: 'should handle promise rejections via catch', + input: ` + it('should handle promise rejections via catch', (done) => { + myPromise.catch(done.fail); + }); + `, + expected: ` + it('should handle promise rejections via catch', async () => { + await myPromise; + }); + `, + }, + { + description: 'should work with a custom done name', + input: ` + it('should work with a custom done name', (finish) => { + setTimeout(() => { + finish(); + }, 100); + }); + `, + expected: ` + it('should work with a custom done name', async () => { + setTimeout(() => { + }, 100); + }); + `, + }, + { + description: 'should handle done in a finally block', + input: ` + it('should handle done in a finally block', (done) => { + try { + // some logic + } finally { + done(); + } + }); + `, + expected: ` + it('should handle done in a finally block', async () => { + try { + // some logic + } finally {} + }); + `, + }, + { + description: 'should not transform a function with a parameter that is not a done callback', + input: ` + it('should not transform a function with a parameter that is not a done callback', (value) => { + expect(value).toBe(true); + }); + `, + expected: ` + // TODO: vitest-migration: The 'done' callback was used in an unhandled way. Please migrate manually. + it('should not transform a function with a parameter that is not a done callback', (value) => { + expect(value).toBe(true); + }); + `, + }, + { + description: 'should handle a .then() call with a multi-statement body', + input: ` + it('should handle a complex then', (done) => { + let myValue = false; + myPromise.then(() => { + myValue = true; + done(); + }); + }); + `, + expected: ` + it('should handle a complex then', async () => { + let myValue = false; + await myPromise.then(() => { + myValue = true; + }); + }); + `, + }, + { + description: 'should add a TODO for unhandled done usage', + input: ` + it('should do something with helper', (done) => { + someHelper(done); + }); + `, + expected: ` + // TODO: vitest-migration: The 'done' callback was used in an unhandled way. Please migrate manually. + it('should do something with helper', (done) => { + someHelper(done); + }); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformPending', () => { + const testCases = [ + { + description: 'should transform a test with pending() to it.skip()', + input: ` + it('is a work in progress', () => { + pending('Not yet implemented'); + }); + `, + expected: ` + it.skip('is a work in progress', () => { + // TODO: vitest-migration: The pending() function was converted to a skipped test (\`it.skip\`). See: https://vitest.dev/api/vi.html#it-skip + // pending('Not yet implemented'); + }); + `, + }, + { + description: 'should transform a test with pending() using function keyword', + input: ` + it('is a work in progress', function() { + pending('Not yet implemented'); + }); + `, + expected: ` + it.skip('is a work in progress', function() { + // TODO: vitest-migration: The pending() function was converted to a skipped test (\`it.skip\`). See: https://vitest.dev/api/vi.html#it-skip + // pending('Not yet implemented'); + }); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformFocusedAndSkippedTests', () => { + const testCases = [ + { + description: 'should transform fdescribe to describe.only', + input: `fdescribe('My Suite', () => {});`, + expected: `describe.only('My Suite', () => {});`, + }, + { + description: 'should transform fit to it.only', + input: `fit('My Test', () => {});`, + expected: `it.only('My Test', () => {});`, + }, + { + description: 'should transform xdescribe to describe.skip', + input: `xdescribe('My Suite', () => {});`, + expected: `describe.skip('My Suite', () => {});`, + }, + { + description: 'should transform xit to it.skip', + input: `xit('My Test', () => {});`, + expected: `it.skip('My Test', () => {});`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher.ts new file mode 100644 index 000000000000..05c137100271 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher.ts @@ -0,0 +1,628 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file contains transformers that migrate Jasmine matchers to their + * Vitest counterparts. It handles a wide range of matchers, including syntactic sugar + * (e.g., `toBeTrue`), asymmetric matchers (e.g., `jasmine.any`), async promise matchers + * (`expectAsync`), and complex matchers that require restructuring, such as + * `toHaveBeenCalledOnceWith` and `arrayWithExactContents`. + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { + addVitestValueImport, + createExpectCallExpression, + createPropertyAccess, +} from '../utils/ast-helpers'; +import { getJasmineMethodName, isJasmineCallExpression } from '../utils/ast-validation'; +import { addTodoComment } from '../utils/comment-helpers'; +import { RefactorContext } from '../utils/refactor-context'; + +const SUGAR_MATCHER_CHANGES = new Map([ + ['toBeTrue', { newName: 'toBe', newArgs: [ts.factory.createTrue()] }], + ['toBeFalse', { newName: 'toBe', newArgs: [ts.factory.createFalse()] }], + ['toBePositiveInfinity', { newName: 'toBe', newArgs: [ts.factory.createIdentifier('Infinity')] }], + [ + 'toBeNegativeInfinity', + { + newName: 'toBe', + newArgs: [ + ts.factory.createPrefixUnaryExpression( + ts.SyntaxKind.MinusToken, + ts.factory.createIdentifier('Infinity'), + ), + ], + }, + ], + ['toHaveSize', { newName: 'toHaveLength' }], +]); + +export function transformSyntacticSugarMatchers( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) { + return node; + } + + const pae = node.expression; + const matcherName = pae.name.text; + + if (matcherName === 'toHaveSpyInteractions') { + const category = 'toHaveSpyInteractions'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + + return node; + } + + if (matcherName === 'toThrowMatching') { + const category = 'toThrowMatching'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category, { name: matcherName }); + + return node; + } + + const mapping = SUGAR_MATCHER_CHANGES.get(matcherName); + + if (mapping) { + reporter.reportTransformation( + sourceFile, + node, + `Transformed matcher ".${matcherName}()" to ".${mapping.newName}()".`, + ); + const newExpression = createPropertyAccess(pae.expression, mapping.newName); + const newArgs = mapping.newArgs ?? [...node.arguments]; + + return ts.factory.updateCallExpression(node, newExpression, node.typeArguments, newArgs); + } + + return node; +} + +const ASYMMETRIC_MATCHER_NAMES: ReadonlyArray = [ + 'anything', + 'any', + 'stringMatching', + 'objectContaining', + 'arrayContaining', + 'stringContaining', +]; + +export function transformAsymmetricMatchers( + node: ts.Node, + { sourceFile, reporter, pendingVitestValueImports }: RefactorContext, +): ts.Node { + if ( + ts.isPropertyAccessExpression(node) && + ts.isIdentifier(node.expression) && + node.expression.text === 'jasmine' + ) { + const matcherName = node.name.text; + if (ASYMMETRIC_MATCHER_NAMES.includes(matcherName)) { + addVitestValueImport(pendingVitestValueImports, 'expect'); + reporter.reportTransformation( + sourceFile, + node, + `Transformed asymmetric matcher \`jasmine.${matcherName}\` to \`expect.${matcherName}\`.`, + ); + + return createPropertyAccess('expect', node.name); + } + } + + return node; +} + +export function transformtoHaveBeenCalledBefore( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + !ts.isCallExpression(node) || + !ts.isPropertyAccessExpression(node.expression) || + node.arguments.length !== 1 + ) { + return node; + } + + const pae = node.expression; + const matcherName = pae.name.text; + let isNegated = false; + + let expectExpression = pae.expression; + if (ts.isPropertyAccessExpression(expectExpression) && expectExpression.name.text === 'not') { + isNegated = true; + expectExpression = expectExpression.expression; + } + + if (!ts.isCallExpression(expectExpression) || matcherName !== 'toHaveBeenCalledBefore') { + return node; + } + + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `toHaveBeenCalledBefore` to a Vitest-compatible spy invocation order comparison.', + ); + + const [spyB] = node.arguments; + const [spyA] = expectExpression.arguments; + + const createInvocationOrderAccess = (spyIdentifier: ts.Expression) => { + const mockedSpy = ts.factory.createCallExpression( + createPropertyAccess('vi', 'mocked'), + undefined, + [spyIdentifier], + ); + const mockProperty = createPropertyAccess(mockedSpy, 'mock'); + + return createPropertyAccess(mockProperty, 'invocationCallOrder'); + }; + + const createMinCall = (spyIdentifier: ts.Expression) => { + return ts.factory.createCallExpression(createPropertyAccess('Math', 'min'), undefined, [ + ts.factory.createSpreadElement(createInvocationOrderAccess(spyIdentifier)), + ]); + }; + + const newExpect = createExpectCallExpression([createMinCall(spyA)]); + const newMatcherName = isNegated ? 'toBeGreaterThanOrEqual' : 'toBeLessThan'; + + return ts.factory.createCallExpression( + createPropertyAccess(newExpect, newMatcherName), + undefined, + [createMinCall(spyB)], + ); +} + +export function transformToHaveClass( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + !ts.isCallExpression(node) || + !ts.isPropertyAccessExpression(node.expression) || + node.arguments.length !== 1 + ) { + return node; + } + + const pae = node.expression; + const matcherName = pae.name.text; + let isNegated = false; + + let expectExpression = pae.expression; + if (ts.isPropertyAccessExpression(expectExpression) && expectExpression.name.text === 'not') { + isNegated = true; + expectExpression = expectExpression.expression; + } + + if (matcherName !== 'toHaveClass') { + return node; + } + + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `.toHaveClass()` to a `classList.contains()` check.', + ); + + const [className] = node.arguments; + const newExpectArgs: ts.Expression[] = []; + + if (ts.isCallExpression(expectExpression)) { + const [element] = expectExpression.arguments; + const classListContains = ts.factory.createCallExpression( + createPropertyAccess(createPropertyAccess(element, 'classList'), 'contains'), + undefined, + [className], + ); + newExpectArgs.push(classListContains); + + // Pass the context message from withContext to the new expect call + if (expectExpression.arguments.length > 1) { + newExpectArgs.push(expectExpression.arguments[1]); + } + } else { + return node; + } + + const newExpect = createExpectCallExpression(newExpectArgs); + const newMatcher = isNegated ? ts.factory.createFalse() : ts.factory.createTrue(); + + return ts.factory.createCallExpression(createPropertyAccess(newExpect, 'toBe'), undefined, [ + newMatcher, + ]); +} + +const ASYNC_MATCHER_CHANGES = new Map< + string, + { + base: 'resolves' | 'rejects'; + matcher: string; + not?: boolean; + keepArgs?: boolean; + } +>([ + ['toBeResolved', { base: 'resolves', matcher: 'toThrow', not: true, keepArgs: false }], + ['toBeResolvedTo', { base: 'resolves', matcher: 'toEqual', keepArgs: true }], + ['toBeRejected', { base: 'rejects', matcher: 'toThrow', keepArgs: false }], + ['toBeRejectedWith', { base: 'rejects', matcher: 'toEqual', keepArgs: true }], + ['toBeRejectedWithError', { base: 'rejects', matcher: 'toThrowError', keepArgs: true }], +]); + +export function transformExpectAsync( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + !ts.isCallExpression(node) || + !ts.isPropertyAccessExpression(node.expression) || + !ts.isCallExpression(node.expression.expression) + ) { + return node; + } + + const matcherCall = node; + const matcherPae = node.expression; + const expectCall = node.expression.expression; + + if (!ts.isIdentifier(expectCall.expression) || expectCall.expression.text !== 'expectAsync') { + return node; + } + + const matcherName = ts.isIdentifier(matcherPae.name) ? matcherPae.name.text : undefined; + const mapping = matcherName ? ASYNC_MATCHER_CHANGES.get(matcherName) : undefined; + + if (mapping) { + reporter.reportTransformation( + sourceFile, + node, + `Transformed \`expectAsync(...).${matcherName}\` to \`expect(...).${mapping.base}.${mapping.matcher}\`.`, + ); + const newExpectCall = createExpectCallExpression([expectCall.arguments[0]]); + let newMatcherChain: ts.Expression = createPropertyAccess(newExpectCall, mapping.base); + + if (mapping.not) { + newMatcherChain = createPropertyAccess(newMatcherChain, 'not'); + } + newMatcherChain = createPropertyAccess(newMatcherChain, mapping.matcher); + + const newMatcherArgs = mapping.keepArgs ? [...matcherCall.arguments] : []; + + return ts.factory.createCallExpression(newMatcherChain, undefined, newMatcherArgs); + } + + if (matcherName) { + if (matcherName === 'toBePending') { + const category = 'toBePending'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + } else { + const category = 'unsupported-expect-async-matcher'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category, { name: matcherName }); + } + } + + return node; +} + +export function transformComplexMatchers( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + !ts.isCallExpression(node) || + !ts.isPropertyAccessExpression(node.expression) || + node.expression.name.text !== 'toEqual' || + node.arguments.length !== 1 + ) { + return node; + } + + const argument = node.arguments[0]; + const jasmineMatcherName = getJasmineMethodName(argument); + + if (!jasmineMatcherName) { + return node; + } + + const expectCall = node.expression.expression; + + let newMatcherName: string | undefined; + let newArgs: ts.Expression[] | undefined; + let negate = false; + + switch (jasmineMatcherName) { + case 'truthy': + newMatcherName = 'toBeTruthy'; + break; + case 'falsy': + newMatcherName = 'toBeFalsy'; + break; + case 'empty': + newMatcherName = 'toHaveLength'; + newArgs = [ts.factory.createNumericLiteral(0)]; + break; + case 'notEmpty': + newMatcherName = 'toHaveLength'; + newArgs = [ts.factory.createNumericLiteral(0)]; + negate = true; + break; + case 'is': + newMatcherName = 'toBe'; + if (ts.isCallExpression(argument)) { + newArgs = [...argument.arguments]; + } + break; + } + + if (newMatcherName) { + reporter.reportTransformation( + sourceFile, + node, + `Transformed \`.toEqual(jasmine.${jasmineMatcherName}())\` to \`.${newMatcherName}()\`.`, + ); + let expectExpression = expectCall; + + // Handle cases like `expect(...).not.toEqual(jasmine.notEmpty())` + if (ts.isPropertyAccessExpression(expectCall) && expectCall.name.text === 'not') { + // The original expression was negated, so flip the negate flag + negate = !negate; + // Use the expression before the `.not` + expectExpression = expectCall.expression; + } + + if (negate) { + expectExpression = createPropertyAccess(expectExpression, 'not'); + } + + const newExpression = createPropertyAccess(expectExpression, newMatcherName); + + return ts.factory.createCallExpression(newExpression, undefined, newArgs ?? []); + } + + return node; +} + +export function transformArrayWithExactContents( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node | readonly ts.Node[] { + if ( + !ts.isExpressionStatement(node) || + !ts.isCallExpression(node.expression) || + !ts.isPropertyAccessExpression(node.expression.expression) || + node.expression.expression.name.text !== 'toEqual' || + node.expression.arguments.length !== 1 + ) { + return node; + } + + const argument = node.expression.arguments[0]; + if ( + !isJasmineCallExpression(argument, 'arrayWithExactContents') || + argument.arguments.length !== 1 + ) { + return node; + } + + if (!ts.isArrayLiteralExpression(argument.arguments[0])) { + const category = 'arrayWithExactContents-dynamic-variable'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + + return node; + } + + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `jasmine.arrayWithExactContents()` to `.toHaveLength()` and `.toEqual(expect.arrayContaining())`.', + ); + + const expectCall = node.expression.expression.expression; + const arrayLiteral = argument.arguments[0]; + + const lengthCall = ts.factory.createCallExpression( + createPropertyAccess(expectCall, 'toHaveLength'), + undefined, + [ts.factory.createNumericLiteral(arrayLiteral.elements.length)], + ); + + const containingCall = ts.factory.createCallExpression( + createPropertyAccess(expectCall, 'toEqual'), + undefined, + [ + ts.factory.createCallExpression( + createPropertyAccess('expect', 'arrayContaining'), + undefined, + [arrayLiteral], + ), + ], + ); + + const lengthStmt = ts.factory.createExpressionStatement(lengthCall); + const containingStmt = ts.factory.createExpressionStatement(containingCall); + + const category = 'arrayWithExactContents-check'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(lengthStmt, category); + + return [lengthStmt, containingStmt]; +} + +export function transformCalledOnceWith( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node | readonly ts.Node[] { + if (!ts.isExpressionStatement(node)) { + return node; + } + + const call = node.expression; + if ( + !ts.isCallExpression(call) || + !ts.isPropertyAccessExpression(call.expression) || + call.expression.name.text !== 'toHaveBeenCalledOnceWith' + ) { + return node; + } + + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `.toHaveBeenCalledOnceWith()` to `.toHaveBeenCalledTimes(1)` and `.toHaveBeenCalledWith()`.', + ); + + const expectCall = call.expression.expression; + const args = call.arguments; + + const timesCall = ts.factory.createCallExpression( + createPropertyAccess(expectCall, 'toHaveBeenCalledTimes'), + undefined, + [ts.factory.createNumericLiteral(1)], + ); + + const withCall = ts.factory.createCallExpression( + createPropertyAccess(expectCall, 'toHaveBeenCalledWith'), + undefined, + args, + ); + + return [ + ts.factory.createExpressionStatement(timesCall), + ts.factory.createExpressionStatement(withCall), + ]; +} + +export function transformWithContext( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) { + return node; + } + + // Traverse the chain of property access expressions to find the .withContext() call + let currentExpression: ts.Expression = node.expression; + const propertyChain: ts.Identifier[] = []; + + while (ts.isPropertyAccessExpression(currentExpression)) { + if (!ts.isIdentifier(currentExpression.name)) { + // Break if we encounter a private identifier or something else unexpected + return node; + } + propertyChain.push(currentExpression.name); + currentExpression = currentExpression.expression; + } + + const withContextCall = currentExpression; + // Check if we found a .withContext() call + if ( + !ts.isCallExpression(withContextCall) || + !ts.isPropertyAccessExpression(withContextCall.expression) || + !ts.isIdentifier(withContextCall.expression.name) || + withContextCall.expression.name.text !== 'withContext' + ) { + return node; + } + + reporter.reportTransformation( + sourceFile, + withContextCall, + 'Transformed `.withContext()` to the `expect(..., message)` syntax.', + ); + + const expectCall = withContextCall.expression.expression; + + if ( + !ts.isCallExpression(expectCall) || + !ts.isIdentifier(expectCall.expression) || + expectCall.expression.text !== 'expect' + ) { + return node; + } + + const contextMessage = withContextCall.arguments[0]; + if (!contextMessage) { + // No message provided, so unwrap the .withContext() call. + let newChain: ts.Expression = expectCall; + for (let i = propertyChain.length - 1; i >= 0; i--) { + newChain = ts.factory.createPropertyAccessExpression(newChain, propertyChain[i]); + } + + return ts.factory.updateCallExpression(node, newChain, node.typeArguments, node.arguments); + } + + const newExpectArgs = [...expectCall.arguments, contextMessage]; + const newExpectCall = ts.factory.updateCallExpression( + expectCall, + expectCall.expression, + expectCall.typeArguments, + newExpectArgs, + ); + + // Rebuild the property access chain + let newExpression: ts.Expression = newExpectCall; + for (let i = propertyChain.length - 1; i >= 0; i--) { + newExpression = ts.factory.createPropertyAccessExpression(newExpression, propertyChain[i]); + } + + return ts.factory.updateCallExpression(node, newExpression, node.typeArguments, node.arguments); +} + +export function transformExpectNothing( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if (!ts.isExpressionStatement(node)) { + return node; + } + + const call = node.expression; + if ( + !ts.isCallExpression(call) || + !ts.isPropertyAccessExpression(call.expression) || + !ts.isIdentifier(call.expression.name) || + call.expression.name.text !== 'nothing' + ) { + return node; + } + + const expectCall = call.expression.expression; + if ( + !ts.isCallExpression(expectCall) || + !ts.isIdentifier(expectCall.expression) || + expectCall.expression.text !== 'expect' || + expectCall.arguments.length > 0 + ) { + return node; + } + + // The statement is `expect().nothing()`, which can be removed. + const replacement = ts.factory.createEmptyStatement(); + const originalText = node.getFullText().trim(); + + reporter.reportTransformation(sourceFile, node, 'Removed `expect().nothing()` statement.'); + const category = 'expect-nothing'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(replacement, category); + ts.addSyntheticLeadingComment( + replacement, + ts.SyntaxKind.SingleLineCommentTrivia, + ` ${originalText}`, + true, + ); + + return replacement; +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher_spec.ts new file mode 100644 index 000000000000..a46fc63d2a01 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher_spec.ts @@ -0,0 +1,362 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from '../test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('transformAsymmetricMatchers', () => { + const testCases = [ + { + description: 'should transform jasmine.any(String) to expect.any(String)', + input: `expect(foo).toEqual(jasmine.any(String));`, + expected: `expect(foo).toEqual(expect.any(String));`, + }, + { + description: + 'should transform jasmine.objectContaining(...) to expect.objectContaining(...)', + input: `expect(foo).toEqual(jasmine.objectContaining({ bar: 'baz' }));`, + expected: `expect(foo).toEqual(expect.objectContaining({ bar: 'baz' }));`, + }, + { + description: 'should transform jasmine.anything() to expect.anything()', + input: `expect(foo).toEqual(jasmine.anything());`, + expected: `expect(foo).toEqual(expect.anything());`, + }, + { + description: 'should transform jasmine.stringMatching(...) to expect.stringMatching(...)', + input: `expect(foo).toEqual(jasmine.stringMatching(/some-pattern/));`, + expected: `expect(foo).toEqual(expect.stringMatching(/some-pattern/));`, + }, + { + description: 'should transform jasmine.arrayContaining(...) to expect.arrayContaining(...)', + input: `expect(foo).toEqual(jasmine.arrayContaining(['a']));`, + expected: `expect(foo).toEqual(expect.arrayContaining(['a']));`, + }, + { + description: + 'should transform jasmine.stringContaining(...) to expect.stringContaining(...)', + input: `expect(foo).toEqual(jasmine.stringContaining('substring'));`, + expected: `expect(foo).toEqual(expect.stringContaining('substring'));`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformExpectAsync', () => { + const testCases = [ + { + description: 'should transform expectAsync(...).toBeResolved()', + input: `await expectAsync(myPromise).toBeResolved();`, + expected: `await expect(myPromise).resolves.not.toThrow();`, + }, + { + description: 'should transform expectAsync(...).toBeResolvedTo(value)', + input: `await expectAsync(myPromise).toBeResolvedTo(42);`, + expected: `await expect(myPromise).resolves.toEqual(42);`, + }, + { + description: 'should transform expectAsync(...).toBeRejected()', + input: `await expectAsync(myPromise).toBeRejected();`, + expected: `await expect(myPromise).rejects.toThrow();`, + }, + { + description: 'should transform expectAsync(...).toBeRejectedWith(error)', + input: `await expectAsync(myPromise).toBeRejectedWith('Error');`, + expected: `await expect(myPromise).rejects.toEqual('Error');`, + }, + { + description: 'should transform expectAsync(...).toBeRejectedWithError(ErrorClass, message)', + input: `await expectAsync(myPromise).toBeRejectedWithError(TypeError, 'Failed');`, + expected: `await expect(myPromise).rejects.toThrowError(TypeError, 'Failed');`, + }, + { + description: 'should add a TODO for an unknown expectAsync matcher', + input: `await expectAsync(myPromise).toBeSomethingElse();`, + expected: ` + // TODO: vitest-migration: Unsupported expectAsync matcher ".toBeSomethingElse()" found. Please migrate this manually. + await expectAsync(myPromise).toBeSomethingElse(); + `, + }, + { + description: 'should add a specific TODO for toBePending', + input: `await expectAsync(myPromise).toBePending();`, + /* eslint-disable max-len */ + expected: ` + // TODO: vitest-migration: Unsupported matcher ".toBePending()" found. Vitest does not have a direct equivalent. Please migrate this manually, for example by using \`Promise.race\` to check if the promise settles within a short timeout. + await expectAsync(myPromise).toBePending(); + `, + /* eslint-enable max-len */ + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformCalledOnceWith', () => { + const testCases = [ + { + description: 'should transform toHaveBeenCalledOnceWith(...) into two separate calls', + input: `expect(mySpy).toHaveBeenCalledOnceWith('foo', 'bar');`, + expected: ` + expect(mySpy).toHaveBeenCalledTimes(1); + expect(mySpy).toHaveBeenCalledWith('foo', 'bar'); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformSyntacticSugarMatchers', () => { + const testCases = [ + { + description: 'should transform toBeTrue() to toBe(true)', + input: `expect(value).toBeTrue();`, + expected: `expect(value).toBe(true);`, + }, + { + description: 'should transform toBeFalse() to toBe(false)', + input: `expect(value).toBeFalse();`, + expected: `expect(value).toBe(false);`, + }, + { + description: 'should transform toBePositiveInfinity() to toBe(Infinity)', + input: `expect(value).toBePositiveInfinity();`, + expected: `expect(value).toBe(Infinity);`, + }, + { + description: 'should transform toBeNegativeInfinity() to toBe(-Infinity)', + input: `expect(value).toBeNegativeInfinity();`, + expected: `expect(value).toBe(-Infinity);`, + }, + { + description: 'should transform toHaveSize(number) to toHaveLength(number)', + input: `expect(myArray).toHaveSize(3);`, + expected: `expect(myArray).toHaveLength(3);`, + }, + { + description: 'should add a TODO for toThrowMatching', + input: `expect(() => {}).toThrowMatching((e) => e.message === 'foo');`, + expected: `// TODO: vitest-migration: Unsupported matcher ".toThrowMatching()" found. Please migrate this manually. See: https://vitest.dev/api/expect.html#tothrowerror +expect(() => {}).toThrowMatching((e) => e.message === 'foo');`, + }, + { + description: 'should add a TODO for toHaveSpyInteractions', + input: `expect(mySpyObj).toHaveSpyInteractions();`, + // eslint-disable-next-line max-len + expected: `// TODO: vitest-migration: Unsupported matcher ".toHaveSpyInteractions()" found. Please migrate this manually by checking the \`mock.calls.length\` of the individual spies. +expect(mySpyObj).toHaveSpyInteractions();`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformComplexMatchers', () => { + const testCases = [ + { + description: 'should transform toEqual(jasmine.truthy()) to toBeTruthy()', + input: `expect(value).toEqual(jasmine.truthy());`, + expected: `expect(value).toBeTruthy();`, + }, + { + description: 'should transform toEqual(jasmine.falsy()) to toBeFalsy()', + input: `expect(value).toEqual(jasmine.falsy());`, + expected: `expect(value).toBeFalsy();`, + }, + { + description: 'should transform toEqual(jasmine.empty()) to toHaveLength(0)', + input: `expect([]).toEqual(jasmine.empty());`, + expected: `expect([]).toHaveLength(0);`, + }, + { + description: 'should transform not.toEqual(jasmine.empty()) to not.toHaveLength(0)', + input: `expect([1]).not.toEqual(jasmine.empty());`, + expected: `expect([1]).not.toHaveLength(0);`, + }, + { + description: 'should transform toEqual(jasmine.notEmpty()) to not.toHaveLength(0)', + input: `expect([1]).toEqual(jasmine.notEmpty());`, + expected: `expect([1]).not.toHaveLength(0);`, + }, + { + description: 'should transform not.toEqual(jasmine.notEmpty()) to toHaveLength(0)', + input: `expect([]).not.toEqual(jasmine.notEmpty());`, + expected: `expect([]).toHaveLength(0);`, + }, + { + description: 'should transform toEqual(jasmine.is()) to toBe()', + input: `expect(value).toEqual(jasmine.is(otherValue));`, + expected: `expect(value).toBe(otherValue);`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformArrayWithExactContents', () => { + const testCases = [ + { + description: 'should transform toEqual(jasmine.arrayWithExactContents()) into two calls', + input: `expect(myArray).toEqual(jasmine.arrayWithExactContents(['a', 'b']));`, + /* eslint-disable max-len */ + expected: ` + // TODO: vitest-migration: Verify this matches strict array content (multiset equality). Vitest's arrayContaining is a subset check. + expect(myArray).toHaveLength(2); + expect(myArray).toEqual(expect.arrayContaining(['a', 'b'])); + `, + /* eslint-enable max-len */ + }, + { + description: + 'should transform toEqual(jasmine.arrayWithExactContents()) with asymmetric matchers', + input: `expect(myArray).toEqual(jasmine.arrayWithExactContents([jasmine.any(Number), 'a']));`, + /* eslint-disable max-len */ + expected: ` + // TODO: vitest-migration: Verify this matches strict array content (multiset equality). Vitest's arrayContaining is a subset check. + expect(myArray).toHaveLength(2); + expect(myArray).toEqual(expect.arrayContaining([expect.any(Number), 'a'])); + `, + /* eslint-enable max-len */ + }, + { + description: + 'should add a TODO for toEqual(jasmine.arrayWithExactContents()) with a variable', + input: `expect(myArray).toEqual(jasmine.arrayWithExactContents(someOtherArray));`, + expected: ` + // TODO: vitest-migration: Cannot transform jasmine.arrayWithExactContents with a dynamic variable. Please migrate this manually. + expect(myArray).toEqual(jasmine.arrayWithExactContents(someOtherArray)); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformExpectNothing', () => { + const testCases = [ + { + description: 'should remove expect().nothing() and add a comment', + input: ` + it('should be a passing test', () => { + expect().nothing(); + }); + `, + /* eslint-disable max-len */ + expected: ` + it('should be a passing test', () => { + // TODO: vitest-migration: expect().nothing() has been removed because it is redundant in Vitest. Tests without assertions pass by default. + // expect().nothing(); + }); + `, + /* eslint-enable max-len */ + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformWithContext', () => { + const testCases = [ + { + description: 'should transform .withContext() to an expect message', + input: `expect(value).withContext('It should be true').toBe(true);`, + expected: `expect(value, 'It should be true').toBe(true);`, + }, + { + description: 'should handle chained matchers', + input: `expect(value).withContext('It should not be false').not.toBe(false);`, + expected: `expect(value, 'It should not be false').not.toBe(false);`, + }, + { + description: 'should handle .withContext() with no arguments by removing it', + input: `expect(value).withContext().toBe(true);`, + expected: `expect(value).toBe(true);`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformtoHaveBeenCalledBefore', () => { + const testCases = [ + { + description: 'should transform toHaveBeenCalledBefore', + input: `expect(spyA).toHaveBeenCalledBefore(spyB);`, + // eslint-disable-next-line max-len + expected: `expect(Math.min(...vi.mocked(spyA).mock.invocationCallOrder)).toBeLessThan(Math.min(...vi.mocked(spyB).mock.invocationCallOrder));`, + }, + { + description: 'should transform not.toHaveBeenCalledBefore', + input: `expect(spyA).not.toHaveBeenCalledBefore(spyB);`, + // eslint-disable-next-line max-len + expected: `expect(Math.min(...vi.mocked(spyA).mock.invocationCallOrder)).toBeGreaterThanOrEqual(Math.min(...vi.mocked(spyB).mock.invocationCallOrder));`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformToHaveClass', () => { + const testCases = [ + { + description: 'should transform toHaveClass', + input: `expect(element).toHaveClass('my-class');`, + expected: `expect(element.classList.contains('my-class')).toBe(true);`, + }, + { + description: 'should transform not.toHaveClass', + input: `expect(element).not.toHaveClass('my-class');`, + expected: `expect(element.classList.contains('my-class')).toBe(false);`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc.ts new file mode 100644 index 000000000000..2872a3f7503e --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc.ts @@ -0,0 +1,247 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file contains transformers for miscellaneous Jasmine APIs that don't + * fit into other categories. This includes timer mocks (`jasmine.clock`), the `fail()` + * function, and configuration settings like `jasmine.DEFAULT_TIMEOUT_INTERVAL`. It also + * includes logic to identify and add TODO comments for unsupported Jasmine features. + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { addVitestValueImport, createViCallExpression } from '../utils/ast-helpers'; +import { getJasmineMethodName, isJasmineCallExpression } from '../utils/ast-validation'; +import { addTodoComment } from '../utils/comment-helpers'; +import { RefactorContext } from '../utils/refactor-context'; +import { TodoCategory } from '../utils/todo-notes'; + +export function transformTimerMocks( + node: ts.Node, + { sourceFile, reporter, pendingVitestValueImports }: RefactorContext, +): ts.Node { + if ( + !ts.isCallExpression(node) || + !ts.isPropertyAccessExpression(node.expression) || + !ts.isIdentifier(node.expression.name) + ) { + return node; + } + + const pae = node.expression; + const clockCall = pae.expression; + if (!isJasmineCallExpression(clockCall, 'clock')) { + return node; + } + + let newMethodName: string | undefined; + switch (pae.name.text) { + case 'install': + newMethodName = 'useFakeTimers'; + break; + case 'tick': + newMethodName = 'advanceTimersByTime'; + break; + case 'uninstall': + newMethodName = 'useRealTimers'; + break; + case 'mockDate': + newMethodName = 'setSystemTime'; + break; + } + + if (newMethodName) { + addVitestValueImport(pendingVitestValueImports, 'vi'); + reporter.reportTransformation( + sourceFile, + node, + `Transformed \`jasmine.clock().${pae.name.text}\` to \`vi.${newMethodName}\`.`, + ); + let newArgs: readonly ts.Expression[] = node.arguments; + if (newMethodName === 'useFakeTimers') { + newArgs = []; + } + if (newMethodName === 'setSystemTime' && node.arguments.length === 0) { + newArgs = [ + ts.factory.createNewExpression(ts.factory.createIdentifier('Date'), undefined, []), + ]; + } + + return createViCallExpression(newMethodName, newArgs); + } + + return node; +} + +export function transformFail(node: ts.Node, { sourceFile, reporter }: RefactorContext): ts.Node { + if ( + ts.isExpressionStatement(node) && + ts.isCallExpression(node.expression) && + ts.isIdentifier(node.expression.expression) && + node.expression.expression.text === 'fail' + ) { + reporter.reportTransformation(sourceFile, node, 'Transformed `fail()` to `throw new Error()`.'); + const reason = node.expression.arguments[0]; + + const replacement = ts.factory.createThrowStatement( + ts.factory.createNewExpression( + ts.factory.createIdentifier('Error'), + undefined, + reason ? [reason] : [], + ), + ); + + return ts.setOriginalNode(ts.setTextRange(replacement, node), node); + } + + return node; +} + +export function transformDefaultTimeoutInterval( + node: ts.Node, + { sourceFile, reporter, pendingVitestValueImports }: RefactorContext, +): ts.Node { + if ( + ts.isExpressionStatement(node) && + ts.isBinaryExpression(node.expression) && + node.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken + ) { + const assignment = node.expression; + if ( + ts.isPropertyAccessExpression(assignment.left) && + ts.isIdentifier(assignment.left.expression) && + assignment.left.expression.text === 'jasmine' && + assignment.left.name.text === 'DEFAULT_TIMEOUT_INTERVAL' + ) { + addVitestValueImport(pendingVitestValueImports, 'vi'); + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `jasmine.DEFAULT_TIMEOUT_INTERVAL` to `vi.setConfig()`.', + ); + const timeoutValue = assignment.right; + const setConfigCall = createViCallExpression('setConfig', [ + ts.factory.createObjectLiteralExpression( + [ts.factory.createPropertyAssignment('testTimeout', timeoutValue)], + false, + ), + ]); + + return ts.factory.updateExpressionStatement(node, setConfigCall); + } + } + + return node; +} + +export function transformGlobalFunctions( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + ts.isCallExpression(node) && + ts.isIdentifier(node.expression) && + (node.expression.text === 'setSpecProperty' || node.expression.text === 'setSuiteProperty') + ) { + const functionName = node.expression.text; + reporter.reportTransformation( + sourceFile, + node, + `Found unsupported global function \`${functionName}\`.`, + ); + const category = 'unsupported-global-function'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category, { name: functionName }); + } + + return node; +} + +const UNSUPPORTED_JASMINE_CALLS_CATEGORIES = new Set([ + 'addMatchers', + 'addCustomEqualityTester', + 'mapContaining', + 'setContaining', +]); + +// A type guard to ensure that the methodName is one of the categories handled by this transformer. +function isUnsupportedJasmineCall( + methodName: string, +): methodName is 'addMatchers' | 'addCustomEqualityTester' | 'mapContaining' | 'setContaining' { + return UNSUPPORTED_JASMINE_CALLS_CATEGORIES.has(methodName as TodoCategory); +} + +export function transformUnsupportedJasmineCalls( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + const methodName = getJasmineMethodName(node); + + if (methodName && isUnsupportedJasmineCall(methodName)) { + reporter.reportTransformation( + sourceFile, + node, + `Found unsupported call \`jasmine.${methodName}\`.`, + ); + reporter.recordTodo(methodName, sourceFile, node); + addTodoComment(node, methodName); + } + + return node; +} + +// If any additional properties are added to transforms, they should also be added to this list. +const HANDLED_JASMINE_PROPERTIES = new Set([ + // Spies + 'createSpy', + 'createSpyObj', + 'spyOnAllFunctions', + // Clock + 'clock', + // Matchers + 'any', + 'anything', + 'stringMatching', + 'objectContaining', + 'arrayContaining', + 'arrayWithExactContents', + 'truthy', + 'falsy', + 'empty', + 'notEmpty', + 'mapContaining', + 'setContaining', + // Other + 'DEFAULT_TIMEOUT_INTERVAL', + 'addMatchers', + 'addCustomEqualityTester', +]); + +export function transformUnknownJasmineProperties( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + ts.isPropertyAccessExpression(node) && + ts.isIdentifier(node.expression) && + node.expression.text === 'jasmine' + ) { + const propName = node.name.text; + if (!HANDLED_JASMINE_PROPERTIES.has(propName)) { + reporter.reportTransformation( + sourceFile, + node, + `Found unknown jasmine property \`jasmine.${propName}\`.`, + ); + const category = 'unknown-jasmine-property'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category, { name: propName }); + } + } + + return node; +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts new file mode 100644 index 000000000000..0ce25ccacfd5 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts @@ -0,0 +1,221 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from '../test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('transformTimerMocks', () => { + const testCases = [ + { + description: 'should transform jasmine.clock().install() to vi.useFakeTimers()', + input: `jasmine.clock().install();`, + expected: `vi.useFakeTimers();`, + }, + { + description: 'should transform jasmine.clock().tick(100) to vi.advanceTimersByTime(100)', + input: `jasmine.clock().tick(100);`, + expected: `vi.advanceTimersByTime(100);`, + }, + { + description: 'should transform jasmine.clock().uninstall() to vi.useRealTimers()', + input: `jasmine.clock().uninstall();`, + expected: `vi.useRealTimers();`, + }, + { + description: 'should transform jasmine.clock().mockDate(date) to vi.setSystemTime(date)', + input: `jasmine.clock().mockDate(new Date('2025-01-01'));`, + expected: `vi.setSystemTime(new Date('2025-01-01'));`, + }, + { + description: 'should transform jasmine.clock().mockDate() to vi.setSystemTime(new Date())', + input: `jasmine.clock().mockDate();`, + expected: `vi.setSystemTime(new Date());`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformFail', () => { + const testCases = [ + { + description: 'should transform fail() to throw new Error()', + input: `fail('This should not happen');`, + expected: `throw new Error('This should not happen');`, + }, + { + description: 'should transform fail() without a message to throw new Error()', + input: `fail();`, + expected: `throw new Error();`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformDefaultTimeoutInterval', () => { + const testCases = [ + { + description: 'should transform jasmine.DEFAULT_TIMEOUT_INTERVAL', + input: `jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;`, + expected: `vi.setConfig({ testTimeout: 10000 });`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformAddMatchers', () => { + const testCases = [ + { + description: 'should add a TODO for jasmine.addMatchers', + input: ` + jasmine.addMatchers({ + toBeDivisibleByTwo: function() { + return { + compare: function(actual) { + return { + pass: actual % 2 === 0 + }; + } + }; + } + }); + `, + expected: ` + // TODO: vitest-migration: jasmine.addMatchers is not supported. Please manually migrate to expect.extend(). See: https://vitest.dev/api/expect.html#expect-extend + jasmine.addMatchers({ + toBeDivisibleByTwo: function () { + return { + compare: function (actual) { + return { + pass: actual % 2 === 0, + }; + }, + }; + }, + }); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformAddCustomEqualityTester', () => { + const testCases = [ + { + description: 'should add a TODO for jasmine.addCustomEqualityTester', + input: ` + jasmine.addCustomEqualityTester((a, b) => { + return a.toString() === b.toString(); + }); + `, + expected: `// TODO: vitest-migration: jasmine.addCustomEqualityTester is not supported. Please manually migrate to expect.addEqualityTesters(). See: https://vitest.dev/api/expect.html#expect-addequalitytesters + jasmine.addCustomEqualityTester((a, b) => { + return a.toString() === b.toString(); + }); + `, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformUnknownJasmineProperties', () => { + const testCases = [ + { + description: 'should add a TODO for an unknown jasmine property', + input: `const env = jasmine.getEnv();`, + expected: `// TODO: vitest-migration: Unsupported jasmine property "getEnv" found. Please migrate this manually. +const env = jasmine.getEnv();`, + }, + { + description: 'should not add a TODO for a known jasmine property', + input: `const spy = jasmine.createSpy();`, + expected: `const spy = vi.fn();`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformGlobalFunctions', () => { + const testCases = [ + { + description: 'should add a TODO for setSpecProperty', + input: `setSpecProperty('myKey', 'myValue');`, + // eslint-disable-next-line max-len + expected: `// TODO: vitest-migration: Unsupported global function \`setSpecProperty\` found. This function is used for custom reporters in Jasmine and has no direct equivalent in Vitest. +setSpecProperty('myKey', 'myValue');`, + }, + { + description: 'should add a TODO for setSuiteProperty', + input: `setSuiteProperty('myKey', 'myValue');`, + // eslint-disable-next-line max-len + expected: `// TODO: vitest-migration: Unsupported global function \`setSuiteProperty\` found. This function is used for custom reporters in Jasmine and has no direct equivalent in Vitest. +setSuiteProperty('myKey', 'myValue');`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformUnsupportedJasmineCalls', () => { + const testCases = [ + { + description: 'should add a TODO for jasmine.mapContaining', + input: `expect(myMap).toEqual(jasmine.mapContaining(new Map()));`, + // eslint-disable-next-line max-len + expected: `// TODO: vitest-migration: jasmine.mapContaining is not supported. Vitest does not have a built-in matcher for Maps. Please manually assert the contents of the Map. +expect(myMap).toEqual(jasmine.mapContaining(new Map()));`, + }, + { + description: 'should add a TODO for jasmine.setContaining', + input: `expect(mySet).toEqual(jasmine.setContaining(new Set()));`, + // eslint-disable-next-line max-len + expected: `// TODO: vitest-migration: jasmine.setContaining is not supported. Vitest does not have a built-in matcher for Sets. Please manually assert the contents of the Set. +expect(mySet).toEqual(jasmine.setContaining(new Set()));`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy.ts new file mode 100644 index 000000000000..f019dbb53099 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy.ts @@ -0,0 +1,504 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file contains transformers dedicated to converting Jasmine's spying + * functionality to Vitest's mocking APIs. It handles the creation of spies (`spyOn`, + * `createSpy`, `createSpyObj`), spy strategies (`and.returnValue`, `and.callFake`), + * and the inspection of spy calls (`spy.calls.reset`, `spy.calls.mostRecent`). + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { + addVitestValueImport, + createPropertyAccess, + createViCallExpression, +} from '../utils/ast-helpers'; +import { getJasmineMethodName, isJasmineCallExpression } from '../utils/ast-validation'; +import { addTodoComment } from '../utils/comment-helpers'; +import { RefactorContext } from '../utils/refactor-context'; + +export function transformSpies(node: ts.Node, refactorCtx: RefactorContext): ts.Node { + const { sourceFile, reporter, pendingVitestValueImports } = refactorCtx; + if (!ts.isCallExpression(node)) { + return node; + } + + if ( + ts.isIdentifier(node.expression) && + (node.expression.text === 'spyOn' || node.expression.text === 'spyOnProperty') + ) { + addVitestValueImport(pendingVitestValueImports, 'vi'); + reporter.reportTransformation( + sourceFile, + node, + `Transformed \`${node.expression.text}\` to \`vi.spyOn\`.`, + ); + + return ts.factory.updateCallExpression( + node, + createPropertyAccess('vi', 'spyOn'), + node.typeArguments, + node.arguments, + ); + } + + if (ts.isPropertyAccessExpression(node.expression)) { + const pae = node.expression; + + if ( + ts.isPropertyAccessExpression(pae.expression) && + ts.isIdentifier(pae.expression.name) && + pae.expression.name.text === 'and' + ) { + const spyCall = pae.expression.expression; + let newMethodName: string | undefined; + if (ts.isIdentifier(pae.name)) { + const strategyName = pae.name.text; + switch (strategyName) { + case 'returnValue': + newMethodName = 'mockReturnValue'; + break; + case 'resolveTo': + newMethodName = 'mockResolvedValue'; + break; + case 'rejectWith': + newMethodName = 'mockRejectedValue'; + break; + case 'returnValues': { + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `.and.returnValues()` to chained `.mockReturnValueOnce()` calls.', + ); + const returnValues = node.arguments; + if (returnValues.length === 0) { + // No values, so it's a no-op. Just transform the spyOn call. + return transformSpies(spyCall, refactorCtx); + } + // spy.and.returnValues(a, b) -> spy.mockReturnValueOnce(a).mockReturnValueOnce(b) + let chainedCall: ts.Expression = spyCall; + for (const value of returnValues) { + const mockCall = ts.factory.createCallExpression( + createPropertyAccess(chainedCall, 'mockReturnValueOnce'), + undefined, + [value], + ); + chainedCall = mockCall; + } + + return chainedCall; + } + case 'callFake': + newMethodName = 'mockImplementation'; + break; + case 'callThrough': + reporter.reportTransformation( + sourceFile, + node, + 'Removed redundant `.and.callThrough()` call.', + ); + + return transformSpies(spyCall, refactorCtx); // .and.callThrough() is redundant, just transform spyOn. + case 'stub': { + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `.and.stub()` to `.mockImplementation()`.', + ); + const newExpression = createPropertyAccess(spyCall, 'mockImplementation'); + const arrowFn = ts.factory.createArrowFunction( + undefined, + undefined, + [], + undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + ts.factory.createBlock([], /* multiline */ true), + ); + + return ts.factory.createCallExpression(newExpression, undefined, [arrowFn]); + } + case 'throwError': { + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `.and.throwError()` to `.mockImplementation()`.', + ); + const errorArg = node.arguments[0]; + const throwStatement = ts.factory.createThrowStatement( + ts.isNewExpression(errorArg) + ? errorArg + : ts.factory.createNewExpression( + ts.factory.createIdentifier('Error'), + undefined, + node.arguments, + ), + ); + const arrowFunction = ts.factory.createArrowFunction( + undefined, + undefined, + [], + undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + ts.factory.createBlock([throwStatement], true), + ); + const newExpression = createPropertyAccess(spyCall, 'mockImplementation'); + + return ts.factory.createCallExpression(newExpression, undefined, [arrowFunction]); + } + default: { + const category = 'unsupported-spy-strategy'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category, { name: strategyName }); + break; + } + } + + if (newMethodName) { + reporter.reportTransformation( + sourceFile, + node, + `Transformed spy strategy \`.and.${strategyName}()\` to \`.${newMethodName}()\`.`, + ); + + const newExpression = ts.factory.updatePropertyAccessExpression( + pae, + spyCall, + ts.factory.createIdentifier(newMethodName), + ); + + return ts.factory.updateCallExpression( + node, + newExpression, + node.typeArguments, + node.arguments, + ); + } + } + } + } + + const jasmineMethodName = getJasmineMethodName(node); + switch (jasmineMethodName) { + case 'createSpy': + addVitestValueImport(pendingVitestValueImports, 'vi'); + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `jasmine.createSpy()` to `vi.fn()`.', + ); + + // jasmine.createSpy(name, originalFn) -> vi.fn(originalFn) + return createViCallExpression('fn', node.arguments.length > 1 ? [node.arguments[1]] : []); + case 'spyOnAllFunctions': { + reporter.reportTransformation( + sourceFile, + node, + 'Found unsupported `jasmine.spyOnAllFunctions()`.', + ); + const category = 'spyOnAllFunctions'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + + return node; + } + } + + return node; +} + +export function transformCreateSpyObj( + node: ts.Node, + { sourceFile, reporter, pendingVitestValueImports }: RefactorContext, +): ts.Node { + if (!isJasmineCallExpression(node, 'createSpyObj')) { + return node; + } + + addVitestValueImport(pendingVitestValueImports, 'vi'); + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `jasmine.createSpyObj()` to an object literal with `vi.fn()`.', + ); + + const firstArg = node.arguments[0]; + const hasBaseName = ts.isStringLiteral(firstArg); + const baseName = hasBaseName ? firstArg.text : undefined; + const methods = hasBaseName ? node.arguments[1] : firstArg; + const propertiesArg = hasBaseName ? node.arguments[2] : node.arguments[1]; + let properties: ts.PropertyAssignment[] = []; + + if (node.arguments.length < 2 && hasBaseName) { + const category = 'createSpyObj-single-argument'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + + return node; + } + + if (ts.isArrayLiteralExpression(methods)) { + properties = createSpyObjWithArray(methods, baseName); + } else if (ts.isObjectLiteralExpression(methods)) { + properties = createSpyObjWithObject(methods, baseName); + } else { + const category = 'createSpyObj-dynamic-variable'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + + return node; + } + + if (propertiesArg) { + if (ts.isObjectLiteralExpression(propertiesArg)) { + properties.push(...(propertiesArg.properties as unknown as ts.PropertyAssignment[])); + } else { + const category = 'createSpyObj-dynamic-property-map'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + } + } + + return ts.factory.createObjectLiteralExpression(properties, true); +} + +function createSpyObjWithArray( + methods: ts.ArrayLiteralExpression, + baseName: string | undefined, +): ts.PropertyAssignment[] { + return methods.elements + .map((element) => { + if (ts.isStringLiteral(element)) { + const mockFn = createViCallExpression('fn'); + const methodName = element.text; + let finalExpression: ts.Expression = mockFn; + + if (baseName) { + finalExpression = ts.factory.createCallExpression( + createPropertyAccess(finalExpression, 'mockName'), + undefined, + [ts.factory.createStringLiteral(`${baseName}.${methodName}`)], + ); + } + + return ts.factory.createPropertyAssignment( + ts.factory.createIdentifier(methodName), + finalExpression, + ); + } + + return undefined; + }) + .filter((p): p is ts.PropertyAssignment => !!p); +} + +function createSpyObjWithObject( + methods: ts.ObjectLiteralExpression, + baseName: string | undefined, +): ts.PropertyAssignment[] { + return methods.properties + .map((prop) => { + if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) { + const methodName = prop.name.text; + const returnValue = prop.initializer; + let mockFn = createViCallExpression('fn'); + + if (baseName) { + mockFn = ts.factory.createCallExpression( + createPropertyAccess(mockFn, 'mockName'), + undefined, + [ts.factory.createStringLiteral(`${baseName}.${methodName}`)], + ); + } + + const mockReturnValue = createPropertyAccess(mockFn, 'mockReturnValue'); + + return ts.factory.createPropertyAssignment( + ts.factory.createIdentifier(methodName), + ts.factory.createCallExpression(mockReturnValue, undefined, [returnValue]), + ); + } + + return undefined; + }) + .filter((p): p is ts.PropertyAssignment => !!p); +} + +export function transformSpyReset( + node: ts.Node, + { sourceFile, reporter }: RefactorContext, +): ts.Node { + if ( + ts.isCallExpression(node) && + ts.isPropertyAccessExpression(node.expression) && + ts.isIdentifier(node.expression.name) && + node.expression.name.text === 'reset' && + ts.isPropertyAccessExpression(node.expression.expression) + ) { + const callsPae = node.expression.expression; + if (ts.isIdentifier(callsPae.name) && callsPae.name.text === 'calls') { + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `spy.calls.reset()` to `.mockClear()`.', + ); + const spyIdentifier = callsPae.expression; + const newExpression = createPropertyAccess(spyIdentifier, 'mockClear'); + + return ts.factory.updateCallExpression(node, newExpression, node.typeArguments, []); + } + } + + return node; +} + +function getSpyIdentifierFromCalls(node: ts.PropertyAccessExpression): ts.Expression | undefined { + if (ts.isIdentifier(node.name) && node.name.text === 'calls') { + return node.expression; + } + + return undefined; +} + +function createMockedSpyMockProperty( + spyIdentifier: ts.Expression, + pendingVitestValueImports: Set, +): ts.PropertyAccessExpression { + addVitestValueImport(pendingVitestValueImports, 'vi'); + const mockedSpy = ts.factory.createCallExpression( + createPropertyAccess('vi', 'mocked'), + undefined, + [spyIdentifier], + ); + + return createPropertyAccess(mockedSpy, 'mock'); +} + +function transformMostRecentArgs( + node: ts.Node, + { sourceFile, reporter, pendingVitestValueImports }: RefactorContext, +): ts.Node { + // Check 1: Is it a property access for `.args`? + if ( + !ts.isPropertyAccessExpression(node) || + !ts.isIdentifier(node.name) || + node.name.text !== 'args' + ) { + return node; + } + + // Check 2: Is the preceding expression a call expression? + const mostRecentCall = node.expression; + if ( + !ts.isCallExpression(mostRecentCall) || + !ts.isPropertyAccessExpression(mostRecentCall.expression) + ) { + return node; + } + + // Check 3: Is it a call to `.mostRecent`? + const mostRecentPae = mostRecentCall.expression; + if ( + !ts.isIdentifier(mostRecentPae.name) || + mostRecentPae.name.text !== 'mostRecent' || + !ts.isPropertyAccessExpression(mostRecentPae.expression) + ) { + return node; + } + + // Check 4: Can we get the spy identifier from `spy.calls`? + const spyIdentifier = getSpyIdentifierFromCalls(mostRecentPae.expression); + if (!spyIdentifier) { + return node; + } + + // If all checks pass, perform the transformation. + reporter.reportTransformation( + sourceFile, + node, + 'Transformed `spy.calls.mostRecent().args` to `vi.mocked(spy).mock.lastCall`.', + ); + const mockProperty = createMockedSpyMockProperty(spyIdentifier, pendingVitestValueImports); + + return createPropertyAccess(mockProperty, 'lastCall'); +} + +export function transformSpyCallInspection(node: ts.Node, refactorCtx: RefactorContext): ts.Node { + const mostRecentArgsTransformed = transformMostRecentArgs(node, refactorCtx); + if (mostRecentArgsTransformed !== node) { + return mostRecentArgsTransformed; + } + + if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) { + return node; + } + + const { sourceFile, reporter, pendingVitestValueImports } = refactorCtx; + + const pae = node.expression; // e.g., mySpy.calls.count + const spyIdentifier = ts.isPropertyAccessExpression(pae.expression) + ? getSpyIdentifierFromCalls(pae.expression) + : undefined; + + if (spyIdentifier) { + const mockProperty = createMockedSpyMockProperty(spyIdentifier, pendingVitestValueImports); + const callsProperty = createPropertyAccess(mockProperty, 'calls'); + + const callName = pae.name.text; + let newExpression: ts.Node | undefined; + let message: string | undefined; + + switch (callName) { + case 'any': + message = 'Transformed `spy.calls.any()` to a check on `mock.calls.length`.'; + newExpression = ts.factory.createBinaryExpression( + createPropertyAccess(callsProperty, 'length'), + ts.SyntaxKind.GreaterThanToken, + ts.factory.createNumericLiteral(0), + ); + break; + case 'count': + message = 'Transformed `spy.calls.count()` to `mock.calls.length`.'; + newExpression = createPropertyAccess(callsProperty, 'length'); + break; + case 'first': + message = 'Transformed `spy.calls.first()` to `mock.calls[0]`.'; + newExpression = ts.factory.createElementAccessExpression(callsProperty, 0); + break; + case 'all': + case 'allArgs': + message = `Transformed \`spy.calls.${callName}()\` to \`mock.calls\`.`; + newExpression = callsProperty; + break; + case 'argsFor': + message = 'Transformed `spy.calls.argsFor()` to `mock.calls[i]`.'; + newExpression = ts.factory.createElementAccessExpression(callsProperty, node.arguments[0]); + break; + case 'mostRecent': + if ( + !ts.isPropertyAccessExpression(node.parent) || + !ts.isIdentifier(node.parent.name) || + node.parent.name.text !== 'args' + ) { + const category = 'mostRecent-without-args'; + reporter.recordTodo(category, sourceFile, node); + addTodoComment(node, category); + } + + return node; + } + + if (newExpression && message) { + reporter.reportTransformation(sourceFile, node, message); + + return newExpression; + } + } + + return node; +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts new file mode 100644 index 000000000000..6c11f776bd3b --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts @@ -0,0 +1,281 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from '../test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('transformSpies', () => { + const testCases = [ + { + description: 'should transform spyOn(object, "method") to vi.spyOn(object, "method")', + input: `spyOn(service, 'myMethod');`, + expected: `vi.spyOn(service, 'myMethod');`, + }, + { + description: 'should transform .and.returnValue(...) to .mockReturnValue(...)', + input: `spyOn(service, 'myMethod').and.returnValue(42);`, + expected: `vi.spyOn(service, 'myMethod').mockReturnValue(42);`, + }, + { + description: 'should transform .and.returnValues() to chained .mockReturnValueOnce() calls', + input: `spyOn(service, 'myMethod').and.returnValues('a', 'b', 'c');`, + expected: `vi.spyOn(service, 'myMethod').mockReturnValueOnce('a').mockReturnValueOnce('b').mockReturnValueOnce('c');`, + }, + { + description: 'should transform .and.callFake(...) to .mockImplementation(...)', + input: `spyOn(service, 'myMethod').and.callFake(() => 'fake');`, + expected: `vi.spyOn(service, 'myMethod').mockImplementation(() => 'fake');`, + }, + { + description: 'should remove .and.callThrough()', + input: `spyOn(service, 'myMethod').and.callThrough();`, + expected: `vi.spyOn(service, 'myMethod');`, + }, + { + description: 'should transform jasmine.createSpy("name") to vi.fn()', + input: `const mySpy = jasmine.createSpy('mySpy');`, + expected: `const mySpy = vi.fn();`, + }, + { + description: 'should transform jasmine.createSpy("name", fn) to vi.fn(fn)', + input: `const mySpy = jasmine.createSpy('mySpy', () => 'foo');`, + expected: `const mySpy = vi.fn(() => 'foo');`, + }, + { + description: 'should transform spyOnProperty(object, "prop") to vi.spyOn(object, "prop")', + input: `spyOnProperty(service, 'myProp');`, + expected: `vi.spyOn(service, 'myProp');`, + }, + { + description: 'should transform .and.stub() to .mockImplementation(() => {})', + input: `spyOn(service, 'myMethod').and.stub();`, + expected: `vi.spyOn(service, 'myMethod').mockImplementation(() => {});`, + }, + { + description: 'should add a TODO for jasmine.spyOnAllFunctions(object)', + input: `jasmine.spyOnAllFunctions(myObject);`, + expected: `// TODO: vitest-migration: Vitest does not have a direct equivalent for jasmine.spyOnAllFunctions(). Please spy on individual methods manually using vi.spyOn(). See: https://vitest.dev/api/vi.html#vi-spyon + jasmine.spyOnAllFunctions(myObject); + `, + }, + { + description: 'should handle chained calls on jasmine.createSpy()', + input: `const mySpy = jasmine.createSpy('mySpy').and.returnValue(true);`, + expected: `const mySpy = vi.fn().mockReturnValue(true);`, + }, + { + description: 'should handle .and.returnValues() with no arguments', + input: `spyOn(service, 'myMethod').and.returnValues();`, + expected: `vi.spyOn(service, 'myMethod');`, + }, + { + description: + 'should transform .and.throwError("message") to .mockImplementation(() => { throw new Error("message") })', + input: `spyOn(service, 'myMethod').and.throwError('Something went wrong');`, + expected: `vi.spyOn(service, 'myMethod').mockImplementation(() => { throw new Error('Something went wrong') });`, + }, + { + description: + 'should transform .and.throwError(new Error("message")) to .mockImplementation(() => { throw new Error("message") })', + input: `spyOn(service, 'myMethod').and.throwError(new Error('Custom Error'));`, + expected: `vi.spyOn(service, 'myMethod').mockImplementation(() => { throw new Error('Custom Error') });`, + }, + { + description: 'should transform .and.resolveTo(value) to .mockResolvedValue(value)', + input: `spyOn(service, 'myMethod').and.resolveTo('some value');`, + expected: `vi.spyOn(service, 'myMethod').mockResolvedValue('some value');`, + }, + { + description: 'should transform .and.rejectWith(error) to .mockRejectedValue(error)', + input: `spyOn(service, 'myMethod').and.rejectWith('some error');`, + expected: `vi.spyOn(service, 'myMethod').mockRejectedValue('some error');`, + }, + { + description: 'should add a TODO for an unsupported spy strategy', + input: `spyOn(service, 'myMethod').and.unknownStrategy();`, + expected: `// TODO: vitest-migration: Unsupported spy strategy ".and.unknownStrategy()" found. Please migrate this manually. See: https://vitest.dev/api/mocked.html#mock +vi.spyOn(service, 'myMethod').and.unknownStrategy();`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformCreateSpyObj', () => { + const testCases = [ + { + description: 'should transform jasmine.createSpyObj with an array of methods', + input: `const myService = jasmine.createSpyObj('MyService', ['methodA', 'methodB']);`, + expected: `const myService = { + methodA: vi.fn().mockName("MyService.methodA"), + methodB: vi.fn().mockName("MyService.methodB"), + };`, + }, + { + description: + 'should transform jasmine.createSpyObj with an array of methods without base name', + input: `const myService = jasmine.createSpyObj(['methodA', 'methodB']);`, + expected: `const myService = { + methodA: vi.fn(), + methodB: vi.fn(), + };`, + }, + { + description: 'should add a TODO if the second argument is not a literal', + input: `const myService = jasmine.createSpyObj('MyService', methodNames);`, + expected: ` + // TODO: vitest-migration: Cannot transform jasmine.createSpyObj with a dynamic variable. Please migrate this manually. See: https://vitest.dev/api/vi.html#vi-fn + const myService = jasmine.createSpyObj('MyService', methodNames); + `, + }, + { + description: 'should transform jasmine.createSpyObj with an object of return values', + input: `const myService = jasmine.createSpyObj('MyService', { methodA: 'foo', methodB: 42 });`, + expected: `const myService = { + methodA: vi.fn().mockName("MyService.methodA").mockReturnValue('foo'), + methodB: vi.fn().mockName("MyService.methodB").mockReturnValue(42), + };`, + }, + { + description: + 'should transform jasmine.createSpyObj with an object of return values without base name', + input: `const myService = jasmine.createSpyObj({ methodA: 'foo', methodB: 42 });`, + expected: `const myService = { + methodA: vi.fn().mockReturnValue('foo'), + methodB: vi.fn().mockReturnValue(42), + };`, + }, + { + description: + 'should transform jasmine.createSpyObj with an object of return values containing an asymmetric matcher', + input: `const myService = jasmine.createSpyObj('MyService', { methodA: jasmine.any(String) });`, + expected: `const myService = { + methodA: vi.fn().mockName("MyService.methodA").mockReturnValue(expect.any(String)), + };`, + }, + { + description: 'should add a TODO for jasmine.createSpyObj with only base name argument', + input: `const myService = jasmine.createSpyObj('MyService');`, + expected: ` + // TODO: vitest-migration: jasmine.createSpyObj called with a single argument is not supported for transformation. See: https://vitest.dev/api/vi.html#vi-fn + const myService = jasmine.createSpyObj('MyService'); + `, + }, + { + description: 'should transform jasmine.createSpyObj with a property map', + input: `const myService = jasmine.createSpyObj('MyService', ['methodA'], { propA: 'valueA' });`, + expected: `const myService = { + methodA: vi.fn().mockName("MyService.methodA"), + propA: 'valueA', + };`, + }, + { + description: 'should transform jasmine.createSpyObj with a method map and a property map', + input: `const myService = jasmine.createSpyObj('MyService', { methodA: 'foo' }, { propA: 'valueA' });`, + expected: `const myService = { + methodA: vi.fn().mockName("MyService.methodA").mockReturnValue('foo'), + propA: 'valueA', + };`, + }, + { + description: + 'should transform jasmine.createSpyObj with a method map and a property map without base name', + input: `const myService = jasmine.createSpyObj({ methodA: 'foo' }, { propA: 'valueA' });`, + expected: `const myService = { + methodA: vi.fn().mockReturnValue('foo'), + propA: 'valueA', + };`, + }, + { + description: 'should ignore non-string literals in the method array', + input: `const myService = jasmine.createSpyObj('MyService', ['methodA', 123, someVar]);`, + expected: `const myService = { + methodA: vi.fn().mockName("MyService.methodA"), + };`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformSpyReset', () => { + const testCases = [ + { + description: 'should transform spy.calls.reset() to spy.mockClear()', + input: `mySpy.calls.reset();`, + expected: `mySpy.mockClear();`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); + + describe('transformSpyCallInspection', () => { + const testCases = [ + { + description: 'should transform spy.calls.any()', + input: `expect(mySpy.calls.any()).toBe(true);`, + expected: `expect(vi.mocked(mySpy).mock.calls.length > 0).toBe(true);`, + }, + { + description: 'should transform spy.calls.count()', + input: `expect(mySpy.calls.count()).toBe(1);`, + expected: `expect(vi.mocked(mySpy).mock.calls.length).toBe(1);`, + }, + { + description: 'should transform spy.calls.argsFor(0)', + input: `const args = mySpy.calls.argsFor(0);`, + expected: `const args = vi.mocked(mySpy).mock.calls[0];`, + }, + { + description: 'should transform spy.calls.allArgs()', + input: `const allArgs = mySpy.calls.allArgs();`, + expected: `const allArgs = vi.mocked(mySpy).mock.calls;`, + }, + { + description: 'should transform spy.calls.all()', + input: `const allCalls = mySpy.calls.all();`, + expected: `const allCalls = vi.mocked(mySpy).mock.calls;`, + }, + { + description: 'should transform spy.calls.mostRecent().args', + input: `const recentArgs = mySpy.calls.mostRecent().args;`, + expected: `const recentArgs = vi.mocked(mySpy).mock.lastCall;`, + }, + { + description: 'should transform spy.calls.first()', + input: `const firstCall = mySpy.calls.first();`, + expected: `const firstCall = vi.mocked(mySpy).mock.calls[0];`, + }, + { + description: 'should add a TODO for spy.calls.mostRecent() without .args', + input: `const mostRecent = mySpy.calls.mostRecent();`, + expected: `// TODO: vitest-migration: Direct usage of mostRecent() is not supported. Please refactor to access .args directly or use vi.mocked(spy).mock.lastCall. See: https://vitest.dev/api/mocked.html#mock-lastcall +const mostRecent = mySpy.calls.mostRecent();`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type.ts new file mode 100644 index 000000000000..a7a0c7bedf80 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type.ts @@ -0,0 +1,109 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file contains a transformer that migrates Jasmine type definitions to + * their Vitest equivalents. It handles the conversion of types like `jasmine.Spy` and + * `jasmine.SpyObj` to Vitest's `Mock` and `MockedObject` types, and ensures that the + * necessary `vitest` imports are added to the file. + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { addVitestTypeImport } from '../utils/ast-helpers'; +import { RefactorContext } from '../utils/refactor-context'; + +export function transformJasmineTypes( + node: ts.Node, + { sourceFile, reporter, pendingVitestTypeImports }: RefactorContext, +): ts.Node { + const typeNameNode = ts.isTypeReferenceNode(node) ? node.typeName : node; + if ( + !ts.isQualifiedName(typeNameNode) || + !ts.isIdentifier(typeNameNode.left) || + typeNameNode.left.text !== 'jasmine' + ) { + return node; + } + + const jasmineTypeName = typeNameNode.right.text; + + switch (jasmineTypeName) { + case 'Spy': { + const vitestTypeName = 'Mock'; + reporter.reportTransformation( + sourceFile, + node, + `Transformed type \`jasmine.Spy\` to \`${vitestTypeName}\`.`, + ); + addVitestTypeImport(pendingVitestTypeImports, vitestTypeName); + + return ts.factory.createIdentifier(vitestTypeName); + } + case 'SpyObj': { + const vitestTypeName = 'MockedObject'; + reporter.reportTransformation( + sourceFile, + node, + `Transformed type \`jasmine.SpyObj\` to \`${vitestTypeName}\`.`, + ); + addVitestTypeImport(pendingVitestTypeImports, vitestTypeName); + + if (ts.isTypeReferenceNode(node)) { + return ts.factory.updateTypeReferenceNode( + node, + ts.factory.createIdentifier(vitestTypeName), + node.typeArguments, + ); + } + + return ts.factory.createIdentifier(vitestTypeName); + } + case 'Any': + reporter.reportTransformation( + sourceFile, + node, + `Transformed type \`jasmine.Any\` to \`any\`.`, + ); + + return ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword); + case 'ObjectContaining': { + const typeArguments = ts.isTypeReferenceNode(node) ? node.typeArguments : undefined; + if (typeArguments && typeArguments.length > 0) { + reporter.reportTransformation( + sourceFile, + node, + `Transformed type \`jasmine.ObjectContaining\` to \`Partial\`.`, + ); + + return ts.factory.createTypeReferenceNode('Partial', typeArguments); + } + + reporter.reportTransformation( + sourceFile, + node, + `Transformed type \`jasmine.ObjectContaining\` to \`object\`.`, + ); + + return ts.factory.createKeywordTypeNode(ts.SyntaxKind.ObjectKeyword); + } + case 'DoneFn': + reporter.reportTransformation( + sourceFile, + node, + 'Transformed type `jasmine.DoneFn` to `() => void`.', + ); + + return ts.factory.createFunctionTypeNode( + undefined, + [], + ts.factory.createKeywordTypeNode(ts.SyntaxKind.VoidKeyword), + ); + } + + return node; +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type_spec.ts new file mode 100644 index 000000000000..d38891730f99 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type_spec.ts @@ -0,0 +1,76 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { expectTransformation } from '../test-helpers'; + +describe('Jasmine to Vitest Transformer', () => { + describe('transformJasmineTypes', () => { + const testCases = [ + { + description: 'should transform a variable with a jasmine.Spy type', + input: `let mySpy: jasmine.Spy;`, + expected: ` + import type { Mock } from 'vitest'; + let mySpy: Mock; + `, + }, + { + description: 'should transform a variable with a jasmine.SpyObj type', + input: `let mySpy: jasmine.SpyObj;`, + expected: ` + import type { MockedObject } from 'vitest'; + let mySpy: MockedObject; + `, + }, + { + description: 'should handle multiple jasmine types and create a single import', + input: ` + let mySpy: jasmine.Spy; + let mySpyObj: jasmine.SpyObj; + `, + expected: ` + import type { Mock, MockedObject } from 'vitest'; + + let mySpy: Mock; + let mySpyObj: MockedObject; + `, + }, + { + description: 'should not add an import if no jasmine types are used', + input: `let mySpy: any;`, + expected: `let mySpy: any;`, + }, + { + description: 'should transform jasmine.Any to any', + input: `let myMatcher: jasmine.Any;`, + expected: `let myMatcher: any;`, + }, + { + description: 'should transform jasmine.ObjectContaining to Partial', + input: `let myMatcher: jasmine.ObjectContaining;`, + expected: `let myMatcher: Partial;`, + }, + { + description: 'should transform jasmine.ObjectContaining to object', + input: `let myMatcher: jasmine.ObjectContaining;`, + expected: `let myMatcher: object;`, + }, + { + description: 'should transform jasmine.DoneFn to () => void', + input: `let myDoneFn: jasmine.DoneFn;`, + expected: `let myDoneFn: () => void;`, + }, + ]; + + testCases.forEach(({ description, input, expected }) => { + it(description, async () => { + await expectTransformation(input, expected); + }); + }); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/ast-helpers.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/ast-helpers.ts new file mode 100644 index 000000000000..f6f363df1643 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/ast-helpers.ts @@ -0,0 +1,94 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; + +export function addVitestValueImport(imports: Set, importName: string): void { + imports.add(importName); +} + +export function addVitestTypeImport(imports: Set, importName: string): void { + imports.add(importName); +} + +export function getVitestAutoImports( + valueImports: Set, + typeImports: Set, +): ts.ImportDeclaration | undefined { + if (valueImports.size === 0 && typeImports.size === 0) { + return undefined; + } + + const isClauseTypeOnly = valueImports.size === 0 && typeImports.size > 0; + const allSpecifiers: ts.ImportSpecifier[] = []; + + // Add value imports + for (const i of [...valueImports].sort()) { + allSpecifiers.push( + ts.factory.createImportSpecifier(false, undefined, ts.factory.createIdentifier(i)), + ); + } + + // Add type imports + for (const i of [...typeImports].sort()) { + // Only set isTypeOnly on individual specifiers if the clause itself is NOT type-only + allSpecifiers.push( + ts.factory.createImportSpecifier( + !isClauseTypeOnly, + undefined, + ts.factory.createIdentifier(i), + ), + ); + } + + allSpecifiers.sort((a, b) => a.name.text.localeCompare(b.name.text)); + + const importClause = ts.factory.createImportClause( + isClauseTypeOnly, // Set isTypeOnly on the clause if only type imports + undefined, + ts.factory.createNamedImports(allSpecifiers), + ); + + return ts.factory.createImportDeclaration( + undefined, + importClause, + ts.factory.createStringLiteral('vitest'), + ); +} + +export function createViCallExpression( + methodName: string, + args: readonly ts.Expression[] = [], + typeArgs: ts.TypeNode[] | undefined = undefined, +): ts.CallExpression { + const callee = ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier('vi'), + methodName, + ); + + return ts.factory.createCallExpression(callee, typeArgs, args); +} + +export function createExpectCallExpression( + args: ts.Expression[], + typeArgs: ts.TypeNode[] | undefined = undefined, +): ts.CallExpression { + return ts.factory.createCallExpression(ts.factory.createIdentifier('expect'), typeArgs, args); +} + +export function createPropertyAccess( + expressionOrIndentifierText: ts.Expression | string, + name: string | ts.MemberName, +): ts.PropertyAccessExpression { + return ts.factory.createPropertyAccessExpression( + typeof expressionOrIndentifierText === 'string' + ? ts.factory.createIdentifier(expressionOrIndentifierText) + : expressionOrIndentifierText, + name, + ); +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/ast-validation.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/ast-validation.ts new file mode 100644 index 000000000000..dd16aa750d90 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/ast-validation.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file contains helper functions for validating the structure of + * TypeScript AST nodes, particularly for identifying specific patterns in Jasmine tests. + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; + +/** + * If a node is a `jasmine.method()` call, returns the method name. + * @param node The node to check. + * @returns The name of the method if it's a jasmine call, otherwise undefined. + */ +export function getJasmineMethodName(node: ts.Node): string | undefined { + if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) { + return undefined; + } + + const pae = node.expression; + if (!ts.isIdentifier(pae.expression) || pae.expression.text !== 'jasmine') { + return undefined; + } + + return ts.isIdentifier(pae.name) ? pae.name.text : undefined; +} + +/** + * Checks if a node is a call expression for a specific method on the `jasmine` object. + * @param node The node to check. + * @param methodName The name of the method on the `jasmine` object. + * @returns True if the node is a `jasmine.()` call. + */ +export function isJasmineCallExpression( + node: ts.Node, + methodName: string, +): node is ts.CallExpression { + return getJasmineMethodName(node) === methodName; +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/comment-helpers.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/comment-helpers.ts new file mode 100644 index 000000000000..3f37f9a5a383 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/comment-helpers.ts @@ -0,0 +1,72 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { TODO_NOTES, TodoCategory, TodoContextMap } from './todo-notes'; + +// A helper type to find all `TodoCategory` keys that do not require a context. +type CategoriesWithNoContext = { + [K in TodoCategory]: TodoContextMap[K] extends never ? K : never; +}[TodoCategory]; + +/** + * Adds a TODO comment to a TypeScript node for manual migration. + * This overload handles categories that do not require a context object. + * @param node The AST node to which the comment will be added. + * @param category The category of the TODO, used to look up the message and URL. + */ +export function addTodoComment(node: ts.Node, category: T): void; + +/** + * Adds a TODO comment to a TypeScript node for manual migration. + * This overload handles categories that require a context object, ensuring it is + * provided and correctly typed. + * @param node The AST node to which the comment will be added. + * @param category The category of the TODO, used to look up the message and URL. + * @param context The context object providing dynamic values for the message. + */ +export function addTodoComment( + node: ts.Node, + category: T, + context: TodoContextMap[T], +): void; + +// Implementation that covers both overloads. +export function addTodoComment( + node: ts.Node, + category: TodoCategory, + context?: Record, +): void { + const note = TODO_NOTES[category]; + // The type assertion is safe here because the overloads guarantee the correct context is passed. + const message = + typeof note.message === 'function' ? note.message(context as never) : note.message; + const url = 'url' in note && note.url ? ` See: ${note.url}` : ''; + const commentText = ` TODO: vitest-migration: ${message}${url}`; + + let statement: ts.Node = node; + + // Traverse up the AST to find the containing statement for the node. + // This ensures that the comment is placed before the entire statement, + // rather than being attached to a deeply nested node. For example, if the + // node is an `Identifier`, we want the comment on the `VariableStatement` + // or `ExpressionStatement` that contains it. + while (statement.parent && !ts.isBlock(statement.parent) && !ts.isSourceFile(statement.parent)) { + if (ts.isExpressionStatement(statement) || ts.isVariableStatement(statement)) { + break; + } + statement = statement.parent; + } + + ts.addSyntheticLeadingComment( + statement, + ts.SyntaxKind.SingleLineCommentTrivia, + commentText, + true, + ); +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/comment-helpers_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/comment-helpers_spec.ts new file mode 100644 index 000000000000..50c0093c0208 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/comment-helpers_spec.ts @@ -0,0 +1,68 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { addTodoComment } from './comment-helpers'; + +describe('addTodoComment', () => { + function createTestHarness(sourceText: string) { + const sourceFile = ts.createSourceFile('test.ts', sourceText, ts.ScriptTarget.Latest, true); + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + + return { + sourceFile, + run(node: ts.Node, category: 'pending') { + addTodoComment(node, category); + + return printer.printFile(sourceFile); + }, + }; + } + + it('should add a comment before the containing ExpressionStatement', () => { + const sourceText = `myFunction();`; + const { sourceFile, run } = createTestHarness(sourceText); + const callExpression = (sourceFile.statements[0] as ts.ExpressionStatement).expression; + + const result = run(callExpression, 'pending'); + + expect(result).toContain( + '// TODO: vitest-migration: The pending() function was converted to a skipped test (`it.skip`). See: https://vitest.dev/api/vi.html#it-skip', + ); + expect(result.trim().startsWith('// TODO')).toBe(true); + }); + + it('should find the top-level statement for a deeply nested node', () => { + const sourceText = `const result = myObject.prop.method();`; + const { sourceFile, run } = createTestHarness(sourceText); + + // Get a deeply nested identifier + const varDeclaration = (sourceFile.statements[0] as ts.VariableStatement).declarationList + .declarations[0]; + const methodIdentifier = ( + (varDeclaration.initializer as ts.CallExpression).expression as ts.PropertyAccessExpression + ).name; + + const result = run(methodIdentifier, 'pending'); + + expect(result.trim().startsWith('// TODO')).toBe(true); + expect(result).toContain('const result = myObject.prop.method()'); + }); + + it('should add a comment before a VariableStatement', () => { + const sourceText = `const mySpy = jasmine.createSpy();`; + const { sourceFile, run } = createTestHarness(sourceText); + const varDeclaration = (sourceFile.statements[0] as ts.VariableStatement).declarationList + .declarations[0]; + + const result = run(varDeclaration, 'pending'); + + expect(result.trim().startsWith('// TODO')).toBe(true); + expect(result).toContain('const mySpy = jasmine.createSpy()'); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-context.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-context.ts new file mode 100644 index 000000000000..a7e705a83ce5 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-context.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { RefactorReporter } from './refactor-reporter'; + +/** + * A context object that provides access to shared utilities and state + * throughout the transformation process. + */ +export interface RefactorContext { + /** The root ts.SourceFile node of the file being transformed. */ + readonly sourceFile: ts.SourceFile; + + /** The reporter for logging changes and TODOs. */ + readonly reporter: RefactorReporter; + + /** The official context from the TypeScript Transformer API. */ + readonly tsContext: ts.TransformationContext; + + /** A set of Vitest value imports to be added to the file. */ + readonly pendingVitestValueImports: Set; + + /** A set of Vitest type imports to be added to the file. */ + readonly pendingVitestTypeImports: Set; +} + +/** + * A generic transformer function that operates on a specific type of ts.Node. + * @template T The specific type of AST node this transformer works on (e.g., ts.CallExpression). + */ +export type NodeTransformer = ( + node: T, + refactorCtx: RefactorContext, +) => ts.Node | readonly ts.Node[]; diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-reporter.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-reporter.ts new file mode 100644 index 000000000000..63b924d12139 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-reporter.ts @@ -0,0 +1,164 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { TodoCategory } from './todo-notes'; + +export class RefactorReporter { + private filesScanned = 0; + private filesTransformed = 0; + private readonly todos = new Map(); + private readonly verboseLogs = new Map(); + private readonly fileTodos = new Map(); + + constructor(private logger: { info(message: string): void; warn(message: string): void }) {} + + get hasTodos(): boolean { + return this.todos.size > 0; + } + + incrementScannedFiles(): void { + this.filesScanned++; + } + + incrementTransformedFiles(): void { + this.filesTransformed++; + } + + recordTodo(category: TodoCategory, sourceFile: ts.SourceFile, node: ts.Node): void { + this.todos.set(category, (this.todos.get(category) ?? 0) + 1); + + const { line } = ts.getLineAndCharacterOfPosition( + sourceFile, + ts.getOriginalNode(node).getStart(sourceFile), + ); + const filePath = sourceFile.fileName; + + let fileTodos = this.fileTodos.get(filePath); + if (!fileTodos) { + fileTodos = []; + this.fileTodos.set(filePath, fileTodos); + } + fileTodos.push({ category, line: line + 1 }); + } + + reportTransformation(sourceFile: ts.SourceFile, node: ts.Node, message: string): void { + const { line } = ts.getLineAndCharacterOfPosition( + sourceFile, + ts.getOriginalNode(node).getStart(sourceFile), + ); + const filePath = sourceFile.fileName; + + let logs = this.verboseLogs.get(filePath); + if (!logs) { + logs = []; + this.verboseLogs.set(filePath, logs); + } + logs.push(`L${line + 1}: ${message}`); + } + + generateReportContent(): string { + const lines: string[] = []; + lines.push('# Jasmine to Vitest Refactoring Report'); + lines.push(''); + lines.push(`Date: ${new Date().toISOString()}`); + lines.push(''); + + const summaryEntries = [ + { label: 'Files Scanned', value: this.filesScanned }, + { label: 'Files Transformed', value: this.filesTransformed }, + { label: 'Files Skipped', value: this.filesScanned - this.filesTransformed }, + { label: 'Total TODOs', value: [...this.todos.values()].reduce((a, b) => a + b, 0) }, + ]; + + const firstColPad = Math.max(...summaryEntries.map(({ label }) => label.length)); + const secondColPad = 5; + + lines.push('## Summary'); + lines.push(''); + lines.push(`| ${' '.padEnd(firstColPad)} | ${'Count'.padStart(secondColPad)} |`); + lines.push(`|:${'-'.repeat(firstColPad + 1)}|${'-'.repeat(secondColPad + 1)}:|`); + for (const { label, value } of summaryEntries) { + lines.push(`| ${label.padEnd(firstColPad)} | ${String(value).padStart(secondColPad)} |`); + } + lines.push(''); + + if (this.todos.size > 0) { + lines.push('## TODO Overview'); + lines.push(''); + const todoEntries = [...this.todos.entries()]; + const firstColPad = Math.max( + 'Category'.length, + ...todoEntries.map(([category]) => category.length), + ); + const secondColPad = 5; + + lines.push(`| ${'Category'.padEnd(firstColPad)} | ${'Count'.padStart(secondColPad)} |`); + lines.push(`|:${'-'.repeat(firstColPad + 1)}|${'-'.repeat(secondColPad + 1)}:|`); + for (const [category, count] of todoEntries) { + lines.push(`| ${category.padEnd(firstColPad)} | ${String(count).padStart(secondColPad)} |`); + } + lines.push(''); + } + + if (this.fileTodos.size > 0) { + lines.push('## Files Requiring Manual Attention'); + lines.push(''); + // Sort files alphabetically + const sortedFiles = [...this.fileTodos.keys()].sort(); + + for (const filePath of sortedFiles) { + const relativePath = filePath.startsWith('/') ? filePath.substring(1) : filePath; + lines.push(`### [\`${relativePath}\`](./${relativePath})`); + const todos = this.fileTodos.get(filePath); + if (todos) { + // Sort todos by line number + todos.sort((a, b) => a.line - b.line); + + for (const todo of todos) { + lines.push(`- [L${todo.line}](./${relativePath}#L${todo.line}): ${todo.category}`); + } + } + lines.push(''); + } + } else { + lines.push('## No Manual Changes Required'); + lines.push(''); + lines.push('All identified patterns were successfully transformed.'); + } + + return lines.join('\n'); + } + + printSummary(verbose = false): void { + if (verbose && this.verboseLogs.size > 0) { + this.logger.info('Detailed Transformation Log:'); + for (const [filePath, logs] of this.verboseLogs) { + this.logger.info(`Processing: ${filePath}`); + logs.forEach((log) => this.logger.info(` - ${log}`)); + } + this.logger.info(''); // Add a blank line for separation + } + + this.logger.info('Jasmine to Vitest Refactoring Summary:'); + this.logger.info(`- ${this.filesScanned} test file(s) scanned.`); + this.logger.info(`- ${this.filesTransformed} file(s) transformed.`); + const filesSkipped = this.filesScanned - this.filesTransformed; + if (filesSkipped > 0) { + this.logger.info(`- ${filesSkipped} file(s) skipped (no changes needed).`); + } + + if (this.todos.size > 0) { + const totalTodos = [...this.todos.values()].reduce((a, b) => a + b, 0); + this.logger.warn(`- ${totalTodos} TODO(s) added for manual review:`); + for (const [category, count] of this.todos) { + this.logger.warn(` - ${count}x ${category}`); + } + } + } +} diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-reporter_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-reporter_spec.ts new file mode 100644 index 000000000000..184dca31f9c7 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/refactor-reporter_spec.ts @@ -0,0 +1,77 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { logging } from '@angular-devkit/core'; +import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { RefactorReporter } from './refactor-reporter'; + +describe('RefactorReporter', () => { + let logger: logging.LoggerApi; + let reporter: RefactorReporter; + let sourceFile: ts.SourceFile; + let node: ts.Node; + + beforeEach(() => { + logger = { + info: jasmine.createSpy('info'), + warn: jasmine.createSpy('warn'), + } as unknown as logging.LoggerApi; + reporter = new RefactorReporter(logger); + sourceFile = ts.createSourceFile('/test.spec.ts', 'statement;', ts.ScriptTarget.Latest); + node = sourceFile.statements[0]; + }); + + it('should correctly increment scanned and transformed files', () => { + reporter.incrementScannedFiles(); + reporter.incrementScannedFiles(); + reporter.incrementTransformedFiles(); + reporter.printSummary(); + + expect(logger.info).toHaveBeenCalledWith('Jasmine to Vitest Refactoring Summary:'); + expect(logger.info).toHaveBeenCalledWith('- 2 test file(s) scanned.'); + expect(logger.info).toHaveBeenCalledWith('- 1 file(s) transformed.'); + expect(logger.info).toHaveBeenCalledWith('- 1 file(s) skipped (no changes needed).'); + }); + + it('should record and count todos by category', () => { + reporter.recordTodo('pending', sourceFile, node); + reporter.recordTodo('spyOnAllFunctions', sourceFile, node); + reporter.recordTodo('pending', sourceFile, node); + reporter.printSummary(); + + expect(logger.warn).toHaveBeenCalledWith('- 3 TODO(s) added for manual review:'); + expect(logger.warn).toHaveBeenCalledWith(' - 2x pending'); + expect(logger.warn).toHaveBeenCalledWith(' - 1x spyOnAllFunctions'); + }); + + it('should not print the todos section if none were recorded', () => { + reporter.printSummary(); + expect(logger.warn).not.toHaveBeenCalled(); + }); + + it('should generate a markdown report with TODOs', () => { + reporter.incrementScannedFiles(); + reporter.recordTodo('pending', sourceFile, node); + + const report = reporter.generateReportContent(); + + expect(report).toContain('# Jasmine to Vitest Refactoring Report'); + expect(report).toContain('## Summary'); + expect(report).toContain('| | Count |'); + expect(report).toContain('|:------------------|------:|'); + expect(report).toContain('| Files Scanned | 1 |'); + expect(report).toContain('| Total TODOs | 1 |'); + expect(report).toContain('## TODO Overview'); + expect(report).toContain('| Category | Count |'); + expect(report).toContain('|:---------|------:|'); + expect(report).toContain('| pending | 1 |'); + expect(report).toContain('## Files Requiring Manual Attention'); + expect(report).toContain('### [`test.spec.ts`](./test.spec.ts)'); + expect(report).toContain('- [L1](./test.spec.ts#L1): pending'); + }); +}); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/utils/todo-notes.ts b/packages/schematics/angular/refactor/jasmine-vitest/utils/todo-notes.ts new file mode 100644 index 000000000000..8a9d888a0298 --- /dev/null +++ b/packages/schematics/angular/refactor/jasmine-vitest/utils/todo-notes.ts @@ -0,0 +1,159 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +/** + * @fileoverview This file is the single source of truth for all "TODO" notes + * generated by the Jasmine to Vitest schematic. + * + * It defines the `TODO_NOTES` constant, which contains the message and optional + * documentation URL for each category of manual migration task. + * + * The file also exports advanced mapped types (`TodoCategory`, `TodoContextMap`) + * that are inferred directly from the `TODO_NOTES` object. This creates a + * maintainable, type-safe system that ensures consistency across all + * transformers and prevents runtime errors. + */ + +/** + * The central configuration for all "TODO" notes. Each key represents a unique + * `TodoCategory`. + * + * Each entry is an object with: + * - `message`: A string or a function that returns a string. If it's a function, + * it receives a `context` object to generate a dynamic message. + * - `url`: An optional documentation URL that will be appended to the message. + */ +export const TODO_NOTES = { + 'pending': { + message: 'The pending() function was converted to a skipped test (`it.skip`).', + url: 'https://vitest.dev/api/vi.html#it-skip', + }, + 'toHaveSpyInteractions': { + message: + 'Unsupported matcher ".toHaveSpyInteractions()" found. ' + + 'Please migrate this manually by checking the `mock.calls.length` of the individual spies.', + }, + 'toThrowMatching': { + message: (context: { name: string }): string => + `Unsupported matcher ".${context.name}()" found. Please migrate this manually.`, + url: 'https://vitest.dev/api/expect.html#tothrowerror', + }, + 'toBePending': { + message: + 'Unsupported matcher ".toBePending()" found. Vitest does not have a direct equivalent. ' + + 'Please migrate this manually, for example by using `Promise.race` to check if the promise settles within a short timeout.', + }, + 'unsupported-expect-async-matcher': { + message: (context: { name: string }): string => + `Unsupported expectAsync matcher ".${context.name}()" found. Please migrate this manually.`, + }, + 'arrayWithExactContents-dynamic-variable': { + message: + 'Cannot transform jasmine.arrayWithExactContents with a dynamic variable. Please migrate this manually.', + }, + 'arrayWithExactContents-check': { + message: + "Verify this matches strict array content (multiset equality). Vitest's arrayContaining is a subset check.", + }, + 'expect-nothing': { + message: + 'expect().nothing() has been removed because it is redundant in Vitest. Tests without assertions pass by default.', + }, + 'unsupported-global-function': { + message: (context: { name: string }): string => + `Unsupported global function \`${context.name}\` found. This function is used for custom reporters in Jasmine ` + + 'and has no direct equivalent in Vitest.', + }, + 'addMatchers': { + message: 'jasmine.addMatchers is not supported. Please manually migrate to expect.extend().', + url: 'https://vitest.dev/api/expect.html#expect-extend', + }, + 'addCustomEqualityTester': { + message: + 'jasmine.addCustomEqualityTester is not supported. Please manually migrate to expect.addEqualityTesters().', + url: 'https://vitest.dev/api/expect.html#expect-addequalitytesters', + }, + 'mapContaining': { + message: + 'jasmine.mapContaining is not supported. Vitest does not have a built-in matcher for Maps.' + + ' Please manually assert the contents of the Map.', + }, + 'setContaining': { + message: + 'jasmine.setContaining is not supported. Vitest does not have a built-in matcher for Sets.' + + ' Please manually assert the contents of the Set.', + }, + 'unknown-jasmine-property': { + message: (context: { name: string }): string => + `Unsupported jasmine property "${context.name}" found. Please migrate this manually.`, + }, + 'spyOnAllFunctions': { + message: + 'Vitest does not have a direct equivalent for jasmine.spyOnAllFunctions().' + + ' Please spy on individual methods manually using vi.spyOn().', + url: 'https://vitest.dev/api/vi.html#vi-spyon', + }, + 'createSpyObj-single-argument': { + message: + 'jasmine.createSpyObj called with a single argument is not supported for transformation.', + url: 'https://vitest.dev/api/vi.html#vi-fn', + }, + 'createSpyObj-dynamic-variable': { + message: + 'Cannot transform jasmine.createSpyObj with a dynamic variable. Please migrate this manually.', + url: 'https://vitest.dev/api/vi.html#vi-fn', + }, + 'createSpyObj-dynamic-property-map': { + message: + 'Cannot transform jasmine.createSpyObj with a dynamic property map. Please migrate this manually.', + url: 'https://vitest.dev/api/vi.html#vi-fn', + }, + 'unsupported-spy-strategy': { + message: (context: { name: string }): string => + `Unsupported spy strategy ".and.${context.name}()" found. Please migrate this manually.`, + url: 'https://vitest.dev/api/mocked.html#mock', + }, + 'mostRecent-without-args': { + message: + 'Direct usage of mostRecent() is not supported.' + + ' Please refactor to access .args directly or use vi.mocked(spy).mock.lastCall.', + url: 'https://vitest.dev/api/mocked.html#mock-lastcall', + }, + 'unhandled-done-usage': { + message: "The 'done' callback was used in an unhandled way. Please migrate manually.", + }, +} as const; + +/** + * A union type of all possible "TODO" categories. + * It is derived from the keys of the `TODO_NOTES` object to ensure that only + * valid categories can be used throughout the transformers. + */ +export type TodoCategory = keyof typeof TODO_NOTES; + +/** + * A mapped type that creates a map from a `TodoCategory` to the type of the + * context object that its message function expects. This provides strong type + * safety for calls to `addTodoComment`. + * + * It works by checking if the `message` property for a given category is a + * function. If it is, it uses `infer` to extract the type of the first + * parameter (`P`). If it's not a function, it resolves to `never`. + * + * @example + * // `Context` will be `{ name: string }` + * type Context = TodoContextMap['unknown-jasmine-property']; + * + * // `Context` will be `never` + * type Context = TodoContextMap['pending']; + */ +export type TodoContextMap = { + [K in TodoCategory]: (typeof TODO_NOTES)[K]['message'] extends (context: infer P) => string + ? P + : never; +}; diff --git a/packages/schematics/angular/server/files/application-builder/standalone-src/main.server.ts.template b/packages/schematics/angular/server/files/application-builder/standalone-src/main.server.ts.template index bc0b6ba59758..cbe62e1fd0ad 100644 --- a/packages/schematics/angular/server/files/application-builder/standalone-src/main.server.ts.template +++ b/packages/schematics/angular/server/files/application-builder/standalone-src/main.server.ts.template @@ -1,7 +1,8 @@ -import { bootstrapApplication } from '@angular/platform-browser'; +import { BootstrapContext, bootstrapApplication } from '@angular/platform-browser'; import { <%= appComponentName %> } from '<%= appComponentPath %>'; import { config } from './app/app.config.server'; -const bootstrap = () => bootstrapApplication(<%= appComponentName %>, config); +const bootstrap = (context: BootstrapContext) => + bootstrapApplication(<%= appComponentName %>, config, context); export default bootstrap; diff --git a/packages/schematics/angular/server/files/server-builder/standalone-src/main.server.ts.template b/packages/schematics/angular/server/files/server-builder/standalone-src/main.server.ts.template index bc0b6ba59758..cbe62e1fd0ad 100644 --- a/packages/schematics/angular/server/files/server-builder/standalone-src/main.server.ts.template +++ b/packages/schematics/angular/server/files/server-builder/standalone-src/main.server.ts.template @@ -1,7 +1,8 @@ -import { bootstrapApplication } from '@angular/platform-browser'; +import { BootstrapContext, bootstrapApplication } from '@angular/platform-browser'; import { <%= appComponentName %> } from '<%= appComponentPath %>'; import { config } from './app/app.config.server'; -const bootstrap = () => bootstrapApplication(<%= appComponentName %>, config); +const bootstrap = (context: BootstrapContext) => + bootstrapApplication(<%= appComponentName %>, config, context); export default bootstrap; diff --git a/packages/schematics/angular/server/index.ts b/packages/schematics/angular/server/index.ts index 50f624e078cd..077114e9027d 100644 --- a/packages/schematics/angular/server/index.ts +++ b/packages/schematics/angular/server/index.ts @@ -9,6 +9,7 @@ import { JsonValue, Path, basename, dirname, join, normalize } from '@angular-devkit/core'; import { Rule, + RuleFactory, SchematicsException, Tree, apply, @@ -16,6 +17,7 @@ import { chain, mergeWith, move, + noop, strings, url, } from '@angular-devkit/schematics'; @@ -26,10 +28,11 @@ import { JSONFile } from '../utility/json-file'; import { latestVersions } from '../utility/latest-versions'; import { isStandaloneApp } from '../utility/ng-ast-utils'; import { relativePathToWorkspaceRoot } from '../utility/paths'; +import { createProjectSchematic } from '../utility/project'; import { isUsingApplicationBuilder, targetBuildNotFoundError } from '../utility/project-targets'; import { resolveBootstrappedComponentData } from '../utility/standalone/app_component'; import { getMainFilePath } from '../utility/standalone/util'; -import { getWorkspace, updateWorkspace } from '../utility/workspace'; +import { updateWorkspace } from '../utility/workspace'; import { Builders } from '../utility/workspace-models'; import { Schema as ServerOptions } from './schema'; @@ -119,6 +122,14 @@ function updateConfigFileApplicationBuilder(options: ServerOptions): Rule { function updateTsConfigFile(tsConfigPath: string): Rule { return (host: Tree) => { const json = new JSONFile(host, tsConfigPath); + // Skip adding the files entry if the server entry would already be included. + const include = json.get(['include']); + if (!Array.isArray(include) || !include.includes('src/**/*.ts')) { + const filesPath = ['files']; + const files = new Set((json.get(filesPath) as string[] | undefined) ?? []); + files.add('src/' + serverMainEntryName); + json.modify(filesPath, [...files]); + } const typePath = ['compilerOptions', 'types']; const types = new Set((json.get(typePath) as string[] | undefined) ?? []); @@ -153,39 +164,39 @@ function addDependencies(skipInstall: boolean | undefined): Rule { }; } -export default function (options: ServerOptions): Rule { - return async (host: Tree) => { - const workspace = await getWorkspace(host); - const clientProject = workspace.projects.get(options.project); - if (clientProject?.extensions.projectType !== 'application') { +const serverSchematic: RuleFactory = createProjectSchematic( + async (options, { project, tree }) => { + if (project?.extensions.projectType !== 'application') { throw new SchematicsException(`Server schematic requires a project type of "application".`); } - const clientBuildTarget = clientProject.targets.get('build'); + const clientBuildTarget = project.targets.get('build'); if (!clientBuildTarget) { throw targetBuildNotFoundError(); } - const usingApplicationBuilder = isUsingApplicationBuilder(clientProject); + const usingApplicationBuilder = isUsingApplicationBuilder(project); if ( - clientProject.targets.has('server') || + project.targets.has('server') || (usingApplicationBuilder && clientBuildTarget.options?.server !== undefined) ) { // Server has already been added. - return; + return noop(); } const clientBuildOptions = clientBuildTarget.options as Record; - const browserEntryPoint = await getMainFilePath(host, options.project); - const isStandalone = isStandaloneApp(host, browserEntryPoint); - const sourceRoot = clientProject.sourceRoot ?? join(normalize(clientProject.root), 'src'); + const browserEntryPoint = await getMainFilePath(tree, options.project); + const isStandalone = isStandaloneApp(tree, browserEntryPoint); + const sourceRoot = project.sourceRoot ?? join(normalize(project.root), 'src'); - let filesUrl = `./files/${usingApplicationBuilder ? 'application-builder/' : 'server-builder/'}`; + let filesUrl = `./files/${ + usingApplicationBuilder ? 'application-builder/' : 'server-builder/' + }`; filesUrl += isStandalone ? 'standalone-src' : 'ngmodule-src'; const { componentName, componentImportPathInSameFile, moduleName, moduleImportPathInSameFile } = - resolveBootstrappedComponentData(host, browserEntryPoint) || { + resolveBootstrappedComponentData(tree, browserEntryPoint) || { componentName: 'App', componentImportPathInSameFile: './app/app', moduleName: 'AppModule', @@ -225,7 +236,7 @@ export default function (options: ServerOptions): Rule { ...options, stripTsExtension: (s: string) => s.replace(/\.ts$/, ''), tsConfigExtends, - hasLocalizePackage: !!getPackageJsonDependency(host, '@angular/localize'), + hasLocalizePackage: !!getPackageJsonDependency(tree, '@angular/localize'), relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(tsConfigDirectory), }), move(tsConfigDirectory), @@ -243,5 +254,7 @@ export default function (options: ServerOptions): Rule { )}())`, ), ]); - }; -} + }, +); + +export default serverSchematic; diff --git a/packages/schematics/angular/server/index_spec.ts b/packages/schematics/angular/server/index_spec.ts index f3e5e277d8ef..2d86b83ddfff 100644 --- a/packages/schematics/angular/server/index_spec.ts +++ b/packages/schematics/angular/server/index_spec.ts @@ -201,7 +201,7 @@ describe('Server Schematic', () => { const filePath = '/projects/bar/src/main.server.ts'; expect(tree.exists(filePath)).toBeTrue(); const contents = tree.readContent(filePath); - expect(contents).toContain(`bootstrapApplication(App, config)`); + expect(contents).toContain(`bootstrapApplication(App, config, context)`); }); it('should account for renamed app component', async () => { @@ -212,7 +212,7 @@ describe('Server Schematic', () => { import { appConfig } from './app/app.config'; import { MyCustomApp } from './foo/bar/baz/app.foo'; - bootstrapApplication(MyCustomApp, appConfig) + bootstrapApplication(MyCustomApp, appConfig, context) .catch((err) => console.error(err)); `, ); @@ -222,7 +222,7 @@ describe('Server Schematic', () => { expect(tree.exists(filePath)).toBeTrue(); const contents = tree.readContent(filePath); expect(contents).toContain(`import { MyCustomApp } from './foo/bar/baz/app.foo';`); - expect(contents).toContain(`bootstrapApplication(MyCustomApp, config)`); + expect(contents).toContain(`bootstrapApplication(MyCustomApp, config, context)`); }); it('should account for renamed app component that is aliased within the main file', async () => { @@ -243,7 +243,7 @@ describe('Server Schematic', () => { expect(tree.exists(filePath)).toBeTrue(); const contents = tree.readContent(filePath); expect(contents).toContain(`import { MyCustomApp } from './foo/bar/baz/app.foo';`); - expect(contents).toContain(`bootstrapApplication(MyCustomApp, config)`); + expect(contents).toContain(`bootstrapApplication(MyCustomApp, config, context)`); }); it('should create server app config file', async () => { @@ -269,7 +269,7 @@ describe('Server Schematic', () => { build.builder = Builders.Browser; build.options = { ...build.options, - main: build.options.browser, + main: 'projects/bar/src/main.ts', browser: undefined, }; diff --git a/packages/schematics/angular/service-worker/index.ts b/packages/schematics/angular/service-worker/index.ts index e32969d9d0c6..4ef2c9839def 100644 --- a/packages/schematics/angular/service-worker/index.ts +++ b/packages/schematics/angular/service-worker/index.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { join, normalize, tags } from '@angular-devkit/core'; import { Rule, + RuleFactory, SchematicContext, SchematicsException, Tree, @@ -19,22 +19,24 @@ import { move, url, } from '@angular-devkit/schematics'; -import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript'; -import { addDependency, addRootProvider, readWorkspace, writeWorkspace } from '../utility'; +import { join } from 'node:path/posix'; +import ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { addDependency, addRootProvider, writeWorkspace } from '../utility'; import { addSymbolToNgModuleMetadata, insertImport } from '../utility/ast-utils'; import { applyToUpdateRecorder } from '../utility/change'; -import { getPackageJsonDependency } from '../utility/dependencies'; +import { getDependency } from '../utility/dependency'; import { getAppModulePath, isStandaloneApp } from '../utility/ng-ast-utils'; import { relativePathToWorkspaceRoot } from '../utility/paths'; +import { createProjectSchematic } from '../utility/project'; import { targetBuildNotFoundError } from '../utility/project-targets'; import { findAppConfig } from '../utility/standalone/app_config'; -import { findBootstrapApplicationCall } from '../utility/standalone/util'; +import { findBootstrapApplicationCall, getMainFilePath } from '../utility/standalone/util'; import { Builders } from '../utility/workspace-models'; import { Schema as ServiceWorkerOptions } from './schema'; function addDependencies(): Rule { return (host: Tree) => { - const coreDep = getPackageJsonDependency(host, '@angular/core'); + const coreDep = getDependency(host, '@angular/core'); if (!coreDep) { throw new SchematicsException('Could not find "@angular/core" version.'); } @@ -54,7 +56,7 @@ function updateAppModule(mainPath: string): Rule { addImport(host, modulePath, 'isDevMode', '@angular/core'); // register SW in application module - const importText = tags.stripIndent` + const importText = ` ServiceWorkerModule.register('ngsw-worker.js', { enabled: !isDevMode(), // Register the ServiceWorker as soon as the application is stable @@ -103,13 +105,8 @@ function getTsSourceFile(host: Tree, path: string): ts.SourceFile { return source; } -export default function (options: ServiceWorkerOptions): Rule { - return async (host: Tree) => { - const workspace = await readWorkspace(host); - const project = workspace.projects.get(options.project); - if (!project) { - throw new SchematicsException(`Invalid project name (${options.project})`); - } +const serviceWorkerSchematic: RuleFactory = createProjectSchematic( + async (options, { project, workspace, tree }) => { if (project.extensions.projectType !== 'application') { throw new SchematicsException(`Service worker requires a project type of "application".`); } @@ -119,25 +116,23 @@ export default function (options: ServiceWorkerOptions): Rule { } const buildOptions = buildTarget.options as Record; - let browserEntryPoint: string | undefined; - const ngswConfigPath = join(normalize(project.root), 'ngsw-config.json'); + const browserEntryPoint = await getMainFilePath(tree, options.project); + const ngswConfigPath = join(project.root, 'ngsw-config.json'); if ( buildTarget.builder === Builders.Application || buildTarget.builder === Builders.BuildApplication ) { - browserEntryPoint = buildOptions.browser as string; const productionConf = buildTarget.configurations?.production; if (productionConf) { productionConf.serviceWorker = ngswConfigPath; } } else { - browserEntryPoint = buildOptions.main as string; buildOptions.serviceWorker = true; buildOptions.ngswConfigPath = ngswConfigPath; } - await writeWorkspace(host, workspace); + await writeWorkspace(tree, workspace); return chain([ addDependencies(), @@ -150,12 +145,14 @@ export default function (options: ServiceWorkerOptions): Rule { move(project.root), ]), ), - isStandaloneApp(host, browserEntryPoint) + isStandaloneApp(tree, browserEntryPoint) ? addProvideServiceWorker(options.project, browserEntryPoint) : updateAppModule(browserEntryPoint), ]); - }; -} + }, +); + +export default serviceWorkerSchematic; function addImport(host: Tree, filePath: string, symbolName: string, moduleName: string): void { const moduleSource = getTsSourceFile(host, filePath); diff --git a/packages/schematics/angular/service-worker/index_spec.ts b/packages/schematics/angular/service-worker/index_spec.ts index e9ec677f44ba..2fd7a08c4714 100644 --- a/packages/schematics/angular/service-worker/index_spec.ts +++ b/packages/schematics/angular/service-worker/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { tags } from '@angular-devkit/core'; import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; import { Schema as ApplicationOptions } from '../application/schema'; import { Builders } from '../utility/workspace-models'; @@ -127,19 +126,16 @@ describe('Service Worker Schematic', () => { it(`should add the 'provideServiceWorker' to providers`, async () => { const tree = await schematicRunner.runSchematic('service-worker', defaultOptions, appTree); const content = tree.readContent('/projects/bar/src/app/app.config.ts'); - expect(tags.oneLine`${content}`).toContain(tags.oneLine` - provideServiceWorker('ngsw-worker.js', { - enabled: !isDevMode(), - registrationStrategy: 'registerWhenStable:30000' - }) - `); + expect(content.replace(/\s/g, '')).toContain( + `provideServiceWorker('ngsw-worker.js',{enabled:!isDevMode(),registrationStrategy:'registerWhenStable:30000'})`, + ); }); it(`should import 'isDevMode' from '@angular/core'`, async () => { const tree = await schematicRunner.runSchematic('service-worker', defaultOptions, appTree); const content = tree.readContent('/projects/bar/src/app/app.config.ts'); expect(content).toContain( - `import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection, isDevMode } from '@angular/core';`, + `import { ApplicationConfig, provideBrowserGlobalErrorListeners, isDevMode } from '@angular/core';`, ); }); @@ -203,7 +199,7 @@ describe('Service Worker Schematic', () => { build.builder = Builders.Browser; build.options = { ...build.options, - main: build.options.browser, + main: 'projects/bar/src/main.ts', browser: undefined, }; diff --git a/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.spec.ts.template b/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.spec.ts.template index a57a4e043b4b..168bb9ef23f2 100644 --- a/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.spec.ts.template +++ b/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.spec.ts.template @@ -1,13 +1,13 @@ import { TestBed } from '@angular/core/testing'; -import { <%= classify(name) %><%= classify(type) %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>'; +import { <%= classifiedName %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type) : '' %>'; -describe('<%= classify(name) %><%= classify(type) %>', () => { - let service: <%= classify(name) %><%= classify(type) %>; +describe('<%= classifiedName %>', () => { + let service: <%= classifiedName %>; beforeEach(() => { TestBed.configureTestingModule({}); - service = TestBed.inject(<%= classify(name) %><%= classify(type) %>); + service = TestBed.inject(<%= classifiedName %>); }); it('should be created', () => { diff --git a/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.ts.template b/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.ts.template index ad3685368077..de24346572c2 100644 --- a/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.ts.template +++ b/packages/schematics/angular/service/files/__name@dasherize__.__type@dasherize__.ts.template @@ -1,9 +1,8 @@ import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) -export class <%= classify(name) %><%= classify(type) %> { - - constructor() { } +export class <%= classifiedName %> { + } diff --git a/packages/schematics/angular/service/index.ts b/packages/schematics/angular/service/index.ts index 640661a2addc..7805e78cc823 100644 --- a/packages/schematics/angular/service/index.ts +++ b/packages/schematics/angular/service/index.ts @@ -6,10 +6,34 @@ * found in the LICENSE file at https://angular.dev/license */ -import { Rule } from '@angular-devkit/schematics'; +import { RuleFactory, strings } from '@angular-devkit/schematics'; import { generateFromFiles } from '../utility/generate-from-files'; +import { parseName } from '../utility/parse-name'; +import { createProjectSchematic } from '../utility/project'; +import { validateClassName } from '../utility/validation'; +import { buildDefaultPath } from '../utility/workspace'; import { Schema as ServiceOptions } from './schema'; -export default function (options: ServiceOptions): Rule { - return generateFromFiles(options); -} +const serviceSchematic: RuleFactory = createProjectSchematic( + (options, { project, tree }) => { + if (options.path === undefined) { + options.path = buildDefaultPath(project); + } + + const parsedPath = parseName(options.path, options.name); + options.name = parsedPath.name; + options.path = parsedPath.path; + + const classifiedName = + strings.classify(options.name) + + (options.addTypeToClassName && options.type ? strings.classify(options.type) : ''); + validateClassName(classifiedName); + + return generateFromFiles({ + ...options, + classifiedName, + }); + }, +); + +export default serviceSchematic; diff --git a/packages/schematics/angular/service/index_spec.ts b/packages/schematics/angular/service/index_spec.ts index b5a6856e1504..56ae5edd2428 100644 --- a/packages/schematics/angular/service/index_spec.ts +++ b/packages/schematics/angular/service/index_spec.ts @@ -55,7 +55,7 @@ describe('Service Schematic', () => { const tree = await schematicRunner.runSchematic('service', options, appTree); const content = tree.readContent('/projects/bar/src/app/foo/foo.ts'); - expect(content).toMatch(/providedIn: 'root'/); + expect(content).toMatch(/providedIn: 'root',/); }); it('should respect the skipTests flag', async () => { @@ -92,4 +92,33 @@ describe('Service Schematic', () => { expect(content).toContain('export class Foo'); expect(testContent).toContain("describe('Foo'"); }); + + it('should not add type to class name when addTypeToClassName is false', async () => { + const options = { ...defaultOptions, type: 'Service', addTypeToClassName: false }; + const tree = await schematicRunner.runSchematic('service', options, appTree); + const content = tree.readContent('/projects/bar/src/app/foo/foo.service.ts'); + const testContent = tree.readContent('/projects/bar/src/app/foo/foo.service.spec.ts'); + expect(content).toContain('export class Foo {'); + expect(content).not.toContain('export class FooService {'); + expect(testContent).toContain("describe('Foo', () => {"); + expect(testContent).not.toContain("describe('FooService', () => {"); + }); + + it('should add type to class name when addTypeToClassName is true', async () => { + const options = { ...defaultOptions, type: 'Service', addTypeToClassName: true }; + const tree = await schematicRunner.runSchematic('service', options, appTree); + const content = tree.readContent('/projects/bar/src/app/foo/foo.service.ts'); + const testContent = tree.readContent('/projects/bar/src/app/foo/foo.service.spec.ts'); + expect(content).toContain('export class FooService {'); + expect(testContent).toContain("describe('FooService', () => {"); + }); + + it('should add type to class name by default', async () => { + const options = { ...defaultOptions, type: 'Service', addTypeToClassName: undefined }; + const tree = await schematicRunner.runSchematic('service', options, appTree); + const content = tree.readContent('/projects/bar/src/app/foo/foo.service.ts'); + const testContent = tree.readContent('/projects/bar/src/app/foo/foo.service.spec.ts'); + expect(content).toContain('export class FooService {'); + expect(testContent).toContain("describe('FooService', () => {"); + }); }); diff --git a/packages/schematics/angular/service/schema.json b/packages/schematics/angular/service/schema.json index 29f5474e68dd..19afac150262 100644 --- a/packages/schematics/angular/service/schema.json +++ b/packages/schematics/angular/service/schema.json @@ -43,6 +43,11 @@ "type": { "type": "string", "description": "Append a custom type to the service's filename. For example, if you set the type to `service`, the file will be named `my-service.service.ts`." + }, + "addTypeToClassName": { + "type": "boolean", + "default": true, + "description": "When true, the 'type' option will be appended to the generated class name. When false, only the file name will include the type." } }, "required": ["name", "project"] diff --git a/packages/schematics/angular/ssr/files/application-builder/server.ts.template b/packages/schematics/angular/ssr/files/application-builder/server.ts.template index 6fb8b2c77e5a..556d7fbd224d 100644 --- a/packages/schematics/angular/ssr/files/application-builder/server.ts.template +++ b/packages/schematics/angular/ssr/files/application-builder/server.ts.template @@ -48,10 +48,10 @@ app.use((req, res, next) => { }); /** - * Start the server if this module is the main entry point. + * Start the server if this module is the main entry point, or it is ran via PM2. * The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. */ -if (isMainModule(import.meta.url)) { +if (isMainModule(import.meta.url) || process.env['pm_id']) { const port = process.env['PORT'] || 4000; app.listen(port, (error) => { if (error) { diff --git a/packages/schematics/angular/ssr/files/server-builder/server.ts.template b/packages/schematics/angular/ssr/files/server-builder/server.ts.template index 7567fa65a81d..7327c26532ea 100644 --- a/packages/schematics/angular/ssr/files/server-builder/server.ts.template +++ b/packages/schematics/angular/ssr/files/server-builder/server.ts.template @@ -1,5 +1,3 @@ -import 'zone.js/node'; - import { APP_BASE_HREF } from '@angular/common'; import { CommonEngine } from '@angular/ssr/node'; import express from 'express'; diff --git a/packages/schematics/angular/ssr/index.ts b/packages/schematics/angular/ssr/index.ts index e589395dac73..6e27eab47cd5 100644 --- a/packages/schematics/angular/ssr/index.ts +++ b/packages/schematics/angular/ssr/index.ts @@ -6,9 +6,10 @@ * found in the LICENSE file at https://angular.dev/license */ -import { isJsonObject, join, normalize, strings } from '@angular-devkit/core'; +import { isJsonObject } from '@angular-devkit/core'; import { Rule, + RuleFactory, SchematicContext, SchematicsException, Tree, @@ -18,9 +19,10 @@ import { mergeWith, move, schematic, + strings, url, } from '@angular-devkit/schematics'; -import { posix } from 'node:path'; +import { join } from 'node:path/posix'; import { Schema as ServerOptions } from '../server/schema'; import { DependencyType, @@ -33,9 +35,9 @@ import { import { JSONFile } from '../utility/json-file'; import { latestVersions } from '../utility/latest-versions'; import { isStandaloneApp } from '../utility/ng-ast-utils'; -import { isUsingApplicationBuilder, targetBuildNotFoundError } from '../utility/project-targets'; +import { createProjectSchematic } from '../utility/project'; +import { isUsingApplicationBuilder } from '../utility/project-targets'; import { getMainFilePath } from '../utility/standalone/util'; -import { getWorkspace } from '../utility/workspace'; import { Schema as SSROptions } from './schema'; @@ -84,7 +86,7 @@ async function getApplicationBuilderOutputPaths( let { outputPath } = architectTarget.options; // Use default if not explicitly specified - outputPath ??= posix.join('dist', projectName); + outputPath ??= join('dist', projectName); const defaultDirs = { server: DEFAULT_SERVER_DIR, @@ -122,7 +124,7 @@ function addScriptsRule({ project }: SSROptions, isUsingApplicationBuilder: bool if (isUsingApplicationBuilder) { const { base, server } = await getApplicationBuilderOutputPaths(host, project); pkg.scripts ??= {}; - pkg.scripts[`serve:ssr:${project}`] = `node ${posix.join(base, server)}/server.mjs`; + pkg.scripts[`serve:ssr:${project}`] = `node ${join(base, server)}/server.mjs`; } else { const serverDist = await getLegacyOutputPaths(host, project, 'server'); pkg.scripts = { @@ -184,7 +186,7 @@ function updateApplicationBuilderWorkspaceConfigRule( if (outputPath.browser === '') { const base = outputPath.base as string; logger.warn( - `The output location of the browser build has been updated from "${base}" to "${posix.join( + `The output location of the browser build has been updated from "${base}" to "${join( base, DEFAULT_BROWSER_DIR, )}". @@ -207,7 +209,7 @@ function updateApplicationBuilderWorkspaceConfigRule( outputPath, outputMode: 'server', ssr: { - entry: join(normalize(projectSourceRoot), 'server.ts'), + entry: join(projectSourceRoot, 'server.ts'), }, }; }); @@ -226,7 +228,7 @@ function updateWebpackBuilderWorkspaceConfigRule( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const serverTarget = project.targets.get('server')!; - (serverTarget.options ??= {}).main = posix.join(projectSourceRoot, 'server.ts'); + (serverTarget.options ??= {}).main = join(projectSourceRoot, 'server.ts'); const serveSSRTarget = project.targets.get(SERVE_SSR_TARGET_NAME); if (serveSSRTarget) { @@ -359,19 +361,13 @@ function addServerFile( }; } -export default function (options: SSROptions): Rule { - return async (host, context) => { - const browserEntryPoint = await getMainFilePath(host, options.project); - const isStandalone = isStandaloneApp(host, browserEntryPoint); +const ssrSchematic: RuleFactory = createProjectSchematic( + async (options, { project, tree, context }) => { + const browserEntryPoint = await getMainFilePath(tree, options.project); + const isStandalone = isStandaloneApp(tree, browserEntryPoint); - const workspace = await getWorkspace(host); - const clientProject = workspace.projects.get(options.project); - if (!clientProject) { - throw targetBuildNotFoundError(); - } - - const usingApplicationBuilder = isUsingApplicationBuilder(clientProject); - const sourceRoot = clientProject.sourceRoot ?? posix.join(clientProject.root, 'src'); + const usingApplicationBuilder = isUsingApplicationBuilder(project); + const sourceRoot = project.sourceRoot ?? join(project.root, 'src'); return chain([ schematic('server', { @@ -391,5 +387,7 @@ export default function (options: SSROptions): Rule { addScriptsRule(options, usingApplicationBuilder), addDependencies(options, usingApplicationBuilder), ]); - }; -} + }, +); + +export default ssrSchematic; diff --git a/packages/schematics/angular/ssr/index_spec.ts b/packages/schematics/angular/ssr/index_spec.ts index 97b534aba8e1..9578558d761c 100644 --- a/packages/schematics/angular/ssr/index_spec.ts +++ b/packages/schematics/angular/ssr/index_spec.ts @@ -109,7 +109,6 @@ describe('SSR Schematic', () => { routing: false, style: 'css', skipTests: false, - standalone: true, }, appTree, ); @@ -182,7 +181,7 @@ describe('SSR Schematic', () => { build.builder = '@angular-devkit/build-angular:browser'; build.options = { ...build.options, - main: build.options.browser, + main: 'projects/test-app/src/main.ts', browser: undefined, }; diff --git a/packages/schematics/angular/tailwind/files/.postcssrc.json.template b/packages/schematics/angular/tailwind/files/.postcssrc.json.template new file mode 100644 index 000000000000..72f908df1b32 --- /dev/null +++ b/packages/schematics/angular/tailwind/files/.postcssrc.json.template @@ -0,0 +1,5 @@ +{ + "plugins": { + "@tailwindcss/postcss": {} + } +} \ No newline at end of file diff --git a/packages/schematics/angular/tailwind/index.ts b/packages/schematics/angular/tailwind/index.ts new file mode 100644 index 000000000000..e246e5f55bfe --- /dev/null +++ b/packages/schematics/angular/tailwind/index.ts @@ -0,0 +1,142 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { + type Rule, + RuleFactory, + SchematicsException, + apply, + applyTemplates, + chain, + mergeWith, + move, + strings, + url, +} from '@angular-devkit/schematics'; +import assert from 'node:assert'; +import { join } from 'node:path/posix'; +import { + DependencyType, + ExistingBehavior, + InstallBehavior, + ProjectDefinition, + addDependency, + updateWorkspace, +} from '../utility'; +import { JSONFile } from '../utility/json-file'; +import { latestVersions } from '../utility/latest-versions'; +import { createProjectSchematic } from '../utility/project'; +import { Schema as TailwindOptions } from './schema'; + +const TAILWIND_DEPENDENCIES = ['tailwindcss', '@tailwindcss/postcss', 'postcss']; +const POSTCSS_CONFIG_FILES = ['.postcssrc.json', 'postcss.config.json']; + +function addTailwindStyles(options: { project: string }, project: ProjectDefinition): Rule { + return async (tree) => { + const buildTarget = project.targets.get('build'); + + if (!buildTarget) { + throw new SchematicsException(`Project "${options.project}" does not have a build target.`); + } + + const styles = buildTarget.options?.['styles'] as (string | { input: string })[] | undefined; + + let stylesheetPath: string | undefined; + if (styles) { + stylesheetPath = styles + .map((s) => (typeof s === 'string' ? s : s.input)) + .find((p) => p.endsWith('.css')); + } + + if (!stylesheetPath) { + const newStylesheetPath = join(project.sourceRoot ?? 'src', 'tailwind.css'); + tree.create(newStylesheetPath, '@import "tailwindcss";\n'); + + return updateWorkspace((workspace) => { + const project = workspace.projects.get(options.project); + if (project) { + const buildTarget = project.targets.get('build'); + assert(buildTarget, 'Build target should still be present'); + + // Update main styles + const buildOptions = buildTarget.options; + assert(buildOptions, 'Build options should still be present'); + const existingStyles = (buildOptions['styles'] as (string | { input: string })[]) ?? []; + buildOptions['styles'] = [newStylesheetPath, ...existingStyles]; + + // Update configuration styles + if (buildTarget.configurations) { + for (const config of Object.values(buildTarget.configurations)) { + if (config && 'styles' in config) { + const existingStyles = (config['styles'] as (string | { input: string })[]) ?? []; + config['styles'] = [newStylesheetPath, ...existingStyles]; + } + } + } + } + }); + } else { + let stylesheetContent = tree.readText(stylesheetPath); + if (!stylesheetContent.includes('@import "tailwindcss";')) { + stylesheetContent += '\n@import "tailwindcss";\n'; + tree.overwrite(stylesheetPath, stylesheetContent); + } + } + }; +} + +function managePostCssConfiguration(project: ProjectDefinition): Rule { + return async (tree) => { + const searchPaths = ['/', project.root]; // Workspace root and project root + + for (const path of searchPaths) { + for (const configFile of POSTCSS_CONFIG_FILES) { + const fullPath = join(path, configFile); + if (tree.exists(fullPath)) { + const postcssConfig = new JSONFile(tree, fullPath); + const tailwindPluginPath = ['plugins', '@tailwindcss/postcss']; + + if (postcssConfig.get(tailwindPluginPath) === undefined) { + postcssConfig.modify(tailwindPluginPath, {}); + } + + // Config found and handled + return; + } + } + } + + // No existing config found, so create one from the template + const templateSource = apply(url('./files'), [ + applyTemplates({ + ...strings, + }), + move(project.root), + ]); + + return mergeWith(templateSource); + }; +} + +const tailwindSchematic: RuleFactory = createProjectSchematic( + (options, { project }) => { + return chain([ + addTailwindStyles(options, project), + managePostCssConfiguration(project), + ...TAILWIND_DEPENDENCIES.map((name) => + addDependency(name, latestVersions[name], { + type: DependencyType.Dev, + existing: ExistingBehavior.Skip, + install: options.skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ), + ]); + }, +); + +export default tailwindSchematic; diff --git a/packages/schematics/angular/tailwind/index_spec.ts b/packages/schematics/angular/tailwind/index_spec.ts new file mode 100644 index 000000000000..b5f3e346bd83 --- /dev/null +++ b/packages/schematics/angular/tailwind/index_spec.ts @@ -0,0 +1,132 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; +import { Schema as ApplicationOptions, Style } from '../application/schema'; +import { Schema as WorkspaceOptions } from '../workspace/schema'; + +async function createTestApp( + runner: SchematicTestRunner, + appOptions: ApplicationOptions, + style = Style.Css, +): Promise { + const workspaceOptions: WorkspaceOptions = { + name: 'workspace', + newProjectRoot: 'projects', + version: '6.0.0', + }; + + const appTree = await runner.runSchematic('workspace', workspaceOptions); + + return runner.runSchematic('application', { ...appOptions, style }, appTree); +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getWorkspace(tree: UnitTestTree): any { + return JSON.parse(tree.readContent('/angular.json')); +} + +describe('Tailwind Schematic', () => { + const schematicRunner = new SchematicTestRunner( + '@schematics/angular', + require.resolve('../collection.json'), + ); + + const appOptions: ApplicationOptions = { + name: 'bar', + inlineStyle: false, + inlineTemplate: false, + routing: false, + style: Style.Css, + skipTests: false, + skipPackageJson: false, + }; + + let appTree: UnitTestTree; + + beforeEach(async () => { + appTree = await createTestApp(schematicRunner, appOptions); + }); + + it('should add tailwind dependencies', async () => { + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const packageJson = JSON.parse(tree.readContent('/package.json')); + expect(packageJson.devDependencies['tailwindcss']).toBeDefined(); + expect(packageJson.devDependencies['postcss']).toBeDefined(); + expect(packageJson.devDependencies['@tailwindcss/postcss']).toBeDefined(); + }); + + it('should add tailwind imports to styles.css', async () => { + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const stylesContent = tree.readContent('/projects/bar/src/styles.css'); + expect(stylesContent).toContain('@import "tailwindcss";'); + }); + + it('should not add duplicate tailwind imports to styles.css', async () => { + let tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const stylesContent = tree.readContent('/projects/bar/src/styles.css'); + expect(stylesContent.match(/@import "tailwindcss";/g)?.length).toBe(1); + + tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, tree); + const stylesContentAfter = tree.readContent('/projects/bar/src/styles.css'); + expect(stylesContentAfter.match(/@import "tailwindcss";/g)?.length).toBe(1); + }); + + describe('with scss styles', () => { + beforeEach(async () => { + appTree = await createTestApp(schematicRunner, appOptions, Style.Scss); + }); + + it('should create a tailwind.css file', async () => { + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + expect(tree.exists('/projects/bar/src/tailwind.css')).toBe(true); + const stylesContent = tree.readContent('/projects/bar/src/tailwind.css'); + expect(stylesContent).toContain('@import "tailwindcss";'); + }); + + it('should add tailwind.css to angular.json', async () => { + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const workspace = getWorkspace(tree); + const styles = workspace.projects.bar.architect.build.options.styles; + expect(styles).toEqual(['projects/bar/src/tailwind.css', 'projects/bar/src/styles.scss']); + }); + + it('should not add tailwind imports to styles.scss', async () => { + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const stylesContent = tree.readContent('/projects/bar/src/styles.scss'); + expect(stylesContent).not.toContain('@import "tailwindcss";'); + }); + }); + + describe('with postcss configuration', () => { + it('should create a .postcssrc.json if one does not exist', async () => { + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + expect(tree.exists('/projects/bar/.postcssrc.json')).toBe(true); + }); + + it('should update an existing .postcssrc.json in the project root', async () => { + appTree.create( + '/projects/bar/.postcssrc.json', + JSON.stringify({ plugins: { autoprefixer: {} } }), + ); + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const postCssConfig = JSON.parse(tree.readContent('/projects/bar/.postcssrc.json')); + expect(postCssConfig.plugins['@tailwindcss/postcss']).toBeDefined(); + expect(postCssConfig.plugins['autoprefixer']).toBeDefined(); + }); + + it('should update an existing postcss.config.json in the workspace root', async () => { + appTree.create('/postcss.config.json', JSON.stringify({ plugins: { autoprefixer: {} } })); + const tree = await schematicRunner.runSchematic('tailwind', { project: 'bar' }, appTree); + const postCssConfig = JSON.parse(tree.readContent('/postcss.config.json')); + expect(postCssConfig.plugins['@tailwindcss/postcss']).toBeDefined(); + expect(postCssConfig.plugins['autoprefixer']).toBeDefined(); + expect(tree.exists('/projects/bar/.postcssrc.json')).toBe(false); + }); + }); +}); diff --git a/packages/schematics/angular/tailwind/schema.json b/packages/schematics/angular/tailwind/schema.json new file mode 100644 index 000000000000..3b52fc71c26d --- /dev/null +++ b/packages/schematics/angular/tailwind/schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Tailwind CSS Schematic", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The name of the project.", + "$default": { + "$source": "projectName" + } + }, + "skipInstall": { + "description": "Skip the automatic installation of packages. You will need to manually install the dependencies later.", + "type": "boolean", + "default": false + } + }, + "required": ["project"] +} diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel index 5e4b524bb1cc..b4ac5f975b5a 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel @@ -1,11 +1,10 @@ -load("//tools:defaults.bzl", "ts_project") +load("@aspect_rules_js//js:defs.bzl", "js_library") -# files fetched on 2025-03-03 from -# https://github.com/microsoft/TypeScript/releases/tag/v5.8.2 +# files fetched on 2025-08-01 -# Commands to download: -# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.8.2/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts -# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.8.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +# Commands to update from node_modules: +# cp node_modules/typescript/lib/typescript.d.ts packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +# cp node_modules/typescript/lib/typescript.js packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js licenses(["notice"]) # Apache 2.0 @@ -15,8 +14,10 @@ exports_files([ "LICENSE", ]) -ts_project( +js_library( name = "TypeScript", - srcs = ["lib/typescript.d.ts"], - data = ["lib/typescript.js"], + srcs = [ + "lib/typescript.d.ts", + "lib/typescript.js", + ], ) diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts index 60c1dec27283..87942520f2ab 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts @@ -1486,6 +1486,13 @@ declare namespace ts { command: CommandTypes.Quickinfo; arguments: FileLocationRequestArgs; } + export interface QuickInfoRequestArgs extends FileLocationRequestArgs { + /** + * This controls how many levels of definitions will be expanded in the quick info response. + * The default value is 0. + */ + verbosityLevel?: number; + } /** * Body of QuickInfoResponse. */ @@ -1519,6 +1526,10 @@ declare namespace ts { * JSDoc tags associated with symbol. */ tags: JSDocTagInfo[]; + /** + * Whether the verbosity level can be increased for this quick info response. + */ + canIncreaseVerbosityLevel?: boolean; } /** * Quickinfo response message. @@ -2509,6 +2520,7 @@ declare namespace ts { ESNext = "esnext", Node16 = "node16", Node18 = "node18", + Node20 = "node20", NodeNext = "nodenext", Preserve = "preserve", } @@ -3634,7 +3646,7 @@ declare namespace ts { readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[]; } } - const versionMajorMinor = "5.8"; + const versionMajorMinor = "5.9"; /** The version of the TypeScript compiler release */ const version: string; /** @@ -3830,203 +3842,204 @@ declare namespace ts { BigIntKeyword = 163, OverrideKeyword = 164, OfKeyword = 165, - QualifiedName = 166, - ComputedPropertyName = 167, - TypeParameter = 168, - Parameter = 169, - Decorator = 170, - PropertySignature = 171, - PropertyDeclaration = 172, - MethodSignature = 173, - MethodDeclaration = 174, - ClassStaticBlockDeclaration = 175, - Constructor = 176, - GetAccessor = 177, - SetAccessor = 178, - CallSignature = 179, - ConstructSignature = 180, - IndexSignature = 181, - TypePredicate = 182, - TypeReference = 183, - FunctionType = 184, - ConstructorType = 185, - TypeQuery = 186, - TypeLiteral = 187, - ArrayType = 188, - TupleType = 189, - OptionalType = 190, - RestType = 191, - UnionType = 192, - IntersectionType = 193, - ConditionalType = 194, - InferType = 195, - ParenthesizedType = 196, - ThisType = 197, - TypeOperator = 198, - IndexedAccessType = 199, - MappedType = 200, - LiteralType = 201, - NamedTupleMember = 202, - TemplateLiteralType = 203, - TemplateLiteralTypeSpan = 204, - ImportType = 205, - ObjectBindingPattern = 206, - ArrayBindingPattern = 207, - BindingElement = 208, - ArrayLiteralExpression = 209, - ObjectLiteralExpression = 210, - PropertyAccessExpression = 211, - ElementAccessExpression = 212, - CallExpression = 213, - NewExpression = 214, - TaggedTemplateExpression = 215, - TypeAssertionExpression = 216, - ParenthesizedExpression = 217, - FunctionExpression = 218, - ArrowFunction = 219, - DeleteExpression = 220, - TypeOfExpression = 221, - VoidExpression = 222, - AwaitExpression = 223, - PrefixUnaryExpression = 224, - PostfixUnaryExpression = 225, - BinaryExpression = 226, - ConditionalExpression = 227, - TemplateExpression = 228, - YieldExpression = 229, - SpreadElement = 230, - ClassExpression = 231, - OmittedExpression = 232, - ExpressionWithTypeArguments = 233, - AsExpression = 234, - NonNullExpression = 235, - MetaProperty = 236, - SyntheticExpression = 237, - SatisfiesExpression = 238, - TemplateSpan = 239, - SemicolonClassElement = 240, - Block = 241, - EmptyStatement = 242, - VariableStatement = 243, - ExpressionStatement = 244, - IfStatement = 245, - DoStatement = 246, - WhileStatement = 247, - ForStatement = 248, - ForInStatement = 249, - ForOfStatement = 250, - ContinueStatement = 251, - BreakStatement = 252, - ReturnStatement = 253, - WithStatement = 254, - SwitchStatement = 255, - LabeledStatement = 256, - ThrowStatement = 257, - TryStatement = 258, - DebuggerStatement = 259, - VariableDeclaration = 260, - VariableDeclarationList = 261, - FunctionDeclaration = 262, - ClassDeclaration = 263, - InterfaceDeclaration = 264, - TypeAliasDeclaration = 265, - EnumDeclaration = 266, - ModuleDeclaration = 267, - ModuleBlock = 268, - CaseBlock = 269, - NamespaceExportDeclaration = 270, - ImportEqualsDeclaration = 271, - ImportDeclaration = 272, - ImportClause = 273, - NamespaceImport = 274, - NamedImports = 275, - ImportSpecifier = 276, - ExportAssignment = 277, - ExportDeclaration = 278, - NamedExports = 279, - NamespaceExport = 280, - ExportSpecifier = 281, - MissingDeclaration = 282, - ExternalModuleReference = 283, - JsxElement = 284, - JsxSelfClosingElement = 285, - JsxOpeningElement = 286, - JsxClosingElement = 287, - JsxFragment = 288, - JsxOpeningFragment = 289, - JsxClosingFragment = 290, - JsxAttribute = 291, - JsxAttributes = 292, - JsxSpreadAttribute = 293, - JsxExpression = 294, - JsxNamespacedName = 295, - CaseClause = 296, - DefaultClause = 297, - HeritageClause = 298, - CatchClause = 299, - ImportAttributes = 300, - ImportAttribute = 301, - /** @deprecated */ AssertClause = 300, - /** @deprecated */ AssertEntry = 301, - /** @deprecated */ ImportTypeAssertionContainer = 302, - PropertyAssignment = 303, - ShorthandPropertyAssignment = 304, - SpreadAssignment = 305, - EnumMember = 306, - SourceFile = 307, - Bundle = 308, - JSDocTypeExpression = 309, - JSDocNameReference = 310, - JSDocMemberName = 311, - JSDocAllType = 312, - JSDocUnknownType = 313, - JSDocNullableType = 314, - JSDocNonNullableType = 315, - JSDocOptionalType = 316, - JSDocFunctionType = 317, - JSDocVariadicType = 318, - JSDocNamepathType = 319, - JSDoc = 320, + DeferKeyword = 166, + QualifiedName = 167, + ComputedPropertyName = 168, + TypeParameter = 169, + Parameter = 170, + Decorator = 171, + PropertySignature = 172, + PropertyDeclaration = 173, + MethodSignature = 174, + MethodDeclaration = 175, + ClassStaticBlockDeclaration = 176, + Constructor = 177, + GetAccessor = 178, + SetAccessor = 179, + CallSignature = 180, + ConstructSignature = 181, + IndexSignature = 182, + TypePredicate = 183, + TypeReference = 184, + FunctionType = 185, + ConstructorType = 186, + TypeQuery = 187, + TypeLiteral = 188, + ArrayType = 189, + TupleType = 190, + OptionalType = 191, + RestType = 192, + UnionType = 193, + IntersectionType = 194, + ConditionalType = 195, + InferType = 196, + ParenthesizedType = 197, + ThisType = 198, + TypeOperator = 199, + IndexedAccessType = 200, + MappedType = 201, + LiteralType = 202, + NamedTupleMember = 203, + TemplateLiteralType = 204, + TemplateLiteralTypeSpan = 205, + ImportType = 206, + ObjectBindingPattern = 207, + ArrayBindingPattern = 208, + BindingElement = 209, + ArrayLiteralExpression = 210, + ObjectLiteralExpression = 211, + PropertyAccessExpression = 212, + ElementAccessExpression = 213, + CallExpression = 214, + NewExpression = 215, + TaggedTemplateExpression = 216, + TypeAssertionExpression = 217, + ParenthesizedExpression = 218, + FunctionExpression = 219, + ArrowFunction = 220, + DeleteExpression = 221, + TypeOfExpression = 222, + VoidExpression = 223, + AwaitExpression = 224, + PrefixUnaryExpression = 225, + PostfixUnaryExpression = 226, + BinaryExpression = 227, + ConditionalExpression = 228, + TemplateExpression = 229, + YieldExpression = 230, + SpreadElement = 231, + ClassExpression = 232, + OmittedExpression = 233, + ExpressionWithTypeArguments = 234, + AsExpression = 235, + NonNullExpression = 236, + MetaProperty = 237, + SyntheticExpression = 238, + SatisfiesExpression = 239, + TemplateSpan = 240, + SemicolonClassElement = 241, + Block = 242, + EmptyStatement = 243, + VariableStatement = 244, + ExpressionStatement = 245, + IfStatement = 246, + DoStatement = 247, + WhileStatement = 248, + ForStatement = 249, + ForInStatement = 250, + ForOfStatement = 251, + ContinueStatement = 252, + BreakStatement = 253, + ReturnStatement = 254, + WithStatement = 255, + SwitchStatement = 256, + LabeledStatement = 257, + ThrowStatement = 258, + TryStatement = 259, + DebuggerStatement = 260, + VariableDeclaration = 261, + VariableDeclarationList = 262, + FunctionDeclaration = 263, + ClassDeclaration = 264, + InterfaceDeclaration = 265, + TypeAliasDeclaration = 266, + EnumDeclaration = 267, + ModuleDeclaration = 268, + ModuleBlock = 269, + CaseBlock = 270, + NamespaceExportDeclaration = 271, + ImportEqualsDeclaration = 272, + ImportDeclaration = 273, + ImportClause = 274, + NamespaceImport = 275, + NamedImports = 276, + ImportSpecifier = 277, + ExportAssignment = 278, + ExportDeclaration = 279, + NamedExports = 280, + NamespaceExport = 281, + ExportSpecifier = 282, + MissingDeclaration = 283, + ExternalModuleReference = 284, + JsxElement = 285, + JsxSelfClosingElement = 286, + JsxOpeningElement = 287, + JsxClosingElement = 288, + JsxFragment = 289, + JsxOpeningFragment = 290, + JsxClosingFragment = 291, + JsxAttribute = 292, + JsxAttributes = 293, + JsxSpreadAttribute = 294, + JsxExpression = 295, + JsxNamespacedName = 296, + CaseClause = 297, + DefaultClause = 298, + HeritageClause = 299, + CatchClause = 300, + ImportAttributes = 301, + ImportAttribute = 302, + /** @deprecated */ AssertClause = 301, + /** @deprecated */ AssertEntry = 302, + /** @deprecated */ ImportTypeAssertionContainer = 303, + PropertyAssignment = 304, + ShorthandPropertyAssignment = 305, + SpreadAssignment = 306, + EnumMember = 307, + SourceFile = 308, + Bundle = 309, + JSDocTypeExpression = 310, + JSDocNameReference = 311, + JSDocMemberName = 312, + JSDocAllType = 313, + JSDocUnknownType = 314, + JSDocNullableType = 315, + JSDocNonNullableType = 316, + JSDocOptionalType = 317, + JSDocFunctionType = 318, + JSDocVariadicType = 319, + JSDocNamepathType = 320, + JSDoc = 321, /** @deprecated Use SyntaxKind.JSDoc */ - JSDocComment = 320, - JSDocText = 321, - JSDocTypeLiteral = 322, - JSDocSignature = 323, - JSDocLink = 324, - JSDocLinkCode = 325, - JSDocLinkPlain = 326, - JSDocTag = 327, - JSDocAugmentsTag = 328, - JSDocImplementsTag = 329, - JSDocAuthorTag = 330, - JSDocDeprecatedTag = 331, - JSDocClassTag = 332, - JSDocPublicTag = 333, - JSDocPrivateTag = 334, - JSDocProtectedTag = 335, - JSDocReadonlyTag = 336, - JSDocOverrideTag = 337, - JSDocCallbackTag = 338, - JSDocOverloadTag = 339, - JSDocEnumTag = 340, - JSDocParameterTag = 341, - JSDocReturnTag = 342, - JSDocThisTag = 343, - JSDocTypeTag = 344, - JSDocTemplateTag = 345, - JSDocTypedefTag = 346, - JSDocSeeTag = 347, - JSDocPropertyTag = 348, - JSDocThrowsTag = 349, - JSDocSatisfiesTag = 350, - JSDocImportTag = 351, - SyntaxList = 352, - NotEmittedStatement = 353, - NotEmittedTypeElement = 354, - PartiallyEmittedExpression = 355, - CommaListExpression = 356, - SyntheticReferenceExpression = 357, - Count = 358, + JSDocComment = 321, + JSDocText = 322, + JSDocTypeLiteral = 323, + JSDocSignature = 324, + JSDocLink = 325, + JSDocLinkCode = 326, + JSDocLinkPlain = 327, + JSDocTag = 328, + JSDocAugmentsTag = 329, + JSDocImplementsTag = 330, + JSDocAuthorTag = 331, + JSDocDeprecatedTag = 332, + JSDocClassTag = 333, + JSDocPublicTag = 334, + JSDocPrivateTag = 335, + JSDocProtectedTag = 336, + JSDocReadonlyTag = 337, + JSDocOverrideTag = 338, + JSDocCallbackTag = 339, + JSDocOverloadTag = 340, + JSDocEnumTag = 341, + JSDocParameterTag = 342, + JSDocReturnTag = 343, + JSDocThisTag = 344, + JSDocTypeTag = 345, + JSDocTemplateTag = 346, + JSDocTypedefTag = 347, + JSDocSeeTag = 348, + JSDocPropertyTag = 349, + JSDocThrowsTag = 350, + JSDocSatisfiesTag = 351, + JSDocImportTag = 352, + SyntaxList = 353, + NotEmittedStatement = 354, + NotEmittedTypeElement = 355, + PartiallyEmittedExpression = 356, + CommaListExpression = 357, + SyntheticReferenceExpression = 358, + Count = 359, FirstAssignment = 64, LastAssignment = 79, FirstCompoundAssignment = 65, @@ -4034,15 +4047,15 @@ declare namespace ts { FirstReservedWord = 83, LastReservedWord = 118, FirstKeyword = 83, - LastKeyword = 165, + LastKeyword = 166, FirstFutureReservedWord = 119, LastFutureReservedWord = 127, - FirstTypeNode = 182, - LastTypeNode = 205, + FirstTypeNode = 183, + LastTypeNode = 206, FirstPunctuation = 19, LastPunctuation = 79, FirstToken = 0, - LastToken = 165, + LastToken = 166, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 9, @@ -4051,13 +4064,13 @@ declare namespace ts { LastTemplateToken = 18, FirstBinaryOperator = 30, LastBinaryOperator = 79, - FirstStatement = 243, - LastStatement = 259, - FirstNode = 166, - FirstJSDocNode = 309, - LastJSDocNode = 351, - FirstJSDocTagNode = 327, - LastJSDocTagNode = 351, + FirstStatement = 244, + LastStatement = 260, + FirstNode = 167, + FirstJSDocNode = 310, + LastJSDocNode = 352, + FirstJSDocTagNode = 328, + LastJSDocTagNode = 352, } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; @@ -4145,6 +4158,7 @@ declare namespace ts { | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword + | SyntaxKind.DeferKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword @@ -5117,7 +5131,7 @@ declare namespace ts { readonly expression: SuperExpression; } interface ImportCall extends CallExpression { - readonly expression: ImportExpression; + readonly expression: ImportExpression | ImportDeferProperty; } interface ExpressionWithTypeArguments extends MemberExpression, NodeWithTypeArguments { readonly kind: SyntaxKind.ExpressionWithTypeArguments; @@ -5167,6 +5181,12 @@ declare namespace ts { readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; readonly name: Identifier; } + interface ImportDeferProperty extends MetaProperty { + readonly keywordToken: SyntaxKind.ImportKeyword; + readonly name: Identifier & { + readonly escapedText: __String & "defer"; + }; + } interface JsxElement extends PrimaryExpression { readonly kind: SyntaxKind.JsxElement; readonly openingElement: JsxOpeningElement; @@ -5506,10 +5526,13 @@ declare namespace ts { interface ImportClause extends NamedDeclaration { readonly kind: SyntaxKind.ImportClause; readonly parent: ImportDeclaration | JSDocImportTag; + /** @deprecated Use `phaseModifier` instead */ readonly isTypeOnly: boolean; + readonly phaseModifier: undefined | ImportPhaseModifierSyntaxKind; readonly name?: Identifier; readonly namedBindings?: NamedImportBindings; } + type ImportPhaseModifierSyntaxKind = SyntaxKind.TypeKeyword | SyntaxKind.DeferKeyword; /** @deprecated */ type AssertionKey = ImportAttributeName; /** @deprecated */ @@ -5884,6 +5907,7 @@ declare namespace ts { */ interface SourceFileLike { readonly text: string; + languageVariant?: LanguageVariant; } interface SourceFileLike { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; @@ -6303,6 +6327,10 @@ declare namespace ts { * is `never`. Instead, use `type.flags & TypeFlags.Never`. */ getNeverType(): Type; + /** + * Gets the intrinsic `object` type. + */ + getNonPrimitiveType(): Type; /** * Returns true if the "source" type is assignable to the "target" type. * @@ -6690,11 +6718,11 @@ declare namespace ts { JSLiteral = 4096, FreshLiteral = 8192, ArrayLiteral = 16384, + SingleSignatureType = 134217728, ClassOrInterface = 3, ContainsSpread = 2097152, ObjectRestType = 4194304, InstantiationExpressionType = 8388608, - SingleSignatureType = 134217728, } interface ObjectType extends Type { objectFlags: ObjectFlags; @@ -7133,6 +7161,7 @@ declare namespace ts { ESNext = 99, Node16 = 100, Node18 = 101, + Node20 = 102, NodeNext = 199, Preserve = 200, } @@ -7713,8 +7742,10 @@ declare namespace ts { updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes): ImportDeclaration; updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined): ImportDeclaration; - createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; - updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + createImportClause(phaseModifier: ImportPhaseModifierSyntaxKind | undefined, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + /** @deprecated */ createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + updateImportClause(node: ImportClause, phaseModifier: ImportPhaseModifierSyntaxKind | undefined, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; + /** @deprecated */ updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; /** @deprecated */ createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; /** @deprecated */ updateAssertClause(node: AssertClause, elements: NodeArray, multiLine?: boolean): AssertClause; /** @deprecated */ createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; @@ -8391,6 +8422,12 @@ declare namespace ts { readonly displayPartsForJSDoc?: boolean; readonly generateReturnInDocTemplate?: boolean; readonly disableLineTextInReferences?: boolean; + /** + * A positive integer indicating the maximum length of a hover text before it is truncated. + * + * Default: `500` + */ + readonly maximumHoverLength?: number; } type OrganizeImportsTypeOrder = "last" | "inline" | "first"; /** Represents a bigint literal value without requiring bigint support */ @@ -10168,8 +10205,9 @@ declare namespace ts { * * @param fileName The path to the file * @param position A zero-based index of the character where you want the quick info + * @param maximumLength Maximum length of a quickinfo text before it is truncated. */ - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined; + getQuickInfoAtPosition(fileName: string, position: number, maximumLength?: number): QuickInfo | undefined; getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined; @@ -10757,6 +10795,7 @@ declare namespace ts { displayParts?: SymbolDisplayPart[]; documentation?: SymbolDisplayPart[]; tags?: JSDocTagInfo[]; + canIncreaseVerbosityLevel?: boolean; } type RenameInfo = RenameInfoSuccess | RenameInfoFailure; interface RenameInfoSuccess { diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js index dc0fe9a56bb4..2643aa12aa64 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js @@ -487,6 +487,7 @@ __export(typescript_exports, { decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, deduplicate: () => deduplicate, + defaultHoverMaximumTruncationLength: () => defaultHoverMaximumTruncationLength, defaultInitCompilerOptions: () => defaultInitCompilerOptions, defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, diagnosticCategoryName: () => diagnosticCategoryName, @@ -671,7 +672,6 @@ __export(typescript_exports, { getCommonSourceDirectory: () => getCommonSourceDirectory, getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, - getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, @@ -2284,8 +2284,8 @@ __export(typescript_exports, { module.exports = __toCommonJS(typescript_exports); // src/compiler/corePublic.ts -var versionMajorMinor = "5.8"; -var version = "5.8.2"; +var versionMajorMinor = "5.9"; +var version = "5.9.2"; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -5686,202 +5686,203 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 163] = "BigIntKeyword"; SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 164] = "OverrideKeyword"; SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword"; - SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName"; - SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName"; - SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter"; - SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter"; - SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator"; - SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature"; - SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration"; - SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature"; - SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration"; - SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration"; - SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor"; - SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor"; - SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor"; - SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature"; - SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature"; - SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature"; - SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate"; - SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference"; - SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType"; - SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType"; - SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery"; - SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral"; - SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType"; - SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType"; - SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType"; - SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType"; - SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType"; - SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType"; - SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType"; - SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType"; - SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType"; - SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType"; - SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator"; - SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType"; - SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType"; - SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType"; - SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember"; - SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType"; - SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan"; - SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType"; - SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern"; - SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern"; - SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement"; - SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression"; - SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression"; - SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression"; - SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression"; - SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression"; - SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression"; - SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression"; - SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression"; - SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; - SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression"; - SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction"; - SyntaxKind5[SyntaxKind5["DeleteExpression"] = 220] = "DeleteExpression"; - SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 221] = "TypeOfExpression"; - SyntaxKind5[SyntaxKind5["VoidExpression"] = 222] = "VoidExpression"; - SyntaxKind5[SyntaxKind5["AwaitExpression"] = 223] = "AwaitExpression"; - SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 224] = "PrefixUnaryExpression"; - SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 225] = "PostfixUnaryExpression"; - SyntaxKind5[SyntaxKind5["BinaryExpression"] = 226] = "BinaryExpression"; - SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 227] = "ConditionalExpression"; - SyntaxKind5[SyntaxKind5["TemplateExpression"] = 228] = "TemplateExpression"; - SyntaxKind5[SyntaxKind5["YieldExpression"] = 229] = "YieldExpression"; - SyntaxKind5[SyntaxKind5["SpreadElement"] = 230] = "SpreadElement"; - SyntaxKind5[SyntaxKind5["ClassExpression"] = 231] = "ClassExpression"; - SyntaxKind5[SyntaxKind5["OmittedExpression"] = 232] = "OmittedExpression"; - SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 233] = "ExpressionWithTypeArguments"; - SyntaxKind5[SyntaxKind5["AsExpression"] = 234] = "AsExpression"; - SyntaxKind5[SyntaxKind5["NonNullExpression"] = 235] = "NonNullExpression"; - SyntaxKind5[SyntaxKind5["MetaProperty"] = 236] = "MetaProperty"; - SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 237] = "SyntheticExpression"; - SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 238] = "SatisfiesExpression"; - SyntaxKind5[SyntaxKind5["TemplateSpan"] = 239] = "TemplateSpan"; - SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 240] = "SemicolonClassElement"; - SyntaxKind5[SyntaxKind5["Block"] = 241] = "Block"; - SyntaxKind5[SyntaxKind5["EmptyStatement"] = 242] = "EmptyStatement"; - SyntaxKind5[SyntaxKind5["VariableStatement"] = 243] = "VariableStatement"; - SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 244] = "ExpressionStatement"; - SyntaxKind5[SyntaxKind5["IfStatement"] = 245] = "IfStatement"; - SyntaxKind5[SyntaxKind5["DoStatement"] = 246] = "DoStatement"; - SyntaxKind5[SyntaxKind5["WhileStatement"] = 247] = "WhileStatement"; - SyntaxKind5[SyntaxKind5["ForStatement"] = 248] = "ForStatement"; - SyntaxKind5[SyntaxKind5["ForInStatement"] = 249] = "ForInStatement"; - SyntaxKind5[SyntaxKind5["ForOfStatement"] = 250] = "ForOfStatement"; - SyntaxKind5[SyntaxKind5["ContinueStatement"] = 251] = "ContinueStatement"; - SyntaxKind5[SyntaxKind5["BreakStatement"] = 252] = "BreakStatement"; - SyntaxKind5[SyntaxKind5["ReturnStatement"] = 253] = "ReturnStatement"; - SyntaxKind5[SyntaxKind5["WithStatement"] = 254] = "WithStatement"; - SyntaxKind5[SyntaxKind5["SwitchStatement"] = 255] = "SwitchStatement"; - SyntaxKind5[SyntaxKind5["LabeledStatement"] = 256] = "LabeledStatement"; - SyntaxKind5[SyntaxKind5["ThrowStatement"] = 257] = "ThrowStatement"; - SyntaxKind5[SyntaxKind5["TryStatement"] = 258] = "TryStatement"; - SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 259] = "DebuggerStatement"; - SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 260] = "VariableDeclaration"; - SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 261] = "VariableDeclarationList"; - SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 262] = "FunctionDeclaration"; - SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 263] = "ClassDeclaration"; - SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 264] = "InterfaceDeclaration"; - SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 265] = "TypeAliasDeclaration"; - SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 266] = "EnumDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 267] = "ModuleDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleBlock"] = 268] = "ModuleBlock"; - SyntaxKind5[SyntaxKind5["CaseBlock"] = 269] = "CaseBlock"; - SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 270] = "NamespaceExportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 271] = "ImportEqualsDeclaration"; - SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 272] = "ImportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportClause"] = 273] = "ImportClause"; - SyntaxKind5[SyntaxKind5["NamespaceImport"] = 274] = "NamespaceImport"; - SyntaxKind5[SyntaxKind5["NamedImports"] = 275] = "NamedImports"; - SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 276] = "ImportSpecifier"; - SyntaxKind5[SyntaxKind5["ExportAssignment"] = 277] = "ExportAssignment"; - SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 278] = "ExportDeclaration"; - SyntaxKind5[SyntaxKind5["NamedExports"] = 279] = "NamedExports"; - SyntaxKind5[SyntaxKind5["NamespaceExport"] = 280] = "NamespaceExport"; - SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 281] = "ExportSpecifier"; - SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 282] = "MissingDeclaration"; - SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 283] = "ExternalModuleReference"; - SyntaxKind5[SyntaxKind5["JsxElement"] = 284] = "JsxElement"; - SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 285] = "JsxSelfClosingElement"; - SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 286] = "JsxOpeningElement"; - SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 287] = "JsxClosingElement"; - SyntaxKind5[SyntaxKind5["JsxFragment"] = 288] = "JsxFragment"; - SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 289] = "JsxOpeningFragment"; - SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 290] = "JsxClosingFragment"; - SyntaxKind5[SyntaxKind5["JsxAttribute"] = 291] = "JsxAttribute"; - SyntaxKind5[SyntaxKind5["JsxAttributes"] = 292] = "JsxAttributes"; - SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 293] = "JsxSpreadAttribute"; - SyntaxKind5[SyntaxKind5["JsxExpression"] = 294] = "JsxExpression"; - SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 295] = "JsxNamespacedName"; - SyntaxKind5[SyntaxKind5["CaseClause"] = 296] = "CaseClause"; - SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause"; - SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause"; - SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause"; - SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes"; - SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute"; - SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause"; - SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry"; - SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer"; - SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment"; - SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment"; - SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 305] = "SpreadAssignment"; - SyntaxKind5[SyntaxKind5["EnumMember"] = 306] = "EnumMember"; - SyntaxKind5[SyntaxKind5["SourceFile"] = 307] = "SourceFile"; - SyntaxKind5[SyntaxKind5["Bundle"] = 308] = "Bundle"; - SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 309] = "JSDocTypeExpression"; - SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 310] = "JSDocNameReference"; - SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 311] = "JSDocMemberName"; - SyntaxKind5[SyntaxKind5["JSDocAllType"] = 312] = "JSDocAllType"; - SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 313] = "JSDocUnknownType"; - SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 314] = "JSDocNullableType"; - SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 315] = "JSDocNonNullableType"; - SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 316] = "JSDocOptionalType"; - SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 317] = "JSDocFunctionType"; - SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 318] = "JSDocVariadicType"; - SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 319] = "JSDocNamepathType"; - SyntaxKind5[SyntaxKind5["JSDoc"] = 320] = "JSDoc"; - SyntaxKind5[SyntaxKind5["JSDocComment"] = 320 /* JSDoc */] = "JSDocComment"; - SyntaxKind5[SyntaxKind5["JSDocText"] = 321] = "JSDocText"; - SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 322] = "JSDocTypeLiteral"; - SyntaxKind5[SyntaxKind5["JSDocSignature"] = 323] = "JSDocSignature"; - SyntaxKind5[SyntaxKind5["JSDocLink"] = 324] = "JSDocLink"; - SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 325] = "JSDocLinkCode"; - SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 326] = "JSDocLinkPlain"; - SyntaxKind5[SyntaxKind5["JSDocTag"] = 327] = "JSDocTag"; - SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 328] = "JSDocAugmentsTag"; - SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 329] = "JSDocImplementsTag"; - SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 330] = "JSDocAuthorTag"; - SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 331] = "JSDocDeprecatedTag"; - SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 332] = "JSDocClassTag"; - SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 333] = "JSDocPublicTag"; - SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 334] = "JSDocPrivateTag"; - SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 335] = "JSDocProtectedTag"; - SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 336] = "JSDocReadonlyTag"; - SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 337] = "JSDocOverrideTag"; - SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 338] = "JSDocCallbackTag"; - SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 339] = "JSDocOverloadTag"; - SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 340] = "JSDocEnumTag"; - SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 341] = "JSDocParameterTag"; - SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 342] = "JSDocReturnTag"; - SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 343] = "JSDocThisTag"; - SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 344] = "JSDocTypeTag"; - SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 345] = "JSDocTemplateTag"; - SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 346] = "JSDocTypedefTag"; - SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 347] = "JSDocSeeTag"; - SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 348] = "JSDocPropertyTag"; - SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 349] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 350] = "JSDocSatisfiesTag"; - SyntaxKind5[SyntaxKind5["JSDocImportTag"] = 351] = "JSDocImportTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 352] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 353] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["NotEmittedTypeElement"] = 354] = "NotEmittedTypeElement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 356] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 358] = "Count"; + SyntaxKind5[SyntaxKind5["DeferKeyword"] = 166] = "DeferKeyword"; + SyntaxKind5[SyntaxKind5["QualifiedName"] = 167] = "QualifiedName"; + SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 168] = "ComputedPropertyName"; + SyntaxKind5[SyntaxKind5["TypeParameter"] = 169] = "TypeParameter"; + SyntaxKind5[SyntaxKind5["Parameter"] = 170] = "Parameter"; + SyntaxKind5[SyntaxKind5["Decorator"] = 171] = "Decorator"; + SyntaxKind5[SyntaxKind5["PropertySignature"] = 172] = "PropertySignature"; + SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 173] = "PropertyDeclaration"; + SyntaxKind5[SyntaxKind5["MethodSignature"] = 174] = "MethodSignature"; + SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 175] = "MethodDeclaration"; + SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 176] = "ClassStaticBlockDeclaration"; + SyntaxKind5[SyntaxKind5["Constructor"] = 177] = "Constructor"; + SyntaxKind5[SyntaxKind5["GetAccessor"] = 178] = "GetAccessor"; + SyntaxKind5[SyntaxKind5["SetAccessor"] = 179] = "SetAccessor"; + SyntaxKind5[SyntaxKind5["CallSignature"] = 180] = "CallSignature"; + SyntaxKind5[SyntaxKind5["ConstructSignature"] = 181] = "ConstructSignature"; + SyntaxKind5[SyntaxKind5["IndexSignature"] = 182] = "IndexSignature"; + SyntaxKind5[SyntaxKind5["TypePredicate"] = 183] = "TypePredicate"; + SyntaxKind5[SyntaxKind5["TypeReference"] = 184] = "TypeReference"; + SyntaxKind5[SyntaxKind5["FunctionType"] = 185] = "FunctionType"; + SyntaxKind5[SyntaxKind5["ConstructorType"] = 186] = "ConstructorType"; + SyntaxKind5[SyntaxKind5["TypeQuery"] = 187] = "TypeQuery"; + SyntaxKind5[SyntaxKind5["TypeLiteral"] = 188] = "TypeLiteral"; + SyntaxKind5[SyntaxKind5["ArrayType"] = 189] = "ArrayType"; + SyntaxKind5[SyntaxKind5["TupleType"] = 190] = "TupleType"; + SyntaxKind5[SyntaxKind5["OptionalType"] = 191] = "OptionalType"; + SyntaxKind5[SyntaxKind5["RestType"] = 192] = "RestType"; + SyntaxKind5[SyntaxKind5["UnionType"] = 193] = "UnionType"; + SyntaxKind5[SyntaxKind5["IntersectionType"] = 194] = "IntersectionType"; + SyntaxKind5[SyntaxKind5["ConditionalType"] = 195] = "ConditionalType"; + SyntaxKind5[SyntaxKind5["InferType"] = 196] = "InferType"; + SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 197] = "ParenthesizedType"; + SyntaxKind5[SyntaxKind5["ThisType"] = 198] = "ThisType"; + SyntaxKind5[SyntaxKind5["TypeOperator"] = 199] = "TypeOperator"; + SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 200] = "IndexedAccessType"; + SyntaxKind5[SyntaxKind5["MappedType"] = 201] = "MappedType"; + SyntaxKind5[SyntaxKind5["LiteralType"] = 202] = "LiteralType"; + SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 203] = "NamedTupleMember"; + SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 204] = "TemplateLiteralType"; + SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 205] = "TemplateLiteralTypeSpan"; + SyntaxKind5[SyntaxKind5["ImportType"] = 206] = "ImportType"; + SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 207] = "ObjectBindingPattern"; + SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 208] = "ArrayBindingPattern"; + SyntaxKind5[SyntaxKind5["BindingElement"] = 209] = "BindingElement"; + SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 210] = "ArrayLiteralExpression"; + SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 211] = "ObjectLiteralExpression"; + SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 212] = "PropertyAccessExpression"; + SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 213] = "ElementAccessExpression"; + SyntaxKind5[SyntaxKind5["CallExpression"] = 214] = "CallExpression"; + SyntaxKind5[SyntaxKind5["NewExpression"] = 215] = "NewExpression"; + SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 216] = "TaggedTemplateExpression"; + SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 217] = "TypeAssertionExpression"; + SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 218] = "ParenthesizedExpression"; + SyntaxKind5[SyntaxKind5["FunctionExpression"] = 219] = "FunctionExpression"; + SyntaxKind5[SyntaxKind5["ArrowFunction"] = 220] = "ArrowFunction"; + SyntaxKind5[SyntaxKind5["DeleteExpression"] = 221] = "DeleteExpression"; + SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 222] = "TypeOfExpression"; + SyntaxKind5[SyntaxKind5["VoidExpression"] = 223] = "VoidExpression"; + SyntaxKind5[SyntaxKind5["AwaitExpression"] = 224] = "AwaitExpression"; + SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression"; + SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression"; + SyntaxKind5[SyntaxKind5["BinaryExpression"] = 227] = "BinaryExpression"; + SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 228] = "ConditionalExpression"; + SyntaxKind5[SyntaxKind5["TemplateExpression"] = 229] = "TemplateExpression"; + SyntaxKind5[SyntaxKind5["YieldExpression"] = 230] = "YieldExpression"; + SyntaxKind5[SyntaxKind5["SpreadElement"] = 231] = "SpreadElement"; + SyntaxKind5[SyntaxKind5["ClassExpression"] = 232] = "ClassExpression"; + SyntaxKind5[SyntaxKind5["OmittedExpression"] = 233] = "OmittedExpression"; + SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments"; + SyntaxKind5[SyntaxKind5["AsExpression"] = 235] = "AsExpression"; + SyntaxKind5[SyntaxKind5["NonNullExpression"] = 236] = "NonNullExpression"; + SyntaxKind5[SyntaxKind5["MetaProperty"] = 237] = "MetaProperty"; + SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 238] = "SyntheticExpression"; + SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 239] = "SatisfiesExpression"; + SyntaxKind5[SyntaxKind5["TemplateSpan"] = 240] = "TemplateSpan"; + SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 241] = "SemicolonClassElement"; + SyntaxKind5[SyntaxKind5["Block"] = 242] = "Block"; + SyntaxKind5[SyntaxKind5["EmptyStatement"] = 243] = "EmptyStatement"; + SyntaxKind5[SyntaxKind5["VariableStatement"] = 244] = "VariableStatement"; + SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 245] = "ExpressionStatement"; + SyntaxKind5[SyntaxKind5["IfStatement"] = 246] = "IfStatement"; + SyntaxKind5[SyntaxKind5["DoStatement"] = 247] = "DoStatement"; + SyntaxKind5[SyntaxKind5["WhileStatement"] = 248] = "WhileStatement"; + SyntaxKind5[SyntaxKind5["ForStatement"] = 249] = "ForStatement"; + SyntaxKind5[SyntaxKind5["ForInStatement"] = 250] = "ForInStatement"; + SyntaxKind5[SyntaxKind5["ForOfStatement"] = 251] = "ForOfStatement"; + SyntaxKind5[SyntaxKind5["ContinueStatement"] = 252] = "ContinueStatement"; + SyntaxKind5[SyntaxKind5["BreakStatement"] = 253] = "BreakStatement"; + SyntaxKind5[SyntaxKind5["ReturnStatement"] = 254] = "ReturnStatement"; + SyntaxKind5[SyntaxKind5["WithStatement"] = 255] = "WithStatement"; + SyntaxKind5[SyntaxKind5["SwitchStatement"] = 256] = "SwitchStatement"; + SyntaxKind5[SyntaxKind5["LabeledStatement"] = 257] = "LabeledStatement"; + SyntaxKind5[SyntaxKind5["ThrowStatement"] = 258] = "ThrowStatement"; + SyntaxKind5[SyntaxKind5["TryStatement"] = 259] = "TryStatement"; + SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 260] = "DebuggerStatement"; + SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 261] = "VariableDeclaration"; + SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 262] = "VariableDeclarationList"; + SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 263] = "FunctionDeclaration"; + SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 264] = "ClassDeclaration"; + SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 265] = "InterfaceDeclaration"; + SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 266] = "TypeAliasDeclaration"; + SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 267] = "EnumDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 268] = "ModuleDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleBlock"] = 269] = "ModuleBlock"; + SyntaxKind5[SyntaxKind5["CaseBlock"] = 270] = "CaseBlock"; + SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 271] = "NamespaceExportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 272] = "ImportEqualsDeclaration"; + SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 273] = "ImportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportClause"] = 274] = "ImportClause"; + SyntaxKind5[SyntaxKind5["NamespaceImport"] = 275] = "NamespaceImport"; + SyntaxKind5[SyntaxKind5["NamedImports"] = 276] = "NamedImports"; + SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 277] = "ImportSpecifier"; + SyntaxKind5[SyntaxKind5["ExportAssignment"] = 278] = "ExportAssignment"; + SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 279] = "ExportDeclaration"; + SyntaxKind5[SyntaxKind5["NamedExports"] = 280] = "NamedExports"; + SyntaxKind5[SyntaxKind5["NamespaceExport"] = 281] = "NamespaceExport"; + SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 282] = "ExportSpecifier"; + SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 283] = "MissingDeclaration"; + SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 284] = "ExternalModuleReference"; + SyntaxKind5[SyntaxKind5["JsxElement"] = 285] = "JsxElement"; + SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 286] = "JsxSelfClosingElement"; + SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 287] = "JsxOpeningElement"; + SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 288] = "JsxClosingElement"; + SyntaxKind5[SyntaxKind5["JsxFragment"] = 289] = "JsxFragment"; + SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 290] = "JsxOpeningFragment"; + SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 291] = "JsxClosingFragment"; + SyntaxKind5[SyntaxKind5["JsxAttribute"] = 292] = "JsxAttribute"; + SyntaxKind5[SyntaxKind5["JsxAttributes"] = 293] = "JsxAttributes"; + SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 294] = "JsxSpreadAttribute"; + SyntaxKind5[SyntaxKind5["JsxExpression"] = 295] = "JsxExpression"; + SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 296] = "JsxNamespacedName"; + SyntaxKind5[SyntaxKind5["CaseClause"] = 297] = "CaseClause"; + SyntaxKind5[SyntaxKind5["DefaultClause"] = 298] = "DefaultClause"; + SyntaxKind5[SyntaxKind5["HeritageClause"] = 299] = "HeritageClause"; + SyntaxKind5[SyntaxKind5["CatchClause"] = 300] = "CatchClause"; + SyntaxKind5[SyntaxKind5["ImportAttributes"] = 301] = "ImportAttributes"; + SyntaxKind5[SyntaxKind5["ImportAttribute"] = 302] = "ImportAttribute"; + SyntaxKind5[SyntaxKind5["AssertClause"] = 301 /* ImportAttributes */] = "AssertClause"; + SyntaxKind5[SyntaxKind5["AssertEntry"] = 302 /* ImportAttribute */] = "AssertEntry"; + SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 303] = "ImportTypeAssertionContainer"; + SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 304] = "PropertyAssignment"; + SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 305] = "ShorthandPropertyAssignment"; + SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 306] = "SpreadAssignment"; + SyntaxKind5[SyntaxKind5["EnumMember"] = 307] = "EnumMember"; + SyntaxKind5[SyntaxKind5["SourceFile"] = 308] = "SourceFile"; + SyntaxKind5[SyntaxKind5["Bundle"] = 309] = "Bundle"; + SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 310] = "JSDocTypeExpression"; + SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 311] = "JSDocNameReference"; + SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 312] = "JSDocMemberName"; + SyntaxKind5[SyntaxKind5["JSDocAllType"] = 313] = "JSDocAllType"; + SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 314] = "JSDocUnknownType"; + SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 315] = "JSDocNullableType"; + SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 316] = "JSDocNonNullableType"; + SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 317] = "JSDocOptionalType"; + SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 318] = "JSDocFunctionType"; + SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 319] = "JSDocVariadicType"; + SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 320] = "JSDocNamepathType"; + SyntaxKind5[SyntaxKind5["JSDoc"] = 321] = "JSDoc"; + SyntaxKind5[SyntaxKind5["JSDocComment"] = 321 /* JSDoc */] = "JSDocComment"; + SyntaxKind5[SyntaxKind5["JSDocText"] = 322] = "JSDocText"; + SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 323] = "JSDocTypeLiteral"; + SyntaxKind5[SyntaxKind5["JSDocSignature"] = 324] = "JSDocSignature"; + SyntaxKind5[SyntaxKind5["JSDocLink"] = 325] = "JSDocLink"; + SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 326] = "JSDocLinkCode"; + SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 327] = "JSDocLinkPlain"; + SyntaxKind5[SyntaxKind5["JSDocTag"] = 328] = "JSDocTag"; + SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 329] = "JSDocAugmentsTag"; + SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 330] = "JSDocImplementsTag"; + SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 331] = "JSDocAuthorTag"; + SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 332] = "JSDocDeprecatedTag"; + SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 333] = "JSDocClassTag"; + SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 334] = "JSDocPublicTag"; + SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 335] = "JSDocPrivateTag"; + SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 336] = "JSDocProtectedTag"; + SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 337] = "JSDocReadonlyTag"; + SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 338] = "JSDocOverrideTag"; + SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 339] = "JSDocCallbackTag"; + SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 340] = "JSDocOverloadTag"; + SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 341] = "JSDocEnumTag"; + SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 342] = "JSDocParameterTag"; + SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 343] = "JSDocReturnTag"; + SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 344] = "JSDocThisTag"; + SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 345] = "JSDocTypeTag"; + SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 346] = "JSDocTemplateTag"; + SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 347] = "JSDocTypedefTag"; + SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 348] = "JSDocSeeTag"; + SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 349] = "JSDocPropertyTag"; + SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 350] = "JSDocThrowsTag"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 351] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["JSDocImportTag"] = 352] = "JSDocImportTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 353] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 354] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["NotEmittedTypeElement"] = 355] = "NotEmittedTypeElement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 357] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 358] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 359] = "Count"; SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment"; SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -5889,15 +5890,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 83 /* BreakKeyword */] = "FirstReservedWord"; SyntaxKind5[SyntaxKind5["LastReservedWord"] = 118 /* WithKeyword */] = "LastReservedWord"; SyntaxKind5[SyntaxKind5["FirstKeyword"] = 83 /* BreakKeyword */] = "FirstKeyword"; - SyntaxKind5[SyntaxKind5["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword"; + SyntaxKind5[SyntaxKind5["LastKeyword"] = 166 /* DeferKeyword */] = "LastKeyword"; SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 119 /* ImplementsKeyword */] = "FirstFutureReservedWord"; SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 127 /* YieldKeyword */] = "LastFutureReservedWord"; - SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode"; - SyntaxKind5[SyntaxKind5["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode"; + SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 183 /* TypePredicate */] = "FirstTypeNode"; + SyntaxKind5[SyntaxKind5["LastTypeNode"] = 206 /* ImportType */] = "LastTypeNode"; SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 19 /* OpenBraceToken */] = "FirstPunctuation"; SyntaxKind5[SyntaxKind5["LastPunctuation"] = 79 /* CaretEqualsToken */] = "LastPunctuation"; SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken"; - SyntaxKind5[SyntaxKind5["LastToken"] = 165 /* LastKeyword */] = "LastToken"; + SyntaxKind5[SyntaxKind5["LastToken"] = 166 /* LastKeyword */] = "LastToken"; SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken"; SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken"; SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 9 /* NumericLiteral */] = "FirstLiteralToken"; @@ -5906,15 +5907,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 18 /* TemplateTail */] = "LastTemplateToken"; SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 30 /* LessThanToken */] = "FirstBinaryOperator"; SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 79 /* CaretEqualsToken */] = "LastBinaryOperator"; - SyntaxKind5[SyntaxKind5["FirstStatement"] = 243 /* VariableStatement */] = "FirstStatement"; - SyntaxKind5[SyntaxKind5["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement"; - SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 309 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 351 /* JSDocImportTag */] = "LastJSDocNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 327 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 351 /* JSDocImportTag */] = "LastJSDocTagNode"; + SyntaxKind5[SyntaxKind5["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement"; + SyntaxKind5[SyntaxKind5["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement"; + SyntaxKind5[SyntaxKind5["FirstNode"] = 167 /* QualifiedName */] = "FirstNode"; + SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 310 /* JSDocTypeExpression */] = "FirstJSDocNode"; + SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 352 /* JSDocImportTag */] = "LastJSDocNode"; + SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 328 /* JSDocTag */] = "FirstJSDocTagNode"; + SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 352 /* JSDocImportTag */] = "LastJSDocTagNode"; SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword"; - SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword"; + SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 166 /* LastKeyword */] = "LastContextualKeyword"; return SyntaxKind5; })(SyntaxKind || {}); var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { @@ -6522,6 +6523,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType"; ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed"; ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables"; + ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType"; ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface"; ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening"; ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags"; @@ -6530,7 +6532,6 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread"; ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType"; ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType"; - ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType"; ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone"; ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated"; ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists"; @@ -6735,6 +6736,7 @@ var ModuleKind = /* @__PURE__ */ ((ModuleKind3) => { ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext"; ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16"; ModuleKind3[ModuleKind3["Node18"] = 101] = "Node18"; + ModuleKind3[ModuleKind3["Node20"] = 102] = "Node20"; ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext"; ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve"; return ModuleKind3; @@ -6788,10 +6790,10 @@ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget12) => { ScriptTarget12[ScriptTarget12["Latest"] = 99 /* ESNext */] = "Latest"; return ScriptTarget12; })(ScriptTarget || {}); -var LanguageVariant = /* @__PURE__ */ ((LanguageVariant4) => { - LanguageVariant4[LanguageVariant4["Standard"] = 0] = "Standard"; - LanguageVariant4[LanguageVariant4["JSX"] = 1] = "JSX"; - return LanguageVariant4; +var LanguageVariant = /* @__PURE__ */ ((LanguageVariant3) => { + LanguageVariant3[LanguageVariant3["Standard"] = 0] = "Standard"; + LanguageVariant3[LanguageVariant3["JSX"] = 1] = "JSX"; + return LanguageVariant3; })(LanguageVariant || {}); var WatchDirectoryFlags = /* @__PURE__ */ ((WatchDirectoryFlags3) => { WatchDirectoryFlags3[WatchDirectoryFlags3["None"] = 0] = "None"; @@ -9398,15 +9400,16 @@ var Diagnostics = { An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), - ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax: diag(1286, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'."), A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."), _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."), _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."), _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."), - ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."), + ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."), This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."), + ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript: diag(1295, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), @@ -9421,8 +9424,8 @@ var Diagnostics = { Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1 /* Error */, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."), Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1 /* Error */, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."), Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1 /* Error */, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."), - Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."), - Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."), + Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'."), + Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'."), Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1 /* Error */, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."), This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1 /* Error */, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."), String_literal_with_double_quotes_expected: diag(1327, 1 /* Error */, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), @@ -9439,7 +9442,7 @@ var Diagnostics = { Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'."), A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1 /* Error */, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), @@ -9469,7 +9472,7 @@ var Diagnostics = { await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), _0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."), _0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."), - Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."), An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), @@ -9520,7 +9523,7 @@ var Diagnostics = { File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"), The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), - Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), @@ -9633,6 +9636,8 @@ var Diagnostics = { Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1542, 1 /* Error */, "Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542", "Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."), Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0: diag(1543, 1 /* Error */, "Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543", `Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`), Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0: diag(1544, 1 /* Error */, "Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544", "Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."), + using_declarations_are_not_allowed_in_ambient_contexts: diag(1545, 1 /* Error */, "using_declarations_are_not_allowed_in_ambient_contexts_1545", "'using' declarations are not allowed in ambient contexts."), + await_using_declarations_are_not_allowed_in_ambient_contexts: diag(1546, 1 /* Error */, "await_using_declarations_are_not_allowed_in_ambient_contexts_1546", "'await using' declarations are not allowed in ambient contexts."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -9726,6 +9731,7 @@ var Diagnostics = { This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."), Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1 /* Error */, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."), Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."), + Call_target_does_not_contain_any_signatures: diag(2346, 1 /* Error */, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."), Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1 /* Error */, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."), Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1 /* Error */, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"), This_expression_is_not_callable: diag(2349, 1 /* Error */, "This_expression_is_not_callable_2349", "This expression is not callable."), @@ -10067,7 +10073,7 @@ var Diagnostics = { Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1 /* Error */, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), - Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), + Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 and above with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."), @@ -10156,15 +10162,15 @@ var Diagnostics = { Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), Class_declaration_cannot_implement_overload_list_for_0: diag(2813, 1 /* Error */, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."), Function_with_bodies_can_only_merge_with_classes_that_are_ambient: diag(2814, 1 /* Error */, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."), - arguments_cannot_be_referenced_in_property_initializers: diag(2815, 1 /* Error */, "arguments_cannot_be_referenced_in_property_initializers_2815", "'arguments' cannot be referenced in property initializers."), + arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks: diag(2815, 1 /* Error */, "arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815", "'arguments' cannot be referenced in property initializers or class static initialization blocks."), Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: diag(2816, 1 /* Error */, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, 1 /* Error */, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."), Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."), Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."), Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"), - Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."), + Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'."), Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."), - Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."), + Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'."), Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"), Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."), Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"), @@ -10184,7 +10190,7 @@ var Diagnostics = { The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1 /* Error */, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."), await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."), await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), - Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."), Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."), Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."), @@ -10211,6 +10217,7 @@ var Diagnostics = { This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."), Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."), Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."), + This_expression_is_never_nullish: diag(2881, 1 /* Error */, "This_expression_is_never_nullish_2881", "This expression is never nullish."), Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -10678,6 +10685,15 @@ var Diagnostics = { package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."), Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."), Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."), + File_Layout: diag(6284, 3 /* Message */, "File_Layout_6284", "File Layout"), + Environment_Settings: diag(6285, 3 /* Message */, "Environment_Settings_6285", "Environment Settings"), + See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule: diag(6286, 3 /* Message */, "See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule_6286", "See also https://aka.ms/tsconfig/module"), + For_nodejs_Colon: diag(6287, 3 /* Message */, "For_nodejs_Colon_6287", "For nodejs:"), + and_npm_install_D_types_Slashnode: diag(6290, 3 /* Message */, "and_npm_install_D_types_Slashnode_6290", "and npm install -D @types/node"), + Other_Outputs: diag(6291, 3 /* Message */, "Other_Outputs_6291", "Other Outputs"), + Stricter_Typechecking_Options: diag(6292, 3 /* Message */, "Stricter_Typechecking_Options_6292", "Stricter Typechecking Options"), + Style_Options: diag(6293, 3 /* Message */, "Style_Options_6293", "Style Options"), + Recommended_Options: diag(6294, 3 /* Message */, "Recommended_Options_6294", "Recommended Options"), Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), @@ -10777,7 +10793,7 @@ var Diagnostics = { File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, 1 /* Error */, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, 3 /* Message */, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."), Consider_adding_a_declare_modifier_to_this_class: diag(6506, 3 /* Message */, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."), - Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."), + Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files."), Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, 3 /* Message */, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."), Allow_accessing_UMD_globals_from_modules: diag(6602, 3 /* Message */, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."), Disable_error_reporting_for_unreachable_code: diag(6603, 3 /* Message */, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."), @@ -11397,7 +11413,11 @@ var Diagnostics = { await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."), _0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."), Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."), - String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.") + String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'."), + Default_imports_are_not_allowed_in_a_deferred_import: diag(18058, 1 /* Error */, "Default_imports_are_not_allowed_in_a_deferred_import_18058", "Default imports are not allowed in a deferred import."), + Named_imports_are_not_allowed_in_a_deferred_import: diag(18059, 1 /* Error */, "Named_imports_are_not_allowed_in_a_deferred_import_18059", "Named imports are not allowed in a deferred import."), + Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve: diag(18060, 1 /* Error */, "Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve_18060", "Deferred imports are only supported when the '--module' flag is set to 'esnext' or 'preserve'."), + _0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer: diag(18061, 1 /* Error */, "_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer_18061", "'{0}' is not a valid meta-property for keyword 'import'. Did you mean 'meta' or 'defer'?") }; // src/compiler/scanner.ts @@ -11426,6 +11446,7 @@ var textToKeywordObj = { debugger: 89 /* DebuggerKeyword */, declare: 138 /* DeclareKeyword */, default: 90 /* DefaultKeyword */, + defer: 166 /* DeferKeyword */, delete: 91 /* DeleteKeyword */, do: 92 /* DoKeyword */, else: 93 /* ElseKeyword */, @@ -14800,16 +14821,16 @@ function collapseTextChangeRangesAcrossMultipleVersions(changes) { ); } function getTypeParameterOwner(d) { - if (d && d.kind === 168 /* TypeParameter */) { + if (d && d.kind === 169 /* TypeParameter */) { for (let current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 264 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 265 /* InterfaceDeclaration */) { return current; } } } } function isParameterPropertyDeclaration(node, parent2) { - return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 177 /* Constructor */; } function isEmptyBindingPattern(node) { if (isBindingPattern(node)) { @@ -14835,14 +14856,14 @@ function getCombinedFlags(node, getFlags) { node = walkUpBindingElementsAndPatterns(node); } let flags = getFlags(node); - if (node.kind === 260 /* VariableDeclaration */) { + if (node.kind === 261 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 261 /* VariableDeclarationList */) { + if (node && node.kind === 262 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 243 /* VariableStatement */) { + if (node && node.kind === 244 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -14978,30 +14999,30 @@ function nameForNamelessJSDocTypedef(declaration) { return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: let expr = hostNode.expression; - if (expr.kind === 226 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { + if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return expr.name; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 217 /* ParenthesizedExpression */: { + case 218 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 256 /* LabeledStatement */: { + case 257 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -15032,16 +15053,16 @@ function getNonAssignedNameOfDeclaration(declaration) { switch (declaration.kind) { case 80 /* Identifier */: return declaration; - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: { + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: { const { name } = declaration; - if (name.kind === 166 /* QualifiedName */) { + if (name.kind === 167 /* QualifiedName */) { return name.right; } break; } - case 213 /* CallExpression */: - case 226 /* BinaryExpression */: { + case 214 /* CallExpression */: + case 227 /* BinaryExpression */: { const expr2 = declaration; switch (getAssignmentDeclarationKind(expr2)) { case 1 /* ExportsProperty */: @@ -15057,15 +15078,15 @@ function getNonAssignedNameOfDeclaration(declaration) { return void 0; } } - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 340 /* JSDocEnumTag */: + case 341 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { const { expression } = declaration; return isIdentifier(expression) ? expression : void 0; } - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const expr = declaration; if (isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -15303,10 +15324,10 @@ function getAllJSDocTagsOfKind(node, kind) { return getJSDocTags(node).filter((doc) => doc.kind === kind); } function getTextOfJSDocComment(comment) { - return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 321 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); + return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 322 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); } function formatJSDocLink(link) { - const kind = link.kind === 324 /* JSDocLink */ ? "link" : link.kind === 325 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; + const kind = link.kind === 325 /* JSDocLink */ ? "link" : link.kind === 326 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; const name = link.name ? entityNameToString(link.name) : ""; const space = link.name && (link.text === "" || link.text.startsWith("://")) ? "" : " "; return `{@${kind} ${name}${space}${link.text}}`; @@ -15322,7 +15343,7 @@ function getEffectiveTypeParameterDeclarations(node) { return emptyArray; } if (isJSDocTypeAlias(node)) { - Debug.assert(node.parent.kind === 320 /* JSDoc */); + Debug.assert(node.parent.kind === 321 /* JSDoc */); return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); } if (node.typeParameters) { @@ -15350,7 +15371,7 @@ function isMemberName(node) { return node.kind === 80 /* Identifier */ || node.kind === 81 /* PrivateIdentifier */; } function isGetOrSetAccessorDeclaration(node) { - return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */; + return node.kind === 179 /* SetAccessor */ || node.kind === 178 /* GetAccessor */; } function isPropertyAccessChain(node) { return isPropertyAccessExpression(node) && !!(node.flags & 64 /* OptionalChain */); @@ -15363,7 +15384,7 @@ function isCallChain(node) { } function isOptionalChain(node) { const kind = node.kind; - return !!(node.flags & 64 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 235 /* NonNullExpression */); + return !!(node.flags & 64 /* OptionalChain */) && (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */ || kind === 214 /* CallExpression */ || kind === 236 /* NonNullExpression */); } function isOptionalChainRoot(node) { return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; @@ -15375,7 +15396,7 @@ function isOutermostOptionalChain(node) { return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; } function isNullishCoalesce(node) { - return node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; + return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; } function isConstTypeReference(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments; @@ -15387,19 +15408,19 @@ function isNonNullChain(node) { return isNonNullExpression(node) && !!(node.flags & 64 /* OptionalChain */); } function isBreakOrContinueStatement(node) { - return node.kind === 252 /* BreakStatement */ || node.kind === 251 /* ContinueStatement */; + return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */; } function isNamedExportBindings(node) { - return node.kind === 280 /* NamespaceExport */ || node.kind === 279 /* NamedExports */; + return node.kind === 281 /* NamespaceExport */ || node.kind === 280 /* NamedExports */; } function isJSDocPropertyLikeTag(node) { - return node.kind === 348 /* JSDocPropertyTag */ || node.kind === 341 /* JSDocParameterTag */; + return node.kind === 349 /* JSDocPropertyTag */ || node.kind === 342 /* JSDocParameterTag */; } function isNodeKind(kind) { - return kind >= 166 /* FirstNode */; + return kind >= 167 /* FirstNode */; } function isTokenKind(kind) { - return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */; + return kind >= 0 /* FirstToken */ && kind <= 166 /* LastToken */; } function isToken(n) { return isTokenKind(n.kind); @@ -15415,11 +15436,11 @@ function isLiteralExpression(node) { } function isLiteralExpressionOfObject(node) { switch (node.kind) { - case 210 /* ObjectLiteralExpression */: - case 209 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 210 /* ArrayLiteralExpression */: case 14 /* RegularExpressionLiteral */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: return true; } return false; @@ -15439,23 +15460,24 @@ function isImportOrExportSpecifier(node) { } function isTypeOnlyImportDeclaration(node) { switch (node.kind) { - case 276 /* ImportSpecifier */: - return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 274 /* NamespaceImport */: - return node.parent.isTypeOnly; - case 273 /* ImportClause */: - case 271 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + return node.isTypeOnly || node.parent.parent.phaseModifier === 156 /* TypeKeyword */; + case 275 /* NamespaceImport */: + return node.parent.phaseModifier === 156 /* TypeKeyword */; + case 274 /* ImportClause */: + return node.phaseModifier === 156 /* TypeKeyword */; + case 272 /* ImportEqualsDeclaration */: return node.isTypeOnly; } return false; } function isTypeOnlyExportDeclaration(node) { switch (node.kind) { - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: return node.parent.isTypeOnly; } return false; @@ -15522,15 +15544,15 @@ function isModifier(node) { } function isEntityName(node) { const kind = node.kind; - return kind === 166 /* QualifiedName */ || kind === 80 /* Identifier */; + return kind === 167 /* QualifiedName */ || kind === 80 /* Identifier */; } function isPropertyName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 81 /* PrivateIdentifier */ || kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */; + return kind === 80 /* Identifier */ || kind === 81 /* PrivateIdentifier */ || kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */ || kind === 168 /* ComputedPropertyName */; } function isBindingName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */; + return kind === 80 /* Identifier */ || kind === 207 /* ObjectBindingPattern */ || kind === 208 /* ArrayBindingPattern */; } function isFunctionLike(node) { return !!node && isFunctionLikeKind(node.kind); @@ -15546,13 +15568,13 @@ function isBooleanLiteral(node) { } function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; default: return false; @@ -15560,14 +15582,14 @@ function isFunctionLikeDeclarationKind(kind) { } function isFunctionLikeKind(kind) { switch (kind) { - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 323 /* JSDocSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 184 /* FunctionType */: - case 317 /* JSDocFunctionType */: - case 185 /* ConstructorType */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 324 /* JSDocSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 185 /* FunctionType */: + case 318 /* JSDocFunctionType */: + case 186 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -15578,13 +15600,13 @@ function isFunctionOrModuleBlock(node) { } function isClassElement(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 240 /* SemicolonClassElement */; + return kind === 177 /* Constructor */ || kind === 173 /* PropertyDeclaration */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 182 /* IndexSignature */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */; } function isClassLike(node) { - return node && (node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */); + return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */); } function isAccessor(node) { - return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */); + return node && (node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */); } function isAutoAccessorPropertyDeclaration(node) { return isPropertyDeclaration(node) && hasAccessorModifier(node); @@ -15601,9 +15623,9 @@ function isClassInstanceProperty(node) { } function isMethodOrAccessor(node) { switch (node.kind) { - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; default: return false; @@ -15614,22 +15636,22 @@ function isModifierLike(node) { } function isTypeElement(node) { const kind = node.kind; - return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 354 /* NotEmittedTypeElement */; + return kind === 181 /* ConstructSignature */ || kind === 180 /* CallSignature */ || kind === 172 /* PropertySignature */ || kind === 174 /* MethodSignature */ || kind === 182 /* IndexSignature */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 355 /* NotEmittedTypeElement */; } function isClassOrTypeElement(node) { return isTypeElement(node) || isClassElement(node); } function isObjectLiteralElementLike(node) { const kind = node.kind; - return kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 305 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 306 /* SpreadAssignment */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function isTypeNode(node) { return isTypeNodeKind(node.kind); } function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 184 /* FunctionType */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: return true; } return false; @@ -15637,23 +15659,23 @@ function isFunctionOrConstructorTypeNode(node) { function isBindingPattern(node) { if (node) { const kind = node.kind; - return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */; + return kind === 208 /* ArrayBindingPattern */ || kind === 207 /* ObjectBindingPattern */; } return false; } function isAssignmentPattern(node) { const kind = node.kind; - return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */; + return kind === 210 /* ArrayLiteralExpression */ || kind === 211 /* ObjectLiteralExpression */; } function isArrayBindingElement(node) { const kind = node.kind; - return kind === 208 /* BindingElement */ || kind === 232 /* OmittedExpression */; + return kind === 209 /* BindingElement */ || kind === 233 /* OmittedExpression */; } function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: return true; } return false; @@ -15666,48 +15688,48 @@ function isBindingOrAssignmentPattern(node) { } function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 206 /* ObjectBindingPattern */: - case 210 /* ObjectLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 211 /* ObjectLiteralExpression */: return true; } return false; } function isObjectBindingOrAssignmentElement(node) { switch (node.kind) { - case 208 /* BindingElement */: - case 303 /* PropertyAssignment */: + case 209 /* BindingElement */: + case 304 /* PropertyAssignment */: // AssignmentProperty - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: // AssignmentProperty - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return true; } return false; } function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 207 /* ArrayBindingPattern */: - case 209 /* ArrayLiteralExpression */: + case 208 /* ArrayBindingPattern */: + case 210 /* ArrayLiteralExpression */: return true; } return false; } function isArrayBindingOrAssignmentElement(node) { switch (node.kind) { - case 208 /* BindingElement */: - case 232 /* OmittedExpression */: + case 209 /* BindingElement */: + case 233 /* OmittedExpression */: // Elision - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: // AssignmentRestElement - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: // ArrayAssignmentPattern - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: // ObjectAssignmentPattern case 80 /* Identifier */: // DestructuringAssignmentTarget - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: // DestructuringAssignmentTarget - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return true; } return isAssignmentExpression( @@ -15718,56 +15740,56 @@ function isArrayBindingOrAssignmentElement(node) { } function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; - return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */; + return kind === 212 /* PropertyAccessExpression */ || kind === 167 /* QualifiedName */ || kind === 206 /* ImportType */; } function isPropertyAccessOrQualifiedName(node) { const kind = node.kind; - return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */; + return kind === 212 /* PropertyAccessExpression */ || kind === 167 /* QualifiedName */; } function isCallLikeOrFunctionLikeExpression(node) { return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node); } function isCallLikeExpression(node) { switch (node.kind) { - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: - case 170 /* Decorator */: - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: - case 289 /* JsxOpeningFragment */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: + case 171 /* Decorator */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: + case 290 /* JsxOpeningFragment */: return true; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return node.operatorToken.kind === 104 /* InstanceOfKeyword */; default: return false; } } function isCallOrNewExpression(node) { - return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */; + return node.kind === 214 /* CallExpression */ || node.kind === 215 /* NewExpression */; } function isTemplateLiteral(node) { const kind = node.kind; - return kind === 228 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; + return kind === 229 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); } function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 214 /* NewExpression */: - case 213 /* CallExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: - case 215 /* TaggedTemplateExpression */: - case 209 /* ArrayLiteralExpression */: - case 217 /* ParenthesizedExpression */: - case 210 /* ObjectLiteralExpression */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 215 /* NewExpression */: + case 214 /* CallExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: + case 216 /* TaggedTemplateExpression */: + case 210 /* ArrayLiteralExpression */: + case 218 /* ParenthesizedExpression */: + case 211 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: case 80 /* Identifier */: case 81 /* PrivateIdentifier */: // technically this is only an Expression if it's in a `#field in expr` BinaryExpression @@ -15776,18 +15798,18 @@ function isLeftHandSideExpressionKind(kind) { case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 110 /* ThisKeyword */: case 112 /* TrueKeyword */: case 108 /* SuperKeyword */: - case 235 /* NonNullExpression */: - case 233 /* ExpressionWithTypeArguments */: - case 236 /* MetaProperty */: + case 236 /* NonNullExpression */: + case 234 /* ExpressionWithTypeArguments */: + case 237 /* MetaProperty */: case 102 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return true; default: return false; @@ -15798,13 +15820,13 @@ function isUnaryExpression(node) { } function isUnaryExpressionKind(kind) { switch (kind) { - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: - case 220 /* DeleteExpression */: - case 221 /* TypeOfExpression */: - case 222 /* VoidExpression */: - case 223 /* AwaitExpression */: - case 216 /* TypeAssertionExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: + case 221 /* DeleteExpression */: + case 222 /* TypeOfExpression */: + case 223 /* VoidExpression */: + case 224 /* AwaitExpression */: + case 217 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -15812,9 +15834,9 @@ function isUnaryExpressionKind(kind) { } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return true; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; default: return false; @@ -15825,7 +15847,7 @@ function isLiteralTypeLiteral(node) { case 106 /* NullKeyword */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return true; default: return isLiteralExpression(node); @@ -15836,16 +15858,16 @@ function isExpression(node) { } function isExpressionKind(kind) { switch (kind) { - case 227 /* ConditionalExpression */: - case 229 /* YieldExpression */: - case 219 /* ArrowFunction */: - case 226 /* BinaryExpression */: - case 230 /* SpreadElement */: - case 234 /* AsExpression */: - case 232 /* OmittedExpression */: - case 356 /* CommaListExpression */: - case 355 /* PartiallyEmittedExpression */: - case 238 /* SatisfiesExpression */: + case 228 /* ConditionalExpression */: + case 230 /* YieldExpression */: + case 220 /* ArrowFunction */: + case 227 /* BinaryExpression */: + case 231 /* SpreadElement */: + case 235 /* AsExpression */: + case 233 /* OmittedExpression */: + case 357 /* CommaListExpression */: + case 356 /* PartiallyEmittedExpression */: + case 239 /* SatisfiesExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -15853,17 +15875,17 @@ function isExpressionKind(kind) { } function isAssertionExpression(node) { const kind = node.kind; - return kind === 216 /* TypeAssertionExpression */ || kind === 234 /* AsExpression */; + return kind === 217 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */; } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return true; - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -15881,7 +15903,7 @@ function isExternalModuleIndicator(result) { return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */); } function isForInOrOfStatement(node) { - return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */; + return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */; } function isConciseBody(node) { return isBlock(node) || isExpression(node); @@ -15894,89 +15916,89 @@ function isForInitializer(node) { } function isModuleBody(node) { const kind = node.kind; - return kind === 268 /* ModuleBlock */ || kind === 267 /* ModuleDeclaration */ || kind === 80 /* Identifier */; + return kind === 269 /* ModuleBlock */ || kind === 268 /* ModuleDeclaration */ || kind === 80 /* Identifier */; } function isNamespaceBody(node) { const kind = node.kind; - return kind === 268 /* ModuleBlock */ || kind === 267 /* ModuleDeclaration */; + return kind === 269 /* ModuleBlock */ || kind === 268 /* ModuleDeclaration */; } function isJSDocNamespaceBody(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 267 /* ModuleDeclaration */; + return kind === 80 /* Identifier */ || kind === 268 /* ModuleDeclaration */; } function isNamedImportBindings(node) { const kind = node.kind; - return kind === 275 /* NamedImports */ || kind === 274 /* NamespaceImport */; + return kind === 276 /* NamedImports */ || kind === 275 /* NamespaceImport */; } function isModuleOrEnumDeclaration(node) { - return node.kind === 267 /* ModuleDeclaration */ || node.kind === 266 /* EnumDeclaration */; + return node.kind === 268 /* ModuleDeclaration */ || node.kind === 267 /* EnumDeclaration */; } function canHaveSymbol(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 226 /* BinaryExpression */: - case 208 /* BindingElement */: - case 213 /* CallExpression */: - case 179 /* CallSignature */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 175 /* ClassStaticBlockDeclaration */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: - case 212 /* ElementAccessExpression */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: - case 281 /* ExportSpecifier */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 177 /* GetAccessor */: + case 220 /* ArrowFunction */: + case 227 /* BinaryExpression */: + case 209 /* BindingElement */: + case 214 /* CallExpression */: + case 180 /* CallSignature */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 176 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 213 /* ElementAccessExpression */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: + case 282 /* ExportSpecifier */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 178 /* GetAccessor */: case 80 /* Identifier */: - case 273 /* ImportClause */: - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 181 /* IndexSignature */: - case 264 /* InterfaceDeclaration */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 317 /* JSDocFunctionType */: - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: - case 323 /* JSDocSignature */: - case 346 /* JSDocTypedefTag */: - case 322 /* JSDocTypeLiteral */: - case 291 /* JsxAttribute */: - case 292 /* JsxAttributes */: - case 293 /* JsxSpreadAttribute */: - case 200 /* MappedType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 267 /* ModuleDeclaration */: - case 202 /* NamedTupleMember */: - case 280 /* NamespaceExport */: - case 270 /* NamespaceExportDeclaration */: - case 274 /* NamespaceImport */: - case 214 /* NewExpression */: + case 274 /* ImportClause */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 182 /* IndexSignature */: + case 265 /* InterfaceDeclaration */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 318 /* JSDocFunctionType */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 324 /* JSDocSignature */: + case 347 /* JSDocTypedefTag */: + case 323 /* JSDocTypeLiteral */: + case 292 /* JsxAttribute */: + case 293 /* JsxAttributes */: + case 294 /* JsxSpreadAttribute */: + case 201 /* MappedType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 268 /* ModuleDeclaration */: + case 203 /* NamedTupleMember */: + case 281 /* NamespaceExport */: + case 271 /* NamespaceExportDeclaration */: + case 275 /* NamespaceImport */: + case 215 /* NewExpression */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: - case 210 /* ObjectLiteralExpression */: - case 169 /* Parameter */: - case 211 /* PropertyAccessExpression */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 178 /* SetAccessor */: - case 304 /* ShorthandPropertyAssignment */: - case 307 /* SourceFile */: - case 305 /* SpreadAssignment */: + case 211 /* ObjectLiteralExpression */: + case 170 /* Parameter */: + case 212 /* PropertyAccessExpression */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 179 /* SetAccessor */: + case 305 /* ShorthandPropertyAssignment */: + case 308 /* SourceFile */: + case 306 /* SpreadAssignment */: case 11 /* StringLiteral */: - case 265 /* TypeAliasDeclaration */: - case 187 /* TypeLiteral */: - case 168 /* TypeParameter */: - case 260 /* VariableDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 188 /* TypeLiteral */: + case 169 /* TypeParameter */: + case 261 /* VariableDeclaration */: return true; default: return false; @@ -15984,53 +16006,53 @@ function canHaveSymbol(node) { } function canHaveLocals(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 241 /* Block */: - case 179 /* CallSignature */: - case 269 /* CaseBlock */: - case 299 /* CatchClause */: - case 175 /* ClassStaticBlockDeclaration */: - case 194 /* ConditionalType */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 177 /* GetAccessor */: - case 181 /* IndexSignature */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: - case 346 /* JSDocTypedefTag */: - case 200 /* MappedType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 267 /* ModuleDeclaration */: - case 178 /* SetAccessor */: - case 307 /* SourceFile */: - case 265 /* TypeAliasDeclaration */: + case 220 /* ArrowFunction */: + case 242 /* Block */: + case 180 /* CallSignature */: + case 270 /* CaseBlock */: + case 300 /* CatchClause */: + case 176 /* ClassStaticBlockDeclaration */: + case 195 /* ConditionalType */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 178 /* GetAccessor */: + case 182 /* IndexSignature */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: + case 347 /* JSDocTypedefTag */: + case 201 /* MappedType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 268 /* ModuleDeclaration */: + case 179 /* SetAccessor */: + case 308 /* SourceFile */: + case 266 /* TypeAliasDeclaration */: return true; default: return false; } } function isDeclarationKind(kind) { - return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 263 /* ClassDeclaration */ || kind === 231 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 176 /* Constructor */ || kind === 266 /* EnumDeclaration */ || kind === 306 /* EnumMember */ || kind === 281 /* ExportSpecifier */ || kind === 262 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 273 /* ImportClause */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 276 /* ImportSpecifier */ || kind === 264 /* InterfaceDeclaration */ || kind === 291 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 267 /* ModuleDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 274 /* NamespaceImport */ || kind === 280 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 303 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 265 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 260 /* VariableDeclaration */ || kind === 346 /* JSDocTypedefTag */ || kind === 338 /* JSDocCallbackTag */ || kind === 348 /* JSDocPropertyTag */ || kind === 202 /* NamedTupleMember */; + return kind === 220 /* ArrowFunction */ || kind === 209 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 177 /* Constructor */ || kind === 267 /* EnumDeclaration */ || kind === 307 /* EnumMember */ || kind === 282 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* FunctionExpression */ || kind === 178 /* GetAccessor */ || kind === 274 /* ImportClause */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 277 /* ImportSpecifier */ || kind === 265 /* InterfaceDeclaration */ || kind === 292 /* JsxAttribute */ || kind === 175 /* MethodDeclaration */ || kind === 174 /* MethodSignature */ || kind === 268 /* ModuleDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 275 /* NamespaceImport */ || kind === 281 /* NamespaceExport */ || kind === 170 /* Parameter */ || kind === 304 /* PropertyAssignment */ || kind === 173 /* PropertyDeclaration */ || kind === 172 /* PropertySignature */ || kind === 179 /* SetAccessor */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 266 /* TypeAliasDeclaration */ || kind === 169 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 347 /* JSDocTypedefTag */ || kind === 339 /* JSDocCallbackTag */ || kind === 349 /* JSDocPropertyTag */ || kind === 203 /* NamedTupleMember */; } function isDeclarationStatementKind(kind) { - return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */; + return kind === 263 /* FunctionDeclaration */ || kind === 283 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 278 /* ExportAssignment */ || kind === 271 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 353 /* NotEmittedStatement */; + return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 354 /* NotEmittedStatement */; } function isDeclaration(node) { - if (node.kind === 168 /* TypeParameter */) { - return node.parent && node.parent.kind !== 345 /* JSDocTemplateTag */ || isInJSFile(node); + if (node.kind === 169 /* TypeParameter */) { + return node.parent && node.parent.kind !== 346 /* JSDocTemplateTag */ || isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -16045,9 +16067,9 @@ function isStatement(node) { return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); } function isBlockStatement(node) { - if (node.kind !== 241 /* Block */) return false; + if (node.kind !== 242 /* Block */) return false; if (node.parent !== void 0) { - if (node.parent.kind === 258 /* TryStatement */ || node.parent.kind === 299 /* CatchClause */) { + if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 300 /* CatchClause */) { return false; } } @@ -16055,54 +16077,54 @@ function isBlockStatement(node) { } function isStatementOrBlock(node) { const kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 241 /* Block */; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */; } function isModuleReference(node) { const kind = node.kind; - return kind === 283 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 80 /* Identifier */; + return kind === 284 /* ExternalModuleReference */ || kind === 167 /* QualifiedName */ || kind === 80 /* Identifier */; } function isJsxTagNameExpression(node) { const kind = node.kind; - return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 211 /* PropertyAccessExpression */ || kind === 295 /* JsxNamespacedName */; + return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 212 /* PropertyAccessExpression */ || kind === 296 /* JsxNamespacedName */; } function isJsxChild(node) { const kind = node.kind; - return kind === 284 /* JsxElement */ || kind === 294 /* JsxExpression */ || kind === 285 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 288 /* JsxFragment */; + return kind === 285 /* JsxElement */ || kind === 295 /* JsxExpression */ || kind === 286 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 289 /* JsxFragment */; } function isJsxAttributeLike(node) { const kind = node.kind; - return kind === 291 /* JsxAttribute */ || kind === 293 /* JsxSpreadAttribute */; + return kind === 292 /* JsxAttribute */ || kind === 294 /* JsxSpreadAttribute */; } function isStringLiteralOrJsxExpression(node) { const kind = node.kind; - return kind === 11 /* StringLiteral */ || kind === 294 /* JsxExpression */; + return kind === 11 /* StringLiteral */ || kind === 295 /* JsxExpression */; } function isJsxOpeningLikeElement(node) { const kind = node.kind; - return kind === 286 /* JsxOpeningElement */ || kind === 285 /* JsxSelfClosingElement */; + return kind === 287 /* JsxOpeningElement */ || kind === 286 /* JsxSelfClosingElement */; } function isJsxCallLike(node) { const kind = node.kind; - return kind === 286 /* JsxOpeningElement */ || kind === 285 /* JsxSelfClosingElement */ || kind === 289 /* JsxOpeningFragment */; + return kind === 287 /* JsxOpeningElement */ || kind === 286 /* JsxSelfClosingElement */ || kind === 290 /* JsxOpeningFragment */; } function isCaseOrDefaultClause(node) { const kind = node.kind; - return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */; + return kind === 297 /* CaseClause */ || kind === 298 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 309 /* FirstJSDocNode */ && node.kind <= 351 /* LastJSDocNode */; + return node.kind >= 310 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */; } function isJSDocCommentContainingNode(node) { - return node.kind === 320 /* JSDoc */ || node.kind === 319 /* JSDocNamepathType */ || node.kind === 321 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 321 /* JSDoc */ || node.kind === 320 /* JSDocNamepathType */ || node.kind === 322 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } function isJSDocTag(node) { - return node.kind >= 327 /* FirstJSDocTagNode */ && node.kind <= 351 /* LastJSDocTagNode */; + return node.kind >= 328 /* FirstJSDocTagNode */ && node.kind <= 352 /* LastJSDocTagNode */; } function isSetAccessor(node) { - return node.kind === 178 /* SetAccessor */; + return node.kind === 179 /* SetAccessor */; } function isGetAccessor(node) { - return node.kind === 177 /* GetAccessor */; + return node.kind === 178 /* GetAccessor */; } function hasJSDocNodes(node) { if (!canHaveJSDoc(node)) return false; @@ -16117,22 +16139,22 @@ function hasInitializer(node) { } function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 303 /* PropertyAssignment */: - case 306 /* EnumMember */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 304 /* PropertyAssignment */: + case 307 /* EnumMember */: return true; default: return false; } } function isObjectLiteralElement(node) { - return node.kind === 291 /* JsxAttribute */ || node.kind === 293 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 292 /* JsxAttribute */ || node.kind === 294 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } function isTypeReferenceType(node) { - return node.kind === 183 /* TypeReference */ || node.kind === 233 /* ExpressionWithTypeArguments */; + return node.kind === 184 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */; } var MAX_SMI_X86 = 1073741823; function guessIndentation(lines) { @@ -16160,7 +16182,7 @@ function isStringLiteralLike(node) { return node.kind === 11 /* StringLiteral */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */; } function isJSDocLinkLike(node) { - return node.kind === 324 /* JSDocLink */ || node.kind === 325 /* JSDocLinkCode */ || node.kind === 326 /* JSDocLinkPlain */; + return node.kind === 325 /* JSDocLink */ || node.kind === 326 /* JSDocLinkCode */ || node.kind === 327 /* JSDocLinkPlain */; } function hasRestParameter(s) { const last2 = lastOrUndefined(s.parameters); @@ -16168,7 +16190,7 @@ function hasRestParameter(s) { } function isRestParameter(node) { const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type; - return node.dotDotDotToken !== void 0 || !!type && type.kind === 318 /* JSDocVariadicType */; + return node.dotDotDotToken !== void 0 || !!type && type.kind === 319 /* JSDocVariadicType */; } function hasInternalAnnotation(range, sourceFile) { const comment = sourceFile.text.substring(range.pos, range.end); @@ -16177,7 +16199,7 @@ function hasInternalAnnotation(range, sourceFile) { function isInternalDeclaration(node, sourceFile) { sourceFile ?? (sourceFile = getSourceFileOfNode(node)); const parseTreeNode = getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 170 /* Parameter */) { const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; const text = sourceFile.text; @@ -16215,6 +16237,7 @@ var resolvingEmptyArray = []; var externalHelpersModuleNameText = "tslib"; var defaultMaximumTruncationLength = 160; var noTruncationMaximumTruncationLength = 1e6; +var defaultHoverMaximumTruncationLength = 500; function getDeclarationOfKind(symbol, kind) { const declarations = symbol.declarations; if (declarations) { @@ -16450,7 +16473,7 @@ function aggregateChildData(node) { } } function getSourceFileOfNode(node) { - while (node && node.kind !== 307 /* SourceFile */) { + while (node && node.kind !== 308 /* SourceFile */) { node = node.parent; } return node; @@ -16463,11 +16486,11 @@ function isPlainJsFile(file, checkJs) { } function isStatementWithLocals(node) { switch (node.kind) { - case 241 /* Block */: - case 269 /* CaseBlock */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 242 /* Block */: + case 270 /* CaseBlock */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return true; } return false; @@ -16612,7 +16635,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) { if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 352 /* SyntaxList */) { + if (node.kind === 353 /* SyntaxList */) { sourceFile ?? (sourceFile = getSourceFileOfNode(node)); const first2 = firstOrUndefined(getNodeChildren(node, sourceFile)); if (first2) { @@ -16752,6 +16775,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize( ], es2024: [ "waitAsync" + ], + esnext: [ + "pause" ] })), SharedArrayBuffer: new Map(Object.entries({ @@ -17286,7 +17312,7 @@ function isBlockOrCatchScoped(declaration) { } function isCatchClauseVariableDeclarationOrBindingElement(declaration) { const node = getRootDeclaration(declaration); - return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */; + return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 300 /* CatchClause */; } function isAmbientModule(node) { return isModuleDeclaration(node) && (node.name.kind === 11 /* StringLiteral */ || isGlobalScopeAugmentation(node)); @@ -17304,10 +17330,10 @@ function isShorthandAmbientModuleSymbol(moduleSymbol) { return isShorthandAmbientModule(moduleSymbol.valueDeclaration); } function isShorthandAmbientModule(node) { - return !!node && node.kind === 267 /* ModuleDeclaration */ && !node.body; + return !!node && node.kind === 268 /* ModuleDeclaration */ && !node.body; } function isBlockScopedContainerTopLevel(node) { - return node.kind === 307 /* SourceFile */ || node.kind === 267 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); + return node.kind === 308 /* SourceFile */ || node.kind === 268 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); } function isGlobalScopeAugmentation(module2) { return !!(module2.flags & 2048 /* GlobalAugmentation */); @@ -17317,9 +17343,9 @@ function isExternalModuleAugmentation(node) { } function isModuleAugmentationExternal(node) { switch (node.parent.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return isExternalModule(node.parent); - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent); } return false; @@ -17363,24 +17389,24 @@ function isAmbientPropertyDeclaration(node) { } function isBlockScope(node, parentNode) { switch (node.kind) { - case 307 /* SourceFile */: - case 269 /* CaseBlock */: - case 299 /* CatchClause */: - case 267 /* ModuleDeclaration */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 172 /* PropertyDeclaration */: - case 175 /* ClassStaticBlockDeclaration */: + case 308 /* SourceFile */: + case 270 /* CaseBlock */: + case 300 /* CatchClause */: + case 268 /* ModuleDeclaration */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 173 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return true; - case 241 /* Block */: + case 242 /* Block */: return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode); } return false; @@ -17388,9 +17414,9 @@ function isBlockScope(node, parentNode) { function isDeclarationWithTypeParameters(node) { Debug.type(node); switch (node.kind) { - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: - case 323 /* JSDocSignature */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 324 /* JSDocSignature */: return true; default: assertType(node); @@ -17400,25 +17426,25 @@ function isDeclarationWithTypeParameters(node) { function isDeclarationWithTypeParameterChildren(node) { Debug.type(node); switch (node.kind) { - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 181 /* IndexSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 317 /* JSDocFunctionType */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 345 /* JSDocTemplateTag */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 182 /* IndexSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 318 /* JSDocFunctionType */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 346 /* JSDocTemplateTag */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; default: assertType(node); @@ -17427,8 +17453,8 @@ function isDeclarationWithTypeParameterChildren(node) { } function isAnyImportSyntax(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: return true; default: return false; @@ -17442,15 +17468,15 @@ function isAnyImportOrRequireStatement(node) { } function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 243 /* VariableStatement */: - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 244 /* VariableStatement */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: return true; default: return false; @@ -17482,7 +17508,7 @@ function getNameFromIndexInfo(info) { return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0; } function isComputedNonLiteralName(name) { - return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 168 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { var _a; @@ -17495,10 +17521,10 @@ function tryGetTextOfPropertyName(name) { case 10 /* BigIntLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return escapeLeadingUnderscores(name.text); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return escapeLeadingUnderscores(name.expression.text); return void 0; - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return getEscapedTextOfJsxNamespacedName(name); default: return Debug.assertNever(name); @@ -17514,17 +17540,17 @@ function entityNameToString(name) { case 81 /* PrivateIdentifier */: case 80 /* Identifier */: return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } else { return Debug.assertNever(name.name); } - case 311 /* JSDocMemberName */: + case 312 /* JSDocMemberName */: return entityNameToString(name.left) + "#" + entityNameToString(name.right); - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return entityNameToString(name.namespace) + ":" + entityNameToString(name.name); default: return Debug.assertNever(name); @@ -17635,7 +17661,7 @@ function scanTokenAtPosition(sourceFile, pos) { } function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 241 /* Block */) { + if (node.body && node.body.kind === 242 /* Block */) { const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos); const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end); if (startLine < endLine) { @@ -17647,7 +17673,7 @@ function getErrorSpanForArrowFunction(sourceFile, node) { function getErrorSpanForNode(sourceFile, node) { let errorNode = node; switch (node.kind) { - case 307 /* SourceFile */: { + case 308 /* SourceFile */: { const pos2 = skipTrivia( sourceFile.text, 0, @@ -17661,47 +17687,47 @@ function getErrorSpanForNode(sourceFile, node) { } // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 265 /* TypeAliasDeclaration */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 274 /* NamespaceImport */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 266 /* TypeAliasDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 275 /* NamespaceImport */: errorNode = node.name; break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: { + case 297 /* CaseClause */: + case 298 /* DefaultClause */: { const start = skipTrivia(sourceFile.text, node.pos); const end = node.statements.length > 0 ? node.statements[0].pos : node.end; return createTextSpanFromBounds(start, end); } - case 253 /* ReturnStatement */: - case 229 /* YieldExpression */: { + case 254 /* ReturnStatement */: + case 230 /* YieldExpression */: { const pos2 = skipTrivia(sourceFile.text, node.pos); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 238 /* SatisfiesExpression */: { + case 239 /* SatisfiesExpression */: { const pos2 = skipTrivia(sourceFile.text, node.expression.end); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 350 /* JSDocSatisfiesTag */: { + case 351 /* JSDocSatisfiesTag */: { const pos2 = skipTrivia(sourceFile.text, node.tagName.pos); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 176 /* Constructor */: { + case 177 /* Constructor */: { const constructorDeclaration = node; const start = skipTrivia(sourceFile.text, constructorDeclaration.pos); const scanner2 = createScanner( @@ -17738,7 +17764,7 @@ function getErrorSpanForNode(sourceFile, node) { return createTextSpanFromBounds(pos, errorNode.end); } function isGlobalSourceFile(node) { - return node.kind === 307 /* SourceFile */ && !isExternalOrCommonJsModule(node); + return node.kind === 308 /* SourceFile */ && !isExternalOrCommonJsModule(node); } function isExternalOrCommonJsModule(file) { return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0; @@ -17769,10 +17795,12 @@ function isLet(node) { return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 1 /* Let */; } function isSuperCall(n) { - return n.kind === 213 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; + return n.kind === 214 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; } function isImportCall(n) { - return n.kind === 213 /* CallExpression */ && n.expression.kind === 102 /* ImportKeyword */; + if (n.kind !== 214 /* CallExpression */) return false; + const e = n.expression; + return e.kind === 102 /* ImportKeyword */ || isMetaProperty(e) && e.keywordToken === 102 /* ImportKeyword */ && e.name.escapedText === "defer"; } function isImportMeta(n) { return isMetaProperty(n) && n.keywordToken === 102 /* ImportKeyword */ && n.name.escapedText === "meta"; @@ -17781,7 +17809,7 @@ function isLiteralImportTypeNode(n) { return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); } function isPrologueDirective(node) { - return node.kind === 244 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; + return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; } function isCustomPrologue(node) { return !!(getEmitFlags(node) & 2097152 /* CustomPrologue */); @@ -17799,7 +17827,7 @@ function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { return node.kind !== 12 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; } function getJSDocCommentRanges(node, text) { - const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 260 /* VariableDeclaration */ || node.kind === 281 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); + const commentRanges = node.kind === 170 /* Parameter */ || node.kind === 169 /* TypeParameter */ || node.kind === 219 /* FunctionExpression */ || node.kind === 220 /* ArrowFunction */ || node.kind === 218 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 282 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); return filter(commentRanges, (comment) => comment.end <= node.end && // Due to parse errors sometime empty parameter may get comments assigned to it that end up not in parameter range text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); } @@ -17810,7 +17838,7 @@ var fullTripleSlashAMDReferencePathRegEx = /^\/\/\/\s*/; var defaultLibReferenceRegEx = /^\/\/\/\s*/; function isPartOfTypeNode(node) { - if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) { + if (183 /* FirstTypeNode */ <= node.kind && node.kind <= 206 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -17827,64 +17855,64 @@ function isPartOfTypeNode(node) { case 146 /* NeverKeyword */: return true; case 116 /* VoidKeyword */: - return node.parent.kind !== 222 /* VoidExpression */; - case 233 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 223 /* VoidExpression */; + case 234 /* ExpressionWithTypeArguments */: return isPartOfTypeExpressionWithTypeArguments(node); - case 168 /* TypeParameter */: - return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */; + case 169 /* TypeParameter */: + return node.parent.kind === 201 /* MappedType */ || node.parent.kind === 196 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 80 /* Identifier */: - if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 167 /* QualifiedName */ && node.parent.right === node) { node = node.parent; - } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) { + } else if (node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } - Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 167 /* QualifiedName */ || node.kind === 212 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 166 /* QualifiedName */: - case 211 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: case 110 /* ThisKeyword */: { const { parent: parent2 } = node; - if (parent2.kind === 186 /* TypeQuery */) { + if (parent2.kind === 187 /* TypeQuery */) { return false; } - if (parent2.kind === 205 /* ImportType */) { + if (parent2.kind === 206 /* ImportType */) { return !parent2.isTypeOf; } - if (182 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 205 /* LastTypeNode */) { + if (183 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 206 /* LastTypeNode */) { return true; } switch (parent2.kind) { - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return isPartOfTypeExpressionWithTypeArguments(parent2); - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return node === parent2.constraint; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return node === parent2.constraint; - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 169 /* Parameter */: - case 260 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 170 /* Parameter */: + case 261 /* VariableDeclaration */: return node === parent2.type; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return node === parent2.type; - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: return node === parent2.type; - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: return node === parent2.type; - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: return contains(parent2.typeArguments, node); } } @@ -17898,23 +17926,23 @@ function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitor(node); - case 269 /* CaseBlock */: - case 241 /* Block */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 256 /* LabeledStatement */: - case 258 /* TryStatement */: - case 299 /* CatchClause */: + case 270 /* CaseBlock */: + case 242 /* Block */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 257 /* LabeledStatement */: + case 259 /* TryStatement */: + case 300 /* CatchClause */: return forEachChild(node, traverse); } } @@ -17923,21 +17951,21 @@ function forEachYieldExpression(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: visitor(node); const operand = node.expression; if (operand) { traverse(operand); } return; - case 266 /* EnumDeclaration */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: return; default: if (isFunctionLike(node)) { - if (node.name && node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 168 /* ComputedPropertyName */) { traverse(node.name.expression); return; } @@ -17948,9 +17976,9 @@ function forEachYieldExpression(body, visitor) { } } function getRestParameterElementType(node) { - if (node && node.kind === 188 /* ArrayType */) { + if (node && node.kind === 189 /* ArrayType */) { return node.elementType; - } else if (node && node.kind === 183 /* TypeReference */) { + } else if (node && node.kind === 184 /* TypeReference */) { return singleOrUndefined(node.typeArguments); } else { return void 0; @@ -17958,33 +17986,33 @@ function getRestParameterElementType(node) { } function getMembersOfDeclaration(node) { switch (node.kind) { - case 264 /* InterfaceDeclaration */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 187 /* TypeLiteral */: + case 265 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 188 /* TypeLiteral */: return node.members; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return node.properties; } } function isVariableLike(node) { if (node) { switch (node.kind) { - case 208 /* BindingElement */: - case 306 /* EnumMember */: - case 169 /* Parameter */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 304 /* ShorthandPropertyAssignment */: - case 260 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 307 /* EnumMember */: + case 170 /* Parameter */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 305 /* ShorthandPropertyAssignment */: + case 261 /* VariableDeclaration */: return true; } } return false; } function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 261 /* VariableDeclarationList */ && node.parent.parent.kind === 243 /* VariableStatement */; + return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */; } function isCommonJsExportedExpression(node) { if (!isInJSFile(node)) return false; @@ -17999,13 +18027,13 @@ function isValidESSymbolDeclaration(node) { } function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return true; } return false; @@ -18015,20 +18043,20 @@ function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 256 /* LabeledStatement */) { + if (node.statement.kind !== 257 /* LabeledStatement */) { return node.statement; } node = node.statement; } } function isFunctionBlock(node) { - return node && node.kind === 241 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent); } function isObjectLiteralMethod(node) { - return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */; + return node && node.kind === 175 /* MethodDeclaration */ && node.parent.kind === 211 /* ObjectLiteralExpression */; } function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { - return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 231 /* ClassExpression */); + return (node.kind === 175 /* MethodDeclaration */ || node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */) && (node.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */); } function isIdentifierTypePredicate(predicate) { return predicate && predicate.kind === 1 /* Identifier */; @@ -18080,47 +18108,47 @@ function getContainingClassExcludingClassDecorators(node) { return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node); } function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) { - Debug.assert(node.kind !== 307 /* SourceFile */); + Debug.assert(node.kind !== 308 /* SourceFile */); while (true) { node = node.parent; if (!node) { return Debug.fail(); } switch (node.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) { return node; } node = node.parent.parent; break; - case 170 /* Decorator */: - if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) { + case 171 /* Decorator */: + if (node.parent.kind === 170 /* Parameter */ && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 267 /* ModuleDeclaration */: - case 175 /* ClassStaticBlockDeclaration */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 266 /* EnumDeclaration */: - case 307 /* SourceFile */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 268 /* ModuleDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 267 /* EnumDeclaration */: + case 308 /* SourceFile */: return node; } } @@ -18129,17 +18157,17 @@ function isThisContainerOrFunctionBlock(node) { switch (node.kind) { // Arrow functions use the same scope, but may do so in a "delayed" manner // For example, `const getThis = () => this` may be before a super() call in a derived constructor - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 172 /* PropertyDeclaration */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 173 /* PropertyDeclaration */: return true; - case 241 /* Block */: + case 242 /* Block */: switch (node.parent.kind) { - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; default: return false; @@ -18171,9 +18199,9 @@ function getNewTargetContainer(node) { ); if (container) { switch (container.kind) { - case 176 /* Constructor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 177 /* Constructor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return container; } } @@ -18186,27 +18214,27 @@ function getSuperContainer(node, stopOnFunctions) { return void 0; } switch (node.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: node = node.parent; break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 175 /* ClassStaticBlockDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 176 /* ClassStaticBlockDeclaration */: return node; - case 170 /* Decorator */: - if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) { + case 171 /* Decorator */: + if (node.parent.kind === 170 /* Parameter */ && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; @@ -18216,25 +18244,25 @@ function getSuperContainer(node, stopOnFunctions) { } } function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) { + if (func.kind === 219 /* FunctionExpression */ || func.kind === 220 /* ArrowFunction */) { let prev = func; let parent2 = func.parent; - while (parent2.kind === 217 /* ParenthesizedExpression */) { + while (parent2.kind === 218 /* ParenthesizedExpression */) { prev = parent2; parent2 = parent2.parent; } - if (parent2.kind === 213 /* CallExpression */ && parent2.expression === prev) { + if (parent2.kind === 214 /* CallExpression */ && parent2.expression === prev) { return parent2; } } } function isSuperProperty(node) { const kind = node.kind; - return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; + return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; } function isThisProperty(node) { const kind = node.kind; - return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; + return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; } function isThisInitializedDeclaration(node) { var _a; @@ -18245,27 +18273,27 @@ function isThisInitializedObjectBindingExpression(node) { } function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return node.typeName; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : void 0; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 80 /* Identifier */: - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return node; } return void 0; } function getInvokedExpression(node) { switch (node.kind) { - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return node.tag; - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return node.tagName; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return node.right; - case 289 /* JsxOpeningFragment */: + case 290 /* JsxOpeningFragment */: return node; default: return node.expression; @@ -18276,19 +18304,19 @@ function nodeCanBeDecorated(useLegacyDecorators, node, parent2, grandparent) { return false; } switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return true; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return !useLegacyDecorators; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); - case 169 /* Parameter */: + case 170 /* Parameter */: if (!useLegacyDecorators) return false; - return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 176 /* Constructor */ || parent2.kind === 174 /* MethodDeclaration */ || parent2.kind === 178 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 263 /* ClassDeclaration */; + return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 177 /* Constructor */ || parent2.kind === 175 /* MethodDeclaration */ || parent2.kind === 179 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 264 /* ClassDeclaration */; } return false; } @@ -18300,13 +18328,13 @@ function nodeOrChildIsDecorated(useLegacyDecorators, node, parent2, grandparent) } function childIsDecorated(useLegacyDecorators, node, parent2) { switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 174 /* MethodDeclaration */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: + case 175 /* MethodDeclaration */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); default: return false; @@ -18354,7 +18382,7 @@ function isEmptyStringLiteral(node) { } function isJSXTagName(node) { const { parent: parent2 } = node; - if (parent2.kind === 286 /* JsxOpeningElement */ || parent2.kind === 285 /* JsxSelfClosingElement */ || parent2.kind === 287 /* JsxClosingElement */) { + if (parent2.kind === 287 /* JsxOpeningElement */ || parent2.kind === 286 /* JsxSelfClosingElement */ || parent2.kind === 288 /* JsxClosingElement */) { return parent2.tagName === node; } return false; @@ -18366,54 +18394,55 @@ function isExpressionNode(node) { case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: case 14 /* RegularExpressionLiteral */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: - case 234 /* AsExpression */: - case 216 /* TypeAssertionExpression */: - case 238 /* SatisfiesExpression */: - case 235 /* NonNullExpression */: - case 217 /* ParenthesizedExpression */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: - case 219 /* ArrowFunction */: - case 222 /* VoidExpression */: - case 220 /* DeleteExpression */: - case 221 /* TypeOfExpression */: - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: - case 226 /* BinaryExpression */: - case 227 /* ConditionalExpression */: - case 230 /* SpreadElement */: - case 228 /* TemplateExpression */: - case 232 /* OmittedExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: - case 229 /* YieldExpression */: - case 223 /* AwaitExpression */: - case 236 /* MetaProperty */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: + case 235 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 239 /* SatisfiesExpression */: + case 236 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 223 /* VoidExpression */: + case 221 /* DeleteExpression */: + case 222 /* TypeOfExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: + case 227 /* BinaryExpression */: + case 228 /* ConditionalExpression */: + case 231 /* SpreadElement */: + case 229 /* TemplateExpression */: + case 233 /* OmittedExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: + case 230 /* YieldExpression */: + case 224 /* AwaitExpression */: return true; - case 233 /* ExpressionWithTypeArguments */: + case 237 /* MetaProperty */: + return !isImportCall(node.parent) || node.parent.expression !== node; + case 234 /* ExpressionWithTypeArguments */: return !isHeritageClause(node.parent) && !isJSDocAugmentsTag(node.parent); - case 166 /* QualifiedName */: - while (node.parent.kind === 166 /* QualifiedName */) { + case 167 /* QualifiedName */: + while (node.parent.kind === 167 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); - case 311 /* JSDocMemberName */: + return node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + case 312 /* JSDocMemberName */: while (isJSDocMemberName(node.parent)) { node = node.parent; } - return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + return node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); case 81 /* PrivateIdentifier */: return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 103 /* InKeyword */; case 80 /* Identifier */: - if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { + if (node.parent.kind === 187 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { return true; } // falls through @@ -18430,64 +18459,64 @@ function isExpressionNode(node) { function isInExpressionContext(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 306 /* EnumMember */: - case 303 /* PropertyAssignment */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 307 /* EnumMember */: + case 304 /* PropertyAssignment */: + case 209 /* BindingElement */: return parent2.initializer === node; - case 244 /* ExpressionStatement */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 253 /* ReturnStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 296 /* CaseClause */: - case 257 /* ThrowStatement */: + case 245 /* ExpressionStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 254 /* ReturnStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 297 /* CaseClause */: + case 258 /* ThrowStatement */: return parent2.expression === node; - case 248 /* ForStatement */: + case 249 /* ForStatement */: const forStatement = parent2; - return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: const forInOrOfStatement = parent2; - return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInOrOfStatement.expression === node; + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return node === parent2.expression; - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return node === parent2.expression; - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return node === parent2.expression; - case 170 /* Decorator */: - case 294 /* JsxExpression */: - case 293 /* JsxSpreadAttribute */: - case 305 /* SpreadAssignment */: + case 171 /* Decorator */: + case 295 /* JsxExpression */: + case 294 /* JsxSpreadAttribute */: + case 306 /* SpreadAssignment */: return true; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return parent2.expression === node && !isPartOfTypeNode(parent2); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return parent2.objectAssignmentInitializer === node; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return node === parent2.expression; default: return isExpressionNode(parent2); } } function isPartOfTypeQuery(node) { - while (node.kind === 166 /* QualifiedName */ || node.kind === 80 /* Identifier */) { + while (node.kind === 167 /* QualifiedName */ || node.kind === 80 /* Identifier */) { node = node.parent; } - return node.kind === 186 /* TypeQuery */; + return node.kind === 187 /* TypeQuery */; } function isNamespaceReexportDeclaration(node) { return isNamespaceExport(node) && !!node.parent.moduleSpecifier; } function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */; + return node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 284 /* ExternalModuleReference */; } function getExternalModuleImportEqualsDeclarationExpression(node) { Debug.assert(isExternalModuleImportEqualsDeclaration(node)); @@ -18497,10 +18526,10 @@ function getExternalModuleRequireArgument(node) { return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0]; } function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 283 /* ExternalModuleReference */; + return node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 284 /* ExternalModuleReference */; } function isFullSourceFile(sourceFile) { - return (sourceFile == null ? void 0 : sourceFile.kind) === 307 /* SourceFile */; + return (sourceFile == null ? void 0 : sourceFile.kind) === 308 /* SourceFile */; } function isSourceFileJS(file) { return isInJSFile(file); @@ -18521,7 +18550,7 @@ function isJSDocIndexSignature(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && (node.typeArguments[0].kind === 154 /* StringKeyword */ || node.typeArguments[0].kind === 150 /* NumberKeyword */); } function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 213 /* CallExpression */) { + if (callExpression.kind !== 214 /* CallExpression */) { return false; } const { expression, arguments: args } = callExpression; @@ -18598,9 +18627,9 @@ function getAssignedExpandoInitializer(node) { function getExpandoInitializer(initializer, isPrototypeAssignment) { if (isCallExpression(initializer)) { const e = skipParentheses(initializer.expression); - return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0; + return e.kind === 219 /* FunctionExpression */ || e.kind === 220 /* ArrowFunction */ ? initializer : void 0; } - if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 231 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) { + if (initializer.kind === 219 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 220 /* ArrowFunction */) { return initializer; } if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -18791,7 +18820,7 @@ function isPrototypePropertyAssignment(node) { return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */; } function isSpecialPropertyDeclaration(expr) { - return isInJSFile(expr) && expr.parent && expr.parent.kind === 244 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); + return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; @@ -18804,21 +18833,21 @@ function isFunctionSymbol(symbol) { return false; } const decl = symbol.valueDeclaration; - return decl.kind === 262 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); + return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); } function canHaveModuleSpecifier(node) { switch (node == null ? void 0 : node.kind) { - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 273 /* ImportClause */: - case 280 /* NamespaceExport */: - case 274 /* NamespaceImport */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 205 /* ImportType */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 274 /* ImportClause */: + case 281 /* NamespaceExport */: + case 275 /* NamespaceImport */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 206 /* ImportType */: return true; } return false; @@ -18826,28 +18855,28 @@ function canHaveModuleSpecifier(node) { function tryGetModuleSpecifierFromDeclaration(node) { var _a, _b; switch (node.kind) { - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: return (_a = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ true ))) == null ? void 0 : _a.arguments[0]; - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 352 /* JSDocImportTag */: return tryCast(node.moduleSpecifier, isStringLiteralLike); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); - case 273 /* ImportClause */: - case 280 /* NamespaceExport */: + case 274 /* ImportClause */: + case 281 /* NamespaceExport */: return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); - case 274 /* NamespaceImport */: - case 281 /* ExportSpecifier */: + case 275 /* NamespaceImport */: + case 282 /* ExportSpecifier */: return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); - case 205 /* ImportType */: + case 206 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; default: Debug.assertNever(node); @@ -18858,19 +18887,19 @@ function importFromModuleSpecifier(node) { } function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 352 /* JSDocImportTag */: return node.parent; - case 283 /* ExternalModuleReference */: + case 284 /* ExternalModuleReference */: return node.parent.parent; - case 213 /* CallExpression */: + case 214 /* CallExpression */: return isImportCall(node.parent) || isRequireCall( node.parent, /*requireStringLiteralLikeArgument*/ false ) ? node.parent : void 0; - case 201 /* LiteralType */: + case 202 /* LiteralType */: if (!isStringLiteral(node)) { break; } @@ -18884,17 +18913,17 @@ function shouldRewriteModuleSpecifier(specifier, compilerOptions) { } function getExternalModuleName(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 352 /* JSDocImportTag */: return node.moduleSpecifier; - case 271 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; - case 205 /* ImportType */: + case 272 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 284 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; + case 206 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; - case 213 /* CallExpression */: + case 214 /* CallExpression */: return node.arguments[0]; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return node.name.kind === 11 /* StringLiteral */ ? node.name : void 0; default: return Debug.assertNever(node); @@ -18902,18 +18931,18 @@ function getExternalModuleName(node) { } function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return node; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return node.exportClause && tryCast(node.exportClause, isNamespaceExport); default: return Debug.assertNever(node); } } function isDefaultImport(node) { - return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name; + return (node.kind === 273 /* ImportDeclaration */ || node.kind === 352 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name; } function forEachImportClauseDeclaration(node, action) { if (node.name) { @@ -18927,13 +18956,13 @@ function forEachImportClauseDeclaration(node, action) { } function hasQuestionToken(node) { switch (node.kind) { - case 169 /* Parameter */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 304 /* ShorthandPropertyAssignment */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 170 /* Parameter */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 305 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return node.questionToken !== void 0; } return false; @@ -18944,7 +18973,7 @@ function isJSDocConstructSignature(node) { return !!name && name.escapedText === "new"; } function isJSDocTypeAlias(node) { - return node.kind === 346 /* JSDocTypedefTag */ || node.kind === 338 /* JSDocCallbackTag */ || node.kind === 340 /* JSDocEnumTag */; + return node.kind === 347 /* JSDocTypedefTag */ || node.kind === 339 /* JSDocCallbackTag */ || node.kind === 341 /* JSDocEnumTag */; } function isTypeAlias(node) { return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node); @@ -18957,12 +18986,12 @@ function getSourceOfDefaultedAssignment(node) { } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: const v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return node.initializer; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return node.initializer; } } @@ -18970,26 +18999,26 @@ function getSingleVariableOfVariableStatement(node) { return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0; } function getNestedModuleDeclaration(node) { - return isModuleDeclaration(node) && node.body && node.body.kind === 267 /* ModuleDeclaration */ ? node.body : void 0; + return isModuleDeclaration(node) && node.body && node.body.kind === 268 /* ModuleDeclaration */ ? node.body : void 0; } function canHaveFlowNode(node) { - if (node.kind >= 243 /* FirstStatement */ && node.kind <= 259 /* LastStatement */) { + if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */) { return true; } switch (node.kind) { case 80 /* Identifier */: case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 166 /* QualifiedName */: - case 236 /* MetaProperty */: - case 212 /* ElementAccessExpression */: - case 211 /* PropertyAccessExpression */: - case 208 /* BindingElement */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 167 /* QualifiedName */: + case 237 /* MetaProperty */: + case 213 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 209 /* BindingElement */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; default: return false; @@ -18997,72 +19026,72 @@ function canHaveFlowNode(node) { } function canHaveJSDoc(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 226 /* BinaryExpression */: - case 241 /* Block */: - case 252 /* BreakStatement */: - case 179 /* CallSignature */: - case 296 /* CaseClause */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 175 /* ClassStaticBlockDeclaration */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: - case 251 /* ContinueStatement */: - case 259 /* DebuggerStatement */: - case 246 /* DoStatement */: - case 212 /* ElementAccessExpression */: - case 242 /* EmptyStatement */: + case 220 /* ArrowFunction */: + case 227 /* BinaryExpression */: + case 242 /* Block */: + case 253 /* BreakStatement */: + case 180 /* CallSignature */: + case 297 /* CaseClause */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 176 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 252 /* ContinueStatement */: + case 260 /* DebuggerStatement */: + case 247 /* DoStatement */: + case 213 /* ElementAccessExpression */: + case 243 /* EmptyStatement */: case 1 /* EndOfFileToken */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: - case 281 /* ExportSpecifier */: - case 244 /* ExpressionStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 177 /* GetAccessor */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: + case 282 /* ExportSpecifier */: + case 245 /* ExpressionStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 178 /* GetAccessor */: case 80 /* Identifier */: - case 245 /* IfStatement */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 181 /* IndexSignature */: - case 264 /* InterfaceDeclaration */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: - case 256 /* LabeledStatement */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 267 /* ModuleDeclaration */: - case 202 /* NamedTupleMember */: - case 270 /* NamespaceExportDeclaration */: - case 210 /* ObjectLiteralExpression */: - case 169 /* Parameter */: - case 217 /* ParenthesizedExpression */: - case 211 /* PropertyAccessExpression */: - case 303 /* PropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 253 /* ReturnStatement */: - case 240 /* SemicolonClassElement */: - case 178 /* SetAccessor */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: - case 255 /* SwitchStatement */: - case 257 /* ThrowStatement */: - case 258 /* TryStatement */: - case 265 /* TypeAliasDeclaration */: - case 168 /* TypeParameter */: - case 260 /* VariableDeclaration */: - case 243 /* VariableStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: + case 246 /* IfStatement */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 182 /* IndexSignature */: + case 265 /* InterfaceDeclaration */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: + case 257 /* LabeledStatement */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 268 /* ModuleDeclaration */: + case 203 /* NamedTupleMember */: + case 271 /* NamespaceExportDeclaration */: + case 211 /* ObjectLiteralExpression */: + case 170 /* Parameter */: + case 218 /* ParenthesizedExpression */: + case 212 /* PropertyAccessExpression */: + case 304 /* PropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 254 /* ReturnStatement */: + case 241 /* SemicolonClassElement */: + case 179 /* SetAccessor */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: + case 256 /* SwitchStatement */: + case 258 /* ThrowStatement */: + case 259 /* TryStatement */: + case 266 /* TypeAliasDeclaration */: + case 169 /* TypeParameter */: + case 261 /* VariableDeclaration */: + case 244 /* VariableStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: return true; default: return false; @@ -19078,11 +19107,11 @@ function getJSDocCommentsAndTags(hostNode, noCache) { if (hasJSDocNodes(node)) { result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc)); } - if (node.kind === 169 /* Parameter */) { + if (node.kind === 170 /* Parameter */) { result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node)); break; } - if (node.kind === 168 /* TypeParameter */) { + if (node.kind === 169 /* TypeParameter */) { result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node)); break; } @@ -19106,7 +19135,7 @@ function ownsJSDocTag(hostNode, tag) { } function getNextJSDocCommentLocation(node) { const parent2 = node.parent; - if (parent2.kind === 303 /* PropertyAssignment */ || parent2.kind === 277 /* ExportAssignment */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 244 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 253 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isAssignmentExpression(node)) { + if (parent2.kind === 304 /* PropertyAssignment */ || parent2.kind === 278 /* ExportAssignment */ || parent2.kind === 173 /* PropertyDeclaration */ || parent2.kind === 245 /* ExpressionStatement */ && node.kind === 212 /* PropertyAccessExpression */ || parent2.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isAssignmentExpression(node)) { return parent2; } else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isAssignmentExpression(parent2))) { return parent2.parent; @@ -19185,35 +19214,35 @@ function getAssignmentTarget(node) { let parent2 = node.parent; while (true) { switch (parent2.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const binaryExpression = parent2; const binaryOperator = binaryExpression.operatorToken.kind; return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: const unaryExpression = parent2; const unaryOperator = unaryExpression.operator; return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: const forInOrOfStatement = parent2; return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0; - case 217 /* ParenthesizedExpression */: - case 209 /* ArrayLiteralExpression */: - case 230 /* SpreadElement */: - case 235 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 210 /* ArrayLiteralExpression */: + case 231 /* SpreadElement */: + case 236 /* NonNullExpression */: node = parent2; break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: node = parent2.parent; break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: if (parent2.name !== node) { return void 0; } node = parent2.parent; break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (parent2.name === node) { return void 0; } @@ -19231,14 +19260,14 @@ function getAssignmentTargetKind(node) { return 0 /* None */; } switch (target.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const binaryOperator = target.operatorToken.kind; return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return 2 /* Compound */; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return 1 /* Definite */; } } @@ -19247,7 +19276,7 @@ function isAssignmentTarget(node) { } function isCompoundLikeAssignment(assignment) { const right = skipParentheses(assignment.right); - return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind); + return right.kind === 227 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind); } function isInCompoundLikeAssignment(node) { const target = getAssignmentTarget(node); @@ -19259,22 +19288,22 @@ function isInCompoundLikeAssignment(node) { } function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 241 /* Block */: - case 243 /* VariableStatement */: - case 254 /* WithStatement */: - case 245 /* IfStatement */: - case 255 /* SwitchStatement */: - case 269 /* CaseBlock */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 256 /* LabeledStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 258 /* TryStatement */: - case 299 /* CatchClause */: + case 242 /* Block */: + case 244 /* VariableStatement */: + case 255 /* WithStatement */: + case 246 /* IfStatement */: + case 256 /* SwitchStatement */: + case 270 /* CaseBlock */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 257 /* LabeledStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 259 /* TryStatement */: + case 300 /* CatchClause */: return true; } return false; @@ -19289,14 +19318,14 @@ function walkUp(node, kind) { return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 196 /* ParenthesizedType */); + return walkUp(node, 197 /* ParenthesizedType */); } function walkUpParenthesizedExpressions(node) { - return walkUp(node, 217 /* ParenthesizedExpression */); + return walkUp(node, 218 /* ParenthesizedExpression */); } function walkUpParenthesizedTypesAndGetParentAndChild(node) { let child; - while (node && node.kind === 196 /* ParenthesizedType */) { + while (node && node.kind === 197 /* ParenthesizedType */) { child = node; node = node.parent; } @@ -19311,11 +19340,11 @@ function skipParentheses(node, excludeJSDocTypeAssertions) { return skipOuterExpressions(node, flags); } function isDeleteTarget(node) { - if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) { + if (node.kind !== 212 /* PropertyAccessExpression */ && node.kind !== 213 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 220 /* DeleteExpression */; + return node && node.kind === 221 /* DeleteExpression */; } function isNodeDescendantOf(node, ancestor) { while (node) { @@ -19352,49 +19381,49 @@ function getDeclarationFromName(name) { } } function isLiteralComputedPropertyDeclarationName(node) { - return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); + return isStringOrNumericLiteralLike(node) && node.parent.kind === 168 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); } function isIdentifierName(node) { const parent2 = node.parent; switch (parent2.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 306 /* EnumMember */: - case 303 /* PropertyAssignment */: - case 211 /* PropertyAccessExpression */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 307 /* EnumMember */: + case 304 /* PropertyAssignment */: + case 212 /* PropertyAccessExpression */: return parent2.name === node; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return parent2.right === node; - case 208 /* BindingElement */: - case 276 /* ImportSpecifier */: + case 209 /* BindingElement */: + case 277 /* ImportSpecifier */: return parent2.propertyName === node; - case 281 /* ExportSpecifier */: - case 291 /* JsxAttribute */: - case 285 /* JsxSelfClosingElement */: - case 286 /* JsxOpeningElement */: - case 287 /* JsxClosingElement */: + case 282 /* ExportSpecifier */: + case 292 /* JsxAttribute */: + case 286 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 288 /* JsxClosingElement */: return true; } return false; } function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 273 /* ImportClause */: - case 276 /* ImportSpecifier */: - case 274 /* NamespaceImport */: - case 281 /* ExportSpecifier */: - case 277 /* ExportAssignment */: - case 271 /* ImportEqualsDeclaration */: - case 280 /* NamespaceExport */: + case 274 /* ImportClause */: + case 277 /* ImportSpecifier */: + case 275 /* NamespaceImport */: + case 282 /* ExportSpecifier */: + case 278 /* ExportAssignment */: + case 272 /* ImportEqualsDeclaration */: + case 281 /* NamespaceExport */: return node.parent; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 166 /* QualifiedName */); + } while (node.parent.kind === 167 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -19409,7 +19438,7 @@ function getExportAssignmentExpression(node) { return isExportAssignment(node) ? node.expression : node.right; } function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 304 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 303 /* PropertyAssignment */ ? node.initializer : node.parent.right; + return node.kind === 305 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 304 /* PropertyAssignment */ ? node.initializer : node.parent.right; } function getEffectiveBaseTypeNode(node) { const baseType = getClassExtendsHeritageElement(node); @@ -19460,7 +19489,7 @@ function getAncestor(node, kind) { return void 0; } function isKeyword(token) { - return 83 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */; + return 83 /* FirstKeyword */ <= token && token <= 166 /* LastKeyword */; } function isPunctuation(token) { return 19 /* FirstPunctuation */ <= token && token <= 79 /* LastPunctuation */; @@ -19469,7 +19498,7 @@ function isKeywordOrPunctuation(token) { return isKeyword(token) || isPunctuation(token); } function isContextualKeyword(token) { - return 128 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */; + return 128 /* FirstContextualKeyword */ <= token && token <= 166 /* LastContextualKeyword */; } function isNonContextualKeyword(token) { return isKeyword(token) && !isContextualKeyword(token); @@ -19499,14 +19528,14 @@ function getFunctionFlags(node) { } let flags = 0 /* Normal */; switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (hasSyntacticModifier(node, 1024 /* Async */)) { flags |= 2 /* Async */; } @@ -19519,10 +19548,10 @@ function getFunctionFlags(node) { } function isAsyncFunction(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */); } return false; @@ -19538,7 +19567,7 @@ function hasDynamicName(declaration) { return !!name && isDynamicName(name); } function isDynamicName(name) { - if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) { + if (!(name.kind === 168 /* ComputedPropertyName */ || name.kind === 213 /* ElementAccessExpression */)) { return false; } const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -19554,7 +19583,7 @@ function getPropertyNameForPropertyNameNode(name) { case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: return escapeLeadingUnderscores(name.text); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: const nameExpression = name.expression; if (isStringOrNumericLiteralLike(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -19565,7 +19594,7 @@ function getPropertyNameForPropertyNameNode(name) { return nameExpression.operand.text; } return void 0; - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return getEscapedTextOfJsxNamespacedName(name); default: return Debug.assertNever(name); @@ -19603,17 +19632,17 @@ function isProtoSetter(node) { function isAnonymousFunctionDefinition(node, cb) { node = skipOuterExpressions(node); switch (node.kind) { - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: if (classHasDeclaredOrExplicitlyAssignedName(node)) { return false; } break; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (node.name) { return false; } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: break; default: return false; @@ -19622,19 +19651,19 @@ function isAnonymousFunctionDefinition(node, cb) { } function isNamedEvaluationSource(node) { switch (node.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return !isProtoSetter(node.name); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return !!node.objectAssignmentInitializer; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return isIdentifier(node.name) && !!node.initializer; - case 169 /* Parameter */: + case 170 /* Parameter */: return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return !!node.initializer; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 77 /* AmpersandAmpersandEqualsToken */: @@ -19643,7 +19672,7 @@ function isNamedEvaluationSource(node) { return isIdentifier(node.left); } break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return true; } return false; @@ -19651,18 +19680,18 @@ function isNamedEvaluationSource(node) { function isNamedEvaluation(node, cb) { if (!isNamedEvaluationSource(node)) return false; switch (node.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return isAnonymousFunctionDefinition(node.initializer, cb); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: return isAnonymousFunctionDefinition(node.initializer, cb); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isAnonymousFunctionDefinition(node.right, cb); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return isAnonymousFunctionDefinition(node.expression, cb); } } @@ -19671,17 +19700,17 @@ function isPushOrUnshiftIdentifier(node) { } function isPartOfParameterDeclaration(node) { const root = getRootDeclaration(node); - return root.kind === 169 /* Parameter */; + return root.kind === 170 /* Parameter */; } function getRootDeclaration(node) { - while (node.kind === 208 /* BindingElement */) { + while (node.kind === 209 /* BindingElement */) { node = node.parent.parent; } return node; } function nodeStartsNewLexicalEnvironment(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 262 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 267 /* ModuleDeclaration */ || kind === 307 /* SourceFile */; + return kind === 177 /* Constructor */ || kind === 219 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 220 /* ArrowFunction */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 268 /* ModuleDeclaration */ || kind === 308 /* SourceFile */; } function nodeIsSynthesized(range) { return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end); @@ -19693,22 +19722,22 @@ var Associativity = /* @__PURE__ */ ((Associativity2) => { })(Associativity || {}); function getExpressionAssociativity(expression) { const operator = getOperator(expression); - const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; + const hasArguments = expression.kind === 215 /* NewExpression */ && expression.arguments !== void 0; return getOperatorAssociativity(expression.kind, operator, hasArguments); } function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 214 /* NewExpression */: + case 215 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 224 /* PrefixUnaryExpression */: - case 221 /* TypeOfExpression */: - case 222 /* VoidExpression */: - case 220 /* DeleteExpression */: - case 223 /* AwaitExpression */: - case 227 /* ConditionalExpression */: - case 229 /* YieldExpression */: + case 225 /* PrefixUnaryExpression */: + case 222 /* TypeOfExpression */: + case 223 /* VoidExpression */: + case 221 /* DeleteExpression */: + case 224 /* AwaitExpression */: + case 228 /* ConditionalExpression */: + case 230 /* YieldExpression */: return 1 /* Right */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (operator) { case 43 /* AsteriskAsteriskToken */: case 64 /* EqualsToken */: @@ -19734,13 +19763,13 @@ function getOperatorAssociativity(kind, operator, hasArguments) { } function getExpressionPrecedence(expression) { const operator = getOperator(expression); - const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; + const hasArguments = expression.kind === 215 /* NewExpression */ && expression.arguments !== void 0; return getOperatorPrecedence(expression.kind, operator, hasArguments); } function getOperator(expression) { - if (expression.kind === 226 /* BinaryExpression */) { + if (expression.kind === 227 /* BinaryExpression */) { return expression.operatorToken.kind; - } else if (expression.kind === 224 /* PrefixUnaryExpression */ || expression.kind === 225 /* PostfixUnaryExpression */) { + } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) { return expression.operator; } else { return expression.kind; @@ -19752,8 +19781,8 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { OperatorPrecedence2[OperatorPrecedence2["Yield"] = 2] = "Yield"; OperatorPrecedence2[OperatorPrecedence2["Assignment"] = 3] = "Assignment"; OperatorPrecedence2[OperatorPrecedence2["Conditional"] = 4] = "Conditional"; - OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 4 /* Conditional */] = "Coalesce"; OperatorPrecedence2[OperatorPrecedence2["LogicalOR"] = 5] = "LogicalOR"; + OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 5 /* LogicalOR */] = "Coalesce"; OperatorPrecedence2[OperatorPrecedence2["LogicalAND"] = 6] = "LogicalAND"; OperatorPrecedence2[OperatorPrecedence2["BitwiseOR"] = 7] = "BitwiseOR"; OperatorPrecedence2[OperatorPrecedence2["BitwiseXOR"] = 8] = "BitwiseXOR"; @@ -19776,15 +19805,15 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { })(OperatorPrecedence || {}); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return 0 /* Comma */; - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return 1 /* Spread */; - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return 2 /* Yield */; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return 4 /* Conditional */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (operatorKind) { case 28 /* CommaToken */: return 0 /* Comma */; @@ -19809,27 +19838,27 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { return getBinaryOperatorPrecedence(operatorKind); } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? - case 216 /* TypeAssertionExpression */: - case 235 /* NonNullExpression */: - case 224 /* PrefixUnaryExpression */: - case 221 /* TypeOfExpression */: - case 222 /* VoidExpression */: - case 220 /* DeleteExpression */: - case 223 /* AwaitExpression */: + case 217 /* TypeAssertionExpression */: + case 236 /* NonNullExpression */: + case 225 /* PrefixUnaryExpression */: + case 222 /* TypeOfExpression */: + case 223 /* VoidExpression */: + case 221 /* DeleteExpression */: + case 224 /* AwaitExpression */: return 16 /* Unary */; - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return 17 /* Update */; - case 213 /* CallExpression */: + case 214 /* CallExpression */: return 18 /* LeftHandSide */; - case 214 /* NewExpression */: + case 215 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 215 /* TaggedTemplateExpression */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 236 /* MetaProperty */: + case 216 /* TaggedTemplateExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 237 /* MetaProperty */: return 19 /* Member */; - case 234 /* AsExpression */: - case 238 /* SatisfiesExpression */: + case 235 /* AsExpression */: + case 239 /* SatisfiesExpression */: return 11 /* Relational */; case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: @@ -19841,19 +19870,19 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 231 /* ClassExpression */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 232 /* ClassExpression */: case 14 /* RegularExpressionLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: - case 217 /* ParenthesizedExpression */: - case 232 /* OmittedExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: + case 229 /* TemplateExpression */: + case 218 /* ParenthesizedExpression */: + case 233 /* OmittedExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -19862,7 +19891,7 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { function getBinaryOperatorPrecedence(kind) { switch (kind) { case 61 /* QuestionQuestionToken */: - return 4 /* Coalesce */; + return 5 /* Coalesce */; case 57 /* BarBarToken */: return 5 /* LogicalOR */; case 56 /* AmpersandAmpersandToken */: @@ -19906,7 +19935,7 @@ function getBinaryOperatorPrecedence(kind) { function getSemanticJsxChildren(children) { return filter(children, (i) => { switch (i.kind) { - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return !!i.expression; case 12 /* JsxText */: return !i.containsOnlyTriviaWhiteSpaces; @@ -20347,7 +20376,7 @@ function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { if (forceDtsEmit) return true; if (host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) return false; if (!isJsonSourceFile(sourceFile)) return true; - if (host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) return false; + if (host.getRedirectFromSourceFile(sourceFile.fileName)) return false; if (options.outFile) return true; if (!options.outDir) return false; if (options.rootDir || options.composite && options.configFilePath) { @@ -20430,7 +20459,7 @@ function isThisIdentifier(node) { function isInTypeQuery(node) { return !!findAncestor( node, - (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit" + (n) => n.kind === 187 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 167 /* QualifiedName */ ? false : "quit" ); } function isThisInTypeQuery(node) { @@ -20440,7 +20469,7 @@ function isThisInTypeQuery(node) { while (isQualifiedName(node.parent) && node.parent.left === node) { node = node.parent; } - return node.parent.kind === 186 /* TypeQuery */; + return node.parent.kind === 187 /* TypeQuery */; } function identifierIsThisKeyword(id) { return id.escapedText === "this"; @@ -20452,9 +20481,9 @@ function getAllAccessorDeclarations(declarations, accessor) { let setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 177 /* GetAccessor */) { + if (accessor.kind === 178 /* GetAccessor */) { getAccessor = accessor; - } else if (accessor.kind === 178 /* SetAccessor */) { + } else if (accessor.kind === 179 /* SetAccessor */) { setAccessor = accessor; } else { Debug.fail("Accessor has wrong kind"); @@ -20470,10 +20499,10 @@ function getAllAccessorDeclarations(declarations, accessor) { } else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 177 /* GetAccessor */ && !getAccessor) { + if (member.kind === 178 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 178 /* SetAccessor */ && !setAccessor) { + if (member.kind === 179 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -20504,7 +20533,7 @@ function getJSDocTypeParameterDeclarations(node) { return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0); } function isNonTypeAliasTemplate(tag) { - return isJSDocTemplateTag(tag) && !(tag.parent.kind === 320 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); + return isJSDocTemplateTag(tag) && !(tag.parent.kind === 321 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); } function getEffectiveSetAccessorTypeAnnotationNode(node) { const parameter = getSetAccessorValueParameter(node); @@ -20694,7 +20723,7 @@ function getSelectedSyntacticModifierFlags(node, flags) { return getSyntacticModifierFlags(node) & flags; } function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 166 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -20805,7 +20834,7 @@ function modifierToFlag(token) { return 8192 /* In */; case 147 /* OutKeyword */: return 16384 /* Out */; - case 170 /* Decorator */: + case 171 /* Decorator */: return 32768 /* Decorator */; } return 0 /* None */; @@ -20859,7 +20888,7 @@ function isDestructuringAssignment(node) { true )) { const kind = node.left.kind; - return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */; + return kind === 211 /* ObjectLiteralExpression */ || kind === 210 /* ArrayLiteralExpression */; } return false; } @@ -20873,12 +20902,12 @@ function getFirstIdentifier(node) { switch (node.kind) { case 80 /* Identifier */: return node; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: do { node = node.left; } while (node.kind !== 80 /* Identifier */); return node; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 80 /* Identifier */); @@ -20886,7 +20915,7 @@ function getFirstIdentifier(node) { } } function isDottedName(node) { - return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 236 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression); + return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 212 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 218 /* ParenthesizedExpression */ && isDottedName(node.expression); } function isPropertyAccessEntityNameExpression(node) { return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression); @@ -20913,7 +20942,7 @@ function isPrototypeAccess(node) { return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node; + return node.parent.kind === 167 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 237 /* MetaProperty */ && node.parent.name === node; } function isRightSideOfAccessExpression(node) { return !!node.parent && (isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node); @@ -20928,10 +20957,10 @@ function isRightSideOfInstanceofExpression(node) { return isInstanceOfExpression(node.parent) && node === node.parent.right; } function isEmptyObjectLiteral(expression) { - return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0; + return expression.kind === 211 /* ObjectLiteralExpression */ && expression.properties.length === 0; } function isEmptyArrayLiteral(expression) { - return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0; + return expression.kind === 210 /* ArrayLiteralExpression */ && expression.elements.length === 0; } function getLocalSymbolForExportDefault(symbol) { if (!isExportDefaultSymbol(symbol) || !symbol.declarations) return void 0; @@ -21057,8 +21086,14 @@ function base64decode(host, input) { function readJsonOrUndefined(path, hostOrText) { const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path); if (!jsonText) return void 0; - const result = parseConfigFileTextToJson(path, jsonText); - return !result.error ? result.config : void 0; + let result = tryParseJson(jsonText); + if (result === void 0) { + const looseResult = parseConfigFileTextToJson(path, jsonText); + if (!looseResult.error) { + result = looseResult.config; + } + } + return result; } function readJson(path, host) { return readJsonOrUndefined(path, host) || {}; @@ -21207,8 +21242,8 @@ function isDeclarationNameOfEnumOrNamespace(node) { const parseNode = getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -21261,27 +21296,27 @@ function isWriteAccess(node) { function accessKind(node) { const { parent: parent2 } = node; switch (parent2 == null ? void 0 : parent2.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return accessKind(parent2); - case 225 /* PostfixUnaryExpression */: - case 224 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const { operator } = parent2; return operator === 46 /* PlusPlusToken */ || operator === 47 /* MinusMinusToken */ ? 2 /* ReadWrite */ : 0 /* Read */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const { left, operatorToken } = parent2; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 64 /* EqualsToken */ ? 1 /* Write */ : 2 /* ReadWrite */ : 0 /* Read */; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return parent2.name !== node ? 0 /* Read */ : accessKind(parent2); - case 303 /* PropertyAssignment */: { + case 304 /* PropertyAssignment */: { const parentAccess = accessKind(parent2.parent); return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return accessKind(parent2); - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return node === parent2.initializer ? 1 /* Write */ : 0 /* Read */; default: return 0 /* Read */; @@ -21386,20 +21421,20 @@ function isObjectTypeDeclaration(node) { return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); } function isTypeNodeKind(kind) { - return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 233 /* ExpressionWithTypeArguments */ || kind === 312 /* JSDocAllType */ || kind === 313 /* JSDocUnknownType */ || kind === 314 /* JSDocNullableType */ || kind === 315 /* JSDocNonNullableType */ || kind === 316 /* JSDocOptionalType */ || kind === 317 /* JSDocFunctionType */ || kind === 318 /* JSDocVariadicType */; + return kind >= 183 /* FirstTypeNode */ && kind <= 206 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 313 /* JSDocAllType */ || kind === 314 /* JSDocUnknownType */ || kind === 315 /* JSDocNullableType */ || kind === 316 /* JSDocNonNullableType */ || kind === 317 /* JSDocOptionalType */ || kind === 318 /* JSDocFunctionType */ || kind === 319 /* JSDocVariadicType */; } function isAccessExpression(node) { - return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */; + return node.kind === 212 /* PropertyAccessExpression */ || node.kind === 213 /* ElementAccessExpression */; } function getNameOfAccessExpression(node) { - if (node.kind === 211 /* PropertyAccessExpression */) { + if (node.kind === 212 /* PropertyAccessExpression */) { return node.name; } - Debug.assert(node.kind === 212 /* ElementAccessExpression */); + Debug.assert(node.kind === 213 /* ElementAccessExpression */); return node.argumentExpression; } function isNamedImportsOrExports(node) { - return node.kind === 275 /* NamedImports */ || node.kind === 279 /* NamedExports */; + return node.kind === 276 /* NamedImports */ || node.kind === 280 /* NamedExports */; } function getLeftmostAccessExpression(expr) { while (isAccessExpression(expr)) { @@ -21412,12 +21447,12 @@ function forEachNameInAccessChainWalkingLeft(name, action) { return walkAccessExpression(name.parent); } function walkAccessExpression(access) { - if (access.kind === 211 /* PropertyAccessExpression */) { + if (access.kind === 212 /* PropertyAccessExpression */) { const res = action(access.name); if (res !== void 0) { return res; } - } else if (access.kind === 212 /* ElementAccessExpression */) { + } else if (access.kind === 213 /* ElementAccessExpression */) { if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) { const res = action(access.argumentExpression); if (res !== void 0) { @@ -21439,29 +21474,29 @@ function forEachNameInAccessChainWalkingLeft(name, action) { function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: node = node.operand; continue; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: node = node.left; continue; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: node = node.condition; continue; - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: node = node.tag; continue; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 234 /* AsExpression */: - case 212 /* ElementAccessExpression */: - case 211 /* PropertyAccessExpression */: - case 235 /* NonNullExpression */: - case 355 /* PartiallyEmittedExpression */: - case 238 /* SatisfiesExpression */: + case 235 /* AsExpression */: + case 213 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 236 /* NonNullExpression */: + case 356 /* PartiallyEmittedExpression */: + case 239 /* SatisfiesExpression */: node = node.expression; continue; } @@ -21871,7 +21906,7 @@ var _computedOptions = createComputedCompilerOptions({ dependencies: ["module"], computeValue: (compilerOptions) => { const target = compilerOptions.target === 0 /* ES3 */ ? void 0 : compilerOptions.target; - return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 101 /* Node18 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */); + return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 101 /* Node18 */ && 9 /* ES2022 */ || compilerOptions.module === 102 /* Node20 */ && 10 /* ES2023 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */); } }, module: { @@ -21891,6 +21926,7 @@ var _computedOptions = createComputedCompilerOptions({ break; case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: moduleResolution = 3 /* Node16 */; break; case 199 /* NodeNext */: @@ -21932,6 +21968,7 @@ var _computedOptions = createComputedCompilerOptions({ switch (_computedOptions.module.computeValue(compilerOptions)) { case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: case 200 /* Preserve */: return true; @@ -21974,8 +22011,8 @@ var _computedOptions = createComputedCompilerOptions({ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { return false; } - if (compilerOptions.resolvePackageJsonExports !== void 0) { - return compilerOptions.resolvePackageJsonExports; + if (compilerOptions.resolvePackageJsonImports !== void 0) { + return compilerOptions.resolvePackageJsonImports; } switch (moduleResolution) { case 3 /* Node16 */: @@ -21992,6 +22029,14 @@ var _computedOptions = createComputedCompilerOptions({ if (compilerOptions.resolveJsonModule !== void 0) { return compilerOptions.resolveJsonModule; } + switch (_computedOptions.module.computeValue(compilerOptions)) { + // TODO in 6.0: uncomment + // case ModuleKind.Node16: + // case ModuleKind.Node18: + case 102 /* Node20 */: + case 199 /* NodeNext */: + return true; + } return _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */; } }, @@ -22261,7 +22306,7 @@ function escapeRegExpCharacter(match) { } var wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; -var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; +var implicitExcludePathRegexPattern = `(?!(?:${commonPackageFolders.join("|")})(?:/|$))`; var filesMatcher = { /** * Matches any single directory segment unless it is the last segment and a .min.js file @@ -22269,12 +22314,12 @@ var filesMatcher = { * [^./] # matches everything up to the first . character (excluding directory separators) * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension */ - singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*", /** * Regex for the ** wildcard. Matches any number of subdirectories. When used for including * files or directories, does not match subdirectories that start with a . character */ - doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) }; var directoriesMatcher = { @@ -22283,12 +22328,12 @@ var directoriesMatcher = { * Regex for the ** wildcard. Matches any number of subdirectories. When used for including * files or directories, does not match subdirectories that start with a . character */ - doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) }; var excludeMatcher = { singleAsteriskRegexFragment: "[^/]*", - doubleAsteriskRegexFragment: "(/.+?)?", + doubleAsteriskRegexFragment: "(?:/.+?)?", replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) }; var wildcardMatchers = { @@ -22301,9 +22346,9 @@ function getRegularExpressionForWildcard(specs, basePath, usage) { if (!patterns || !patterns.length) { return void 0; } - const pattern = patterns.map((pattern2) => `(${pattern2})`).join("|"); - const terminator = usage === "exclude" ? "($|/)" : "$"; - return `^(${pattern})${terminator}`; + const pattern = patterns.map((pattern2) => `(?:${pattern2})`).join("|"); + const terminator = usage === "exclude" ? "(?:$|/)" : "$"; + return `^(?:${pattern})${terminator}`; } function getRegularExpressionsForWildcards(specs, basePath, usage) { if (specs === void 0 || specs.length === 0) { @@ -22316,7 +22361,7 @@ function isImplicitGlob(lastPathComponent) { } function getPatternFromSpec(spec, basePath, usage) { const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); - return pattern && `^(${pattern})${usage === "exclude" ? "($|/)" : "$"}`; + return pattern && `^(?:${pattern})${usage === "exclude" ? "(?:$|/)" : "$"}`; } function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) { let subpattern = ""; @@ -22336,7 +22381,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm subpattern += doubleAsteriskRegexFragment; } else { if (usage === "directories") { - subpattern += "("; + subpattern += "(?:"; optionalCount++; } if (hasWrittenComponent) { @@ -22345,7 +22390,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm if (usage !== "exclude") { let componentPattern = ""; if (component.charCodeAt(0) === 42 /* asterisk */) { - componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + componentPattern += "(?:[^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } else if (component.charCodeAt(0) === 63 /* question */) { componentPattern += "[^./]"; @@ -22884,32 +22929,32 @@ function isShorthandPropertyNameUseSite(useSite) { return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite; } function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 80 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) { + while (node.kind === 80 /* Identifier */ || node.kind === 212 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 167 /* ComputedPropertyName */) { + if (node.kind !== 168 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) { return true; } const containerKind = node.parent.parent.kind; - return containerKind === 264 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */; + return containerKind === 265 /* InterfaceDeclaration */ || containerKind === 188 /* TypeLiteral */; } function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 80 /* Identifier */) return false; const heritageClause = findAncestor(node.parent, (parent2) => { switch (parent2.kind) { - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return true; - case 211 /* PropertyAccessExpression */: - case 233 /* ExpressionWithTypeArguments */: + case 212 /* PropertyAccessExpression */: + case 234 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 264 /* InterfaceDeclaration */; + return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 265 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName); @@ -23007,20 +23052,20 @@ function containsIgnoredPath(path) { function getContainingNodeArray(node) { if (!node.parent) return void 0; switch (node.kind) { - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: const { parent: parent3 } = node; - return parent3.kind === 195 /* InferType */ ? void 0 : parent3.typeParameters; - case 169 /* Parameter */: + return parent3.kind === 196 /* InferType */ ? void 0 : parent3.typeParameters; + case 170 /* Parameter */: return node.parent.parameters; - case 204 /* TemplateLiteralTypeSpan */: + case 205 /* TemplateLiteralTypeSpan */: return node.parent.templateSpans; - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return node.parent.templateSpans; - case 170 /* Decorator */: { + case 171 /* Decorator */: { const { parent: parent4 } = node; return canHaveDecorators(parent4) ? parent4.modifiers : void 0; } - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return node.parent.heritageClauses; } const { parent: parent2 } = node; @@ -23028,43 +23073,43 @@ function getContainingNodeArray(node) { return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; } switch (parent2.kind) { - case 187 /* TypeLiteral */: - case 264 /* InterfaceDeclaration */: + case 188 /* TypeLiteral */: + case 265 /* InterfaceDeclaration */: return isTypeElement(node) ? parent2.members : void 0; - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: return parent2.types; - case 189 /* TupleType */: - case 209 /* ArrayLiteralExpression */: - case 356 /* CommaListExpression */: - case 275 /* NamedImports */: - case 279 /* NamedExports */: + case 190 /* TupleType */: + case 210 /* ArrayLiteralExpression */: + case 357 /* CommaListExpression */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: return parent2.elements; - case 210 /* ObjectLiteralExpression */: - case 292 /* JsxAttributes */: + case 211 /* ObjectLiteralExpression */: + case 293 /* JsxAttributes */: return parent2.properties; - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments; - case 284 /* JsxElement */: - case 288 /* JsxFragment */: + case 285 /* JsxElement */: + case 289 /* JsxFragment */: return isJsxChild(node) ? parent2.children : void 0; - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return isTypeNode(node) ? parent2.typeArguments : void 0; - case 241 /* Block */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 269 /* ModuleBlock */: return parent2.statements; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return parent2.clauses; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return isClassElement(node) ? parent2.members : void 0; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return isEnumMember(node) ? parent2.members : void 0; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return parent2.statements; } } @@ -23073,7 +23118,7 @@ function hasContextSensitiveParameters(node) { if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) { return true; } - if (node.kind !== 219 /* ArrowFunction */) { + if (node.kind !== 220 /* ArrowFunction */) { const parameter = firstOrUndefined(node.parameters); if (!(parameter && parameterIsThisKeyword(parameter))) { return true; @@ -23086,10 +23131,10 @@ function isInfinityOrNaNString(name) { return name === "Infinity" || name === "-Infinity" || name === "NaN"; } function isCatchClauseVariableDeclaration(node) { - return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */; + return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 300 /* CatchClause */; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */; + return node.kind === 219 /* FunctionExpression */ || node.kind === 220 /* ArrowFunction */; } function escapeSnippetText(text) { return text.replace(/\$/g, () => "\\$"); @@ -23153,19 +23198,20 @@ function getNodeModulePathParts(fullPath) { } function isTypeDeclaration(node) { switch (node.kind) { - case 168 /* TypeParameter */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 169 /* TypeParameter */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return true; - case 273 /* ImportClause */: - return node.isTypeOnly; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 274 /* ImportClause */: + return node.phaseModifier === 156 /* TypeKeyword */; + case 277 /* ImportSpecifier */: + return node.parent.parent.phaseModifier === 156 /* TypeKeyword */; + case 282 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -23179,7 +23225,7 @@ function isOptionalJSDocPropertyLikeTag(node) { return false; } const { isBracketed, typeExpression } = node; - return isBracketed || !!typeExpression && typeExpression.type.kind === 316 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 317 /* JSDocOptionalType */; } function canUsePropertyAccess(name, languageVersion) { if (name.length === 0) { @@ -23194,17 +23240,17 @@ function hasTabstop(node) { } function isJSDocOptionalParameter(node) { return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - (node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag)); + (node.type && node.type.kind === 317 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag)); } function isOptionalDeclaration(declaration) { switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return !!declaration.questionToken; - case 169 /* Parameter */: + case 170 /* Parameter */: return !!declaration.questionToken || isJSDocOptionalParameter(declaration); - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: return isOptionalJSDocPropertyLikeTag(declaration); default: return false; @@ -23212,7 +23258,7 @@ function isOptionalDeclaration(declaration) { } function isNonNullAccess(node) { const kind = node.kind; - return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && isNonNullExpression(node.expression); + return (kind === 212 /* PropertyAccessExpression */ || kind === 213 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } function isJSDocSatisfiesExpression(node) { return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); @@ -23232,7 +23278,7 @@ function getTextOfJsxAttributeName(node) { } function isJsxAttributeName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 295 /* JsxNamespacedName */; + return kind === 80 /* Identifier */ || kind === 296 /* JsxNamespacedName */; } function getEscapedTextOfJsxNamespacedName(node) { return `${node.namespace.escapedText}:${idText(node.name)}`; @@ -23273,99 +23319,99 @@ function getNameFromImportAttribute(node) { } function isSourceElement(node) { switch (node.kind) { - case 168 /* TypeParameter */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 185 /* ConstructorType */: - case 184 /* FunctionType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 175 /* ClassStaticBlockDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 183 /* TypeReference */: - case 182 /* TypePredicate */: - case 186 /* TypeQuery */: - case 187 /* TypeLiteral */: - case 188 /* ArrayType */: - case 189 /* TupleType */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 196 /* ParenthesizedType */: - case 190 /* OptionalType */: - case 191 /* RestType */: - case 197 /* ThisType */: - case 198 /* TypeOperator */: - case 194 /* ConditionalType */: - case 195 /* InferType */: - case 203 /* TemplateLiteralType */: - case 205 /* ImportType */: - case 202 /* NamedTupleMember */: - case 328 /* JSDocAugmentsTag */: - case 329 /* JSDocImplementsTag */: - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 345 /* JSDocTemplateTag */: - case 344 /* JSDocTypeTag */: - case 324 /* JSDocLink */: - case 325 /* JSDocLinkCode */: - case 326 /* JSDocLinkPlain */: - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: - case 317 /* JSDocFunctionType */: - case 315 /* JSDocNonNullableType */: - case 314 /* JSDocNullableType */: - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: - case 322 /* JSDocTypeLiteral */: - case 318 /* JSDocVariadicType */: - case 309 /* JSDocTypeExpression */: - case 333 /* JSDocPublicTag */: - case 335 /* JSDocProtectedTag */: - case 334 /* JSDocPrivateTag */: - case 350 /* JSDocSatisfiesTag */: - case 343 /* JSDocThisTag */: - case 199 /* IndexedAccessType */: - case 200 /* MappedType */: - case 262 /* FunctionDeclaration */: - case 241 /* Block */: - case 268 /* ModuleBlock */: - case 243 /* VariableStatement */: - case 244 /* ExpressionStatement */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 251 /* ContinueStatement */: - case 252 /* BreakStatement */: - case 253 /* ReturnStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 256 /* LabeledStatement */: - case 257 /* ThrowStatement */: - case 258 /* TryStatement */: - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: - case 242 /* EmptyStatement */: - case 259 /* DebuggerStatement */: - case 282 /* MissingDeclaration */: + case 169 /* TypeParameter */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 186 /* ConstructorType */: + case 185 /* FunctionType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 176 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 184 /* TypeReference */: + case 183 /* TypePredicate */: + case 187 /* TypeQuery */: + case 188 /* TypeLiteral */: + case 189 /* ArrayType */: + case 190 /* TupleType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 197 /* ParenthesizedType */: + case 191 /* OptionalType */: + case 192 /* RestType */: + case 198 /* ThisType */: + case 199 /* TypeOperator */: + case 195 /* ConditionalType */: + case 196 /* InferType */: + case 204 /* TemplateLiteralType */: + case 206 /* ImportType */: + case 203 /* NamedTupleMember */: + case 329 /* JSDocAugmentsTag */: + case 330 /* JSDocImplementsTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 346 /* JSDocTemplateTag */: + case 345 /* JSDocTypeTag */: + case 325 /* JSDocLink */: + case 326 /* JSDocLinkCode */: + case 327 /* JSDocLinkPlain */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 318 /* JSDocFunctionType */: + case 316 /* JSDocNonNullableType */: + case 315 /* JSDocNullableType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: + case 323 /* JSDocTypeLiteral */: + case 319 /* JSDocVariadicType */: + case 310 /* JSDocTypeExpression */: + case 334 /* JSDocPublicTag */: + case 336 /* JSDocProtectedTag */: + case 335 /* JSDocPrivateTag */: + case 351 /* JSDocSatisfiesTag */: + case 344 /* JSDocThisTag */: + case 200 /* IndexedAccessType */: + case 201 /* MappedType */: + case 263 /* FunctionDeclaration */: + case 242 /* Block */: + case 269 /* ModuleBlock */: + case 244 /* VariableStatement */: + case 245 /* ExpressionStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 252 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 254 /* ReturnStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 257 /* LabeledStatement */: + case 258 /* ThrowStatement */: + case 259 /* TryStatement */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 243 /* EmptyStatement */: + case 260 /* DebuggerStatement */: + case 283 /* MissingDeclaration */: return true; } return false; @@ -23380,7 +23426,7 @@ function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameEx let hasExternalReferences = false; expr = skipParentheses(expr); switch (expr.kind) { - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const result = evaluate(expr.operand, location); resolvedOtherFiles = result.resolvedOtherFiles; hasExternalReferences = result.hasExternalReferences; @@ -23395,7 +23441,7 @@ function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameEx } } break; - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const left = evaluate(expr.left, location); const right = evaluate(expr.right, location); isSyntacticallyString = (left.isSyntacticallyString || right.isSyntacticallyString) && expr.operatorToken.kind === 40 /* PlusToken */; @@ -23445,18 +23491,18 @@ function createEvaluator({ evaluateElementAccessExpression, evaluateEntityNameEx /*isSyntacticallyString*/ true ); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return evaluateTemplateExpression(expr, location); case 9 /* NumericLiteral */: return evaluatorResult(+expr.text); case 80 /* Identifier */: return evaluateEntityNameExpression(expr, location); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (isEntityNameExpression(expr)) { return evaluateEntityNameExpression(expr, location); } break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return evaluateElementAccessExpression(expr, location); } return evaluatorResult( @@ -23502,7 +23548,7 @@ function isConstAssertion(location) { function findConstructorDeclaration(node) { const members = node.members; for (const member of members) { - if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 177 /* Constructor */ && nodeIsPresent(member.body)) { return member; } } @@ -23549,19 +23595,19 @@ function createNameResolver({ if (result = lookup(location.locals, name, meaning)) { let useResult = true; if (isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 320 /* JSDoc */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 321 /* JSDoc */) { useResult = result.flags & 262144 /* TypeParameter */ ? !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so type parameters are accessible from them - lastLocation === location.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 341 /* JSDocParameterTag */ || lastLocation.kind === 342 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false; + lastLocation === location.type || lastLocation.kind === 170 /* Parameter */ || lastLocation.kind === 342 /* JSDocParameterTag */ || lastLocation.kind === 343 /* JSDocReturnTag */ || lastLocation.kind === 169 /* TypeParameter */ : false; } if (meaning & result.flags & 3 /* Variable */) { if (useOuterVariableScopeInParameter(result, location, lastLocation)) { useResult = false; } else if (result.flags & 1 /* FunctionScopedVariable */) { - useResult = lastLocation.kind === 169 /* Parameter */ || !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so parameters are accessible from them + useResult = lastLocation.kind === 170 /* Parameter */ || !!(lastLocation.flags & 16 /* Synthesized */) || // Synthetic fake scopes are added for signatures so parameters are accessible from them lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter); } } - } else if (location.kind === 194 /* ConditionalType */) { + } else if (location.kind === 195 /* ConditionalType */) { useResult = lastLocation === location.trueType; } if (useResult) { @@ -23573,12 +23619,12 @@ function createNameResolver({ } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (!isExternalOrCommonJsModule(location)) break; // falls through - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const moduleExports = ((_a = getSymbolOfDeclaration(location)) == null ? void 0 : _a.exports) || emptySymbols; - if (location.kind === 307 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) { + if (location.kind === 308 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) { if (result = moduleExports.get("default" /* Default */)) { const localSymbol = getLocalSymbolForExportDefault(result); if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) { @@ -23587,7 +23633,7 @@ function createNameResolver({ result = void 0; } const moduleExport = moduleExports.get(name); - if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 281 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 280 /* NamespaceExport */))) { + if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 282 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 281 /* NamespaceExport */))) { break; } } @@ -23599,7 +23645,7 @@ function createNameResolver({ } } break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 33554432 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { error2( @@ -23613,7 +23659,7 @@ function createNameResolver({ break loop; } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (!isStatic(location)) { const ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -23624,9 +23670,9 @@ function createNameResolver({ } } break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: if (result = lookup(getSymbolOfDeclaration(location).members || emptySymbols, name, meaning & 788968 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = void 0; @@ -23648,7 +23694,7 @@ function createNameResolver({ } } break; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: if (lastLocation === location.expression && location.parent.token === 96 /* ExtendsKeyword */) { const container = location.parent.parent; if (isClassLike(container) && (result = lookup(getSymbolOfDeclaration(container).members, name, meaning & 788968 /* Type */))) { @@ -23667,9 +23713,9 @@ function createNameResolver({ // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (isClassLike(grandparent) || grandparent.kind === 264 /* InterfaceDeclaration */) { + if (isClassLike(grandparent) || grandparent.kind === 265 /* InterfaceDeclaration */) { if (result = lookup(getSymbolOfDeclaration(grandparent).members, name, meaning & 788968 /* Type */)) { if (nameNotFoundMessage) { error2(originalLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -23678,22 +23724,22 @@ function createNameResolver({ } } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) { break; } // falls through - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -23706,38 +23752,38 @@ function createNameResolver({ } } break; - case 170 /* Decorator */: - if (location.parent && location.parent.kind === 169 /* Parameter */) { + case 171 /* Decorator */: + if (location.parent && location.parent.kind === 170 /* Parameter */) { location = location.parent; } - if (location.parent && (isClassElement(location.parent) || location.parent.kind === 263 /* ClassDeclaration */)) { + if (location.parent && (isClassElement(location.parent) || location.parent.kind === 264 /* ClassDeclaration */)) { location = location.parent; } break; - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: - case 351 /* JSDocImportTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: + case 352 /* JSDocImportTag */: const root = getJSDocRoot(location); if (root) { location = root.parent; } break; - case 169 /* Parameter */: + case 170 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { associatedDeclarationForContainingInitializerOrBindingName = location; } } break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { if (isPartOfParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { associatedDeclarationForContainingInitializerOrBindingName = location; } } break; - case 195 /* InferType */: + case 196 /* InferType */: if (meaning & 262144 /* TypeParameter */) { const parameterName = location.typeParameter.name; if (parameterName && name === parameterName.escapedText) { @@ -23746,7 +23792,7 @@ function createNameResolver({ } } break; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: if (lastLocation && lastLocation === location.propertyName && location.parent.parent.moduleSpecifier) { location = location.parent.parent.parent; } @@ -23814,17 +23860,17 @@ function createNameResolver({ } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: return false; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 303 /* PropertyAssignment */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 304 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (hasStaticModifier(node)) { return !emitStandardClassFields; } @@ -23842,8 +23888,8 @@ function createNameResolver({ } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 219 /* ArrowFunction */ && location.kind !== 218 /* FunctionExpression */) { - return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 172 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); + if (location.kind !== 220 /* ArrowFunction */ && location.kind !== 219 /* FunctionExpression */) { + return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 173 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); } if (lastLocation && lastLocation === location.name) { return false; @@ -23855,14 +23901,14 @@ function createNameResolver({ } function isSelfReferenceLocation(node, lastLocation) { switch (node.kind) { - case 169 /* Parameter */: + case 170 /* Parameter */: return !!lastLocation && lastLocation === node.name; - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 267 /* ModuleDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 268 /* ModuleDeclaration */: return true; default: return false; @@ -23871,7 +23917,7 @@ function createNameResolver({ function isTypeParameterSymbolDeclaredInContainer(symbol, container) { if (symbol.declarations) { for (const decl of symbol.declarations) { - if (decl.kind === 168 /* TypeParameter */) { + if (decl.kind === 169 /* TypeParameter */) { const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent; if (parent2 === container) { return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias)); @@ -23893,7 +23939,7 @@ function isPrimitiveLiteralValue(node, includeBigInt = true) { return true; case 10 /* BigIntLiteral */: return includeBigInt; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: if (node.operator === 41 /* MinusToken */) { return isNumericLiteral(node.operand) || includeBigInt && isBigIntLiteral(node.operand); } @@ -23907,7 +23953,7 @@ function isPrimitiveLiteralValue(node, includeBigInt = true) { } } function unwrapParenthesizedExpression(o) { - while (o.kind === 217 /* ParenthesizedExpression */) { + while (o.kind === 218 /* ParenthesizedExpression */) { o = o.expression; } return o; @@ -23915,19 +23961,19 @@ function unwrapParenthesizedExpression(o) { function hasInferredType(node) { Debug.type(node); switch (node.kind) { - case 169 /* Parameter */: - case 171 /* PropertySignature */: - case 172 /* PropertyDeclaration */: - case 208 /* BindingElement */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 226 /* BinaryExpression */: - case 260 /* VariableDeclaration */: - case 277 /* ExportAssignment */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: + case 170 /* Parameter */: + case 172 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 209 /* BindingElement */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 227 /* BinaryExpression */: + case 261 /* VariableDeclaration */: + case 278 /* ExportAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: return true; default: assertType(node); @@ -24041,7 +24087,7 @@ function getNodeAtPosition(sourceFile, position, includeJSDoc) { }; while (true) { const child = isJavaScriptFile && includeJSDoc && hasJSDocNodes(current) && forEach(current.jsDoc, getContainingChild) || forEachChild(current, getContainingChild); - if (!child) { + if (!child || isMetaProperty(child)) { return current; } current = child; @@ -24062,7 +24108,7 @@ function forEachResolvedProjectReference(resolvedProjectReferences, cb) { /*projectReferences*/ void 0, resolvedProjectReferences, - (resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2) + (resolvedRef) => resolvedRef && cb(resolvedRef) ); } function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { @@ -24108,6 +24154,82 @@ function getOptionsSyntaxByValue(optionsObject, name, value) { function forEachOptionsSyntaxByName(optionsObject, name, callback) { return forEachPropertyAssignment(optionsObject, name, callback); } +function getSynthesizedDeepClone(node, includeTrivia = true) { + const clone2 = node && getSynthesizedDeepCloneWorker(node); + if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); + return setParentRecursive( + clone2, + /*incremental*/ + false + ); +} +function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { + let clone2 = replaceNode(node); + if (clone2) { + setOriginalNode(clone2, node); + } else { + clone2 = getSynthesizedDeepCloneWorker(node, replaceNode); + } + if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); + return clone2; +} +function getSynthesizedDeepCloneWorker(node, replaceNode) { + const nodeClone = replaceNode ? (n) => getSynthesizedDeepCloneWithReplacements( + n, + /*includeTrivia*/ + true, + replaceNode + ) : getSynthesizedDeepClone; + const nodesClone = replaceNode ? (ns) => ns && getSynthesizedDeepClonesWithReplacements( + ns, + /*includeTrivia*/ + true, + replaceNode + ) : (ns) => ns && getSynthesizedDeepClones(ns); + const visited = visitEachChild( + node, + nodeClone, + /*context*/ + void 0, + nodesClone, + nodeClone + ); + if (visited === node) { + const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node); + return setTextRange(clone2, node); + } + visited.parent = void 0; + return visited; +} +function getSynthesizedDeepClones(nodes, includeTrivia = true) { + if (nodes) { + const cloned = factory.createNodeArray(nodes.map((n) => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma); + setTextRange(cloned, nodes); + return cloned; + } + return nodes; +} +function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { + return factory.createNodeArray(nodes.map((n) => getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode)), nodes.hasTrailingComma); +} +function suppressLeadingAndTrailingTrivia(node) { + suppressLeadingTrivia(node); + suppressTrailingTrivia(node); +} +function suppressLeadingTrivia(node) { + addEmitFlagsRecursively(node, 1024 /* NoLeadingComments */, getFirstChild); +} +function suppressTrailingTrivia(node) { + addEmitFlagsRecursively(node, 2048 /* NoTrailingComments */, getLastChild); +} +function addEmitFlagsRecursively(node, flag, getChild) { + addEmitFlags(node, flag); + const child = getChild(node); + if (child) addEmitFlagsRecursively(child, flag, getChild); +} +function getFirstChild(node) { + return forEachChild(node, (child) => child); +} // src/compiler/factory/baseNodeFactory.ts function createBaseNodeFactory() { @@ -24230,16 +24352,16 @@ function createParenthesizerRules(factory2) { return parenthesizerRule; } function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - const binaryOperatorPrecedence = getOperatorPrecedence(226 /* BinaryExpression */, binaryOperator); - const binaryOperatorAssociativity = getOperatorAssociativity(226 /* BinaryExpression */, binaryOperator); + const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator); + const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator); const emittedOperand = skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { return true; } const operandPrecedence = getExpressionPrecedence(emittedOperand); switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { case -1 /* LessThan */: - if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 229 /* YieldExpression */) { + if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) { return false; } return true; @@ -24273,7 +24395,7 @@ function createParenthesizerRules(factory2) { if (isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { + if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { if (node.cachedLiteralKind !== void 0) { return node.cachedLiteralKind; } @@ -24286,7 +24408,7 @@ function createParenthesizerRules(factory2) { } function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { const skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 217 /* ParenthesizedExpression */) { + if (skipped.kind === 218 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand; @@ -24312,7 +24434,7 @@ function createParenthesizerRules(factory2) { return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - const conditionalPrecedence = getOperatorPrecedence(227 /* ConditionalExpression */, 58 /* QuestionToken */); + const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 58 /* QuestionToken */); const emittedCondition = skipPartiallyEmittedExpressions(condition); const conditionPrecedence = getExpressionPrecedence(emittedCondition); if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -24333,8 +24455,8 @@ function createParenthesizerRules(factory2) { /*stopAtCallExpressions*/ false ).kind) { - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: needsParens = true; } } @@ -24347,16 +24469,16 @@ function createParenthesizerRules(factory2) { true ); switch (leftmostExpr.kind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: return factory2.createParenthesizedExpression(expression); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression; } return parenthesizeLeftSideOfAccess(expression); } function parenthesizeLeftSideOfAccess(expression, optionalChain) { const emittedExpression = skipPartiallyEmittedExpressions(expression); - if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { + if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 215 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { return expression; } return setTextRange(factory2.createParenthesizedExpression(expression), expression); @@ -24374,7 +24496,7 @@ function createParenthesizerRules(factory2) { function parenthesizeExpressionForDisallowedComma(expression) { const emittedExpression = skipPartiallyEmittedExpressions(expression); const expressionPrecedence = getExpressionPrecedence(emittedExpression); - const commaPrecedence = getOperatorPrecedence(226 /* BinaryExpression */, 28 /* CommaToken */); + const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 28 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression); } function parenthesizeExpressionOfExpressionStatement(expression) { @@ -24382,7 +24504,7 @@ function createParenthesizerRules(factory2) { if (isCallExpression(emittedExpression)) { const callee = emittedExpression.expression; const kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) { + if (kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */) { const updated = factory2.updateCallExpression( emittedExpression, setTextRange(factory2.createParenthesizedExpression(callee), callee), @@ -24397,7 +24519,7 @@ function createParenthesizerRules(factory2) { /*stopAtCallExpressions*/ false ).kind; - if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) { + if (leftmostExpressionKind === 211 /* ObjectLiteralExpression */ || leftmostExpressionKind === 219 /* FunctionExpression */) { return setTextRange(factory2.createParenthesizedExpression(expression), expression); } return expression; @@ -24407,32 +24529,32 @@ function createParenthesizerRules(factory2) { body, /*stopAtCallExpressions*/ false - ).kind === 210 /* ObjectLiteralExpression */)) { + ).kind === 211 /* ObjectLiteralExpression */)) { return setTextRange(factory2.createParenthesizedExpression(body), body); } return body; } function parenthesizeCheckTypeOfConditionalType(checkType) { switch (checkType.kind) { - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 194 /* ConditionalType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 195 /* ConditionalType */: return factory2.createParenthesizedType(checkType); } return checkType; } function parenthesizeExtendsTypeOfConditionalType(extendsType) { switch (extendsType.kind) { - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return factory2.createParenthesizedType(extendsType); } return extendsType; } function parenthesizeConstituentTypeOfUnionType(type) { switch (type.kind) { - case 192 /* UnionType */: + case 193 /* UnionType */: // Not strictly necessary, but a union containing a union should have been flattened - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeCheckTypeOfConditionalType(type); @@ -24442,8 +24564,8 @@ function createParenthesizerRules(factory2) { } function parenthesizeConstituentTypeOfIntersectionType(type) { switch (type.kind) { - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeConstituentTypeOfUnionType(type); @@ -24453,23 +24575,23 @@ function createParenthesizerRules(factory2) { } function parenthesizeOperandOfTypeOperator(type) { switch (type.kind) { - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeConstituentTypeOfIntersectionType(type); } function parenthesizeOperandOfReadonlyTypeOperator(type) { switch (type.kind) { - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return factory2.createParenthesizedType(type); } return parenthesizeOperandOfTypeOperator(type); } function parenthesizeNonArrayTypeOfPostfixType(type) { switch (type.kind) { - case 195 /* InferType */: - case 198 /* TypeOperator */: - case 186 /* TypeQuery */: + case 196 /* InferType */: + case 199 /* TypeOperator */: + case 187 /* TypeQuery */: return factory2.createParenthesizedType(type); } return parenthesizeOperandOfTypeOperator(type); @@ -24638,11 +24760,11 @@ function createNodeConverters(factory2) { } function convertToAssignmentPattern(node) { switch (node.kind) { - case 207 /* ArrayBindingPattern */: - case 209 /* ArrayLiteralExpression */: + case 208 /* ArrayBindingPattern */: + case 210 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 206 /* ObjectBindingPattern */: - case 210 /* ObjectLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 211 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -25005,40 +25127,40 @@ function createNodeFactory(flags, baseFactory2) { updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure get createJSDocAllType() { - return getJSDocPrimaryTypeCreateFunction(312 /* JSDocAllType */); + return getJSDocPrimaryTypeCreateFunction(313 /* JSDocAllType */); }, get createJSDocUnknownType() { - return getJSDocPrimaryTypeCreateFunction(313 /* JSDocUnknownType */); + return getJSDocPrimaryTypeCreateFunction(314 /* JSDocUnknownType */); }, get createJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(315 /* JSDocNonNullableType */); + return getJSDocPrePostfixUnaryTypeCreateFunction(316 /* JSDocNonNullableType */); }, get updateJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(315 /* JSDocNonNullableType */); + return getJSDocPrePostfixUnaryTypeUpdateFunction(316 /* JSDocNonNullableType */); }, get createJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(314 /* JSDocNullableType */); + return getJSDocPrePostfixUnaryTypeCreateFunction(315 /* JSDocNullableType */); }, get updateJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(314 /* JSDocNullableType */); + return getJSDocPrePostfixUnaryTypeUpdateFunction(315 /* JSDocNullableType */); }, get createJSDocOptionalType() { - return getJSDocUnaryTypeCreateFunction(316 /* JSDocOptionalType */); + return getJSDocUnaryTypeCreateFunction(317 /* JSDocOptionalType */); }, get updateJSDocOptionalType() { - return getJSDocUnaryTypeUpdateFunction(316 /* JSDocOptionalType */); + return getJSDocUnaryTypeUpdateFunction(317 /* JSDocOptionalType */); }, get createJSDocVariadicType() { - return getJSDocUnaryTypeCreateFunction(318 /* JSDocVariadicType */); + return getJSDocUnaryTypeCreateFunction(319 /* JSDocVariadicType */); }, get updateJSDocVariadicType() { - return getJSDocUnaryTypeUpdateFunction(318 /* JSDocVariadicType */); + return getJSDocUnaryTypeUpdateFunction(319 /* JSDocVariadicType */); }, get createJSDocNamepathType() { - return getJSDocUnaryTypeCreateFunction(319 /* JSDocNamepathType */); + return getJSDocUnaryTypeCreateFunction(320 /* JSDocNamepathType */); }, get updateJSDocNamepathType() { - return getJSDocUnaryTypeUpdateFunction(319 /* JSDocNamepathType */); + return getJSDocUnaryTypeUpdateFunction(320 /* JSDocNamepathType */); }, createJSDocFunctionType, updateJSDocFunctionType, @@ -25080,82 +25202,82 @@ function createNodeFactory(flags, baseFactory2) { updateJSDocLinkPlain, // lazily load factory members for JSDoc tags with similar structure get createJSDocTypeTag() { - return getJSDocTypeLikeTagCreateFunction(344 /* JSDocTypeTag */); + return getJSDocTypeLikeTagCreateFunction(345 /* JSDocTypeTag */); }, get updateJSDocTypeTag() { - return getJSDocTypeLikeTagUpdateFunction(344 /* JSDocTypeTag */); + return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocTypeTag */); }, get createJSDocReturnTag() { - return getJSDocTypeLikeTagCreateFunction(342 /* JSDocReturnTag */); + return getJSDocTypeLikeTagCreateFunction(343 /* JSDocReturnTag */); }, get updateJSDocReturnTag() { - return getJSDocTypeLikeTagUpdateFunction(342 /* JSDocReturnTag */); + return getJSDocTypeLikeTagUpdateFunction(343 /* JSDocReturnTag */); }, get createJSDocThisTag() { - return getJSDocTypeLikeTagCreateFunction(343 /* JSDocThisTag */); + return getJSDocTypeLikeTagCreateFunction(344 /* JSDocThisTag */); }, get updateJSDocThisTag() { - return getJSDocTypeLikeTagUpdateFunction(343 /* JSDocThisTag */); + return getJSDocTypeLikeTagUpdateFunction(344 /* JSDocThisTag */); }, get createJSDocAuthorTag() { - return getJSDocSimpleTagCreateFunction(330 /* JSDocAuthorTag */); + return getJSDocSimpleTagCreateFunction(331 /* JSDocAuthorTag */); }, get updateJSDocAuthorTag() { - return getJSDocSimpleTagUpdateFunction(330 /* JSDocAuthorTag */); + return getJSDocSimpleTagUpdateFunction(331 /* JSDocAuthorTag */); }, get createJSDocClassTag() { - return getJSDocSimpleTagCreateFunction(332 /* JSDocClassTag */); + return getJSDocSimpleTagCreateFunction(333 /* JSDocClassTag */); }, get updateJSDocClassTag() { - return getJSDocSimpleTagUpdateFunction(332 /* JSDocClassTag */); + return getJSDocSimpleTagUpdateFunction(333 /* JSDocClassTag */); }, get createJSDocPublicTag() { - return getJSDocSimpleTagCreateFunction(333 /* JSDocPublicTag */); + return getJSDocSimpleTagCreateFunction(334 /* JSDocPublicTag */); }, get updateJSDocPublicTag() { - return getJSDocSimpleTagUpdateFunction(333 /* JSDocPublicTag */); + return getJSDocSimpleTagUpdateFunction(334 /* JSDocPublicTag */); }, get createJSDocPrivateTag() { - return getJSDocSimpleTagCreateFunction(334 /* JSDocPrivateTag */); + return getJSDocSimpleTagCreateFunction(335 /* JSDocPrivateTag */); }, get updateJSDocPrivateTag() { - return getJSDocSimpleTagUpdateFunction(334 /* JSDocPrivateTag */); + return getJSDocSimpleTagUpdateFunction(335 /* JSDocPrivateTag */); }, get createJSDocProtectedTag() { - return getJSDocSimpleTagCreateFunction(335 /* JSDocProtectedTag */); + return getJSDocSimpleTagCreateFunction(336 /* JSDocProtectedTag */); }, get updateJSDocProtectedTag() { - return getJSDocSimpleTagUpdateFunction(335 /* JSDocProtectedTag */); + return getJSDocSimpleTagUpdateFunction(336 /* JSDocProtectedTag */); }, get createJSDocReadonlyTag() { - return getJSDocSimpleTagCreateFunction(336 /* JSDocReadonlyTag */); + return getJSDocSimpleTagCreateFunction(337 /* JSDocReadonlyTag */); }, get updateJSDocReadonlyTag() { - return getJSDocSimpleTagUpdateFunction(336 /* JSDocReadonlyTag */); + return getJSDocSimpleTagUpdateFunction(337 /* JSDocReadonlyTag */); }, get createJSDocOverrideTag() { - return getJSDocSimpleTagCreateFunction(337 /* JSDocOverrideTag */); + return getJSDocSimpleTagCreateFunction(338 /* JSDocOverrideTag */); }, get updateJSDocOverrideTag() { - return getJSDocSimpleTagUpdateFunction(337 /* JSDocOverrideTag */); + return getJSDocSimpleTagUpdateFunction(338 /* JSDocOverrideTag */); }, get createJSDocDeprecatedTag() { - return getJSDocSimpleTagCreateFunction(331 /* JSDocDeprecatedTag */); + return getJSDocSimpleTagCreateFunction(332 /* JSDocDeprecatedTag */); }, get updateJSDocDeprecatedTag() { - return getJSDocSimpleTagUpdateFunction(331 /* JSDocDeprecatedTag */); + return getJSDocSimpleTagUpdateFunction(332 /* JSDocDeprecatedTag */); }, get createJSDocThrowsTag() { - return getJSDocTypeLikeTagCreateFunction(349 /* JSDocThrowsTag */); + return getJSDocTypeLikeTagCreateFunction(350 /* JSDocThrowsTag */); }, get updateJSDocThrowsTag() { - return getJSDocTypeLikeTagUpdateFunction(349 /* JSDocThrowsTag */); + return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocThrowsTag */); }, get createJSDocSatisfiesTag() { - return getJSDocTypeLikeTagCreateFunction(350 /* JSDocSatisfiesTag */); + return getJSDocTypeLikeTagCreateFunction(351 /* JSDocSatisfiesTag */); }, get updateJSDocSatisfiesTag() { - return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocSatisfiesTag */); + return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocSatisfiesTag */); }, createJSDocEnumTag, updateJSDocEnumTag, @@ -25610,7 +25732,7 @@ function createNodeFactory(flags, baseFactory2) { return baseFactory2.createBaseTokenNode(kind); } function createToken(token) { - Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token"); + Debug.assert(token >= 0 /* FirstToken */ && token <= 166 /* LastToken */, "Invalid token"); Debug.assert(token <= 15 /* FirstTemplateToken */ || token >= 18 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); Debug.assert(token <= 9 /* FirstLiteralToken */ || token >= 15 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); Debug.assert(token !== 80 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -25704,7 +25826,7 @@ function createNodeFactory(flags, baseFactory2) { return result.length ? result : void 0; } function createQualifiedName(left, right) { - const node = createBaseNode(166 /* QualifiedName */); + const node = createBaseNode(167 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); @@ -25715,7 +25837,7 @@ function createNodeFactory(flags, baseFactory2) { return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; } function createComputedPropertyName(expression) { - const node = createBaseNode(167 /* ComputedPropertyName */); + const node = createBaseNode(168 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; return node; @@ -25724,7 +25846,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; } function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { - const node = createBaseDeclaration(168 /* TypeParameter */); + const node = createBaseDeclaration(169 /* TypeParameter */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.constraint = constraint; @@ -25738,7 +25860,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; } function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { - const node = createBaseDeclaration(169 /* Parameter */); + const node = createBaseDeclaration(170 /* Parameter */); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; node.name = asName(name); @@ -25757,7 +25879,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; } function createDecorator(expression) { - const node = createBaseNode(170 /* Decorator */); + const node = createBaseNode(171 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -25770,7 +25892,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createDecorator(expression), node) : node; } function createPropertySignature(modifiers, name, questionToken, type) { - const node = createBaseDeclaration(171 /* PropertySignature */); + const node = createBaseDeclaration(172 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.type = type; @@ -25790,7 +25912,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) { - const node = createBaseDeclaration(172 /* PropertyDeclaration */); + const node = createBaseDeclaration(173 /* PropertyDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; @@ -25806,7 +25928,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - const node = createBaseDeclaration(173 /* MethodSignature */); + const node = createBaseDeclaration(174 /* MethodSignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -25824,7 +25946,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; } function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(174 /* MethodDeclaration */); + const node = createBaseDeclaration(175 /* MethodDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -25861,7 +25983,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createClassStaticBlockDeclaration(body) { - const node = createBaseDeclaration(175 /* ClassStaticBlockDeclaration */); + const node = createBaseDeclaration(176 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; node.modifiers = void 0; @@ -25882,7 +26004,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createConstructorDeclaration(modifiers, parameters, body) { - const node = createBaseDeclaration(176 /* Constructor */); + const node = createBaseDeclaration(177 /* Constructor */); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); node.body = body; @@ -25912,7 +26034,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createGetAccessorDeclaration(modifiers, name, parameters, type, body) { - const node = createBaseDeclaration(177 /* GetAccessor */); + const node = createBaseDeclaration(178 /* GetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.parameters = createNodeArray(parameters); @@ -25943,7 +26065,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createSetAccessorDeclaration(modifiers, name, parameters, body) { - const node = createBaseDeclaration(178 /* SetAccessor */); + const node = createBaseDeclaration(179 /* SetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.parameters = createNodeArray(parameters); @@ -25975,7 +26097,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createCallSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(179 /* CallSignature */); + const node = createBaseDeclaration(180 /* CallSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -25990,7 +26112,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; } function createConstructSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(180 /* ConstructSignature */); + const node = createBaseDeclaration(181 /* ConstructSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -26005,7 +26127,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; } function createIndexSignature(modifiers, parameters, type) { - const node = createBaseDeclaration(181 /* IndexSignature */); + const node = createBaseDeclaration(182 /* IndexSignature */); node.modifiers = asNodeArray(modifiers); node.parameters = asNodeArray(parameters); node.type = type; @@ -26020,7 +26142,7 @@ function createNodeFactory(flags, baseFactory2) { return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; } function createTemplateLiteralTypeSpan(type, literal) { - const node = createBaseNode(204 /* TemplateLiteralTypeSpan */); + const node = createBaseNode(205 /* TemplateLiteralTypeSpan */); node.type = type; node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; @@ -26033,7 +26155,7 @@ function createNodeFactory(flags, baseFactory2) { return createToken(kind); } function createTypePredicateNode(assertsModifier, parameterName, type) { - const node = createBaseNode(182 /* TypePredicate */); + const node = createBaseNode(183 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -26044,7 +26166,7 @@ function createNodeFactory(flags, baseFactory2) { return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; } function createTypeReferenceNode(typeName, typeArguments) { - const node = createBaseNode(183 /* TypeReference */); + const node = createBaseNode(184 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26054,7 +26176,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; } function createFunctionTypeNode(typeParameters, parameters, type) { - const node = createBaseDeclaration(184 /* FunctionType */); + const node = createBaseDeclaration(185 /* FunctionType */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -26079,7 +26201,7 @@ function createNodeFactory(flags, baseFactory2) { return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { - const node = createBaseDeclaration(185 /* ConstructorType */); + const node = createBaseDeclaration(186 /* ConstructorType */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); @@ -26110,7 +26232,7 @@ function createNodeFactory(flags, baseFactory2) { return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); } function createTypeQueryNode(exprName, typeArguments) { - const node = createBaseNode(186 /* TypeQuery */); + const node = createBaseNode(187 /* TypeQuery */); node.exprName = exprName; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26120,7 +26242,7 @@ function createNodeFactory(flags, baseFactory2) { return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; } function createTypeLiteralNode(members) { - const node = createBaseDeclaration(187 /* TypeLiteral */); + const node = createBaseDeclaration(188 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26129,7 +26251,7 @@ function createNodeFactory(flags, baseFactory2) { return node.members !== members ? update(createTypeLiteralNode(members), node) : node; } function createArrayTypeNode(elementType) { - const node = createBaseNode(188 /* ArrayType */); + const node = createBaseNode(189 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26138,7 +26260,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; } function createTupleTypeNode(elements) { - const node = createBaseNode(189 /* TupleType */); + const node = createBaseNode(190 /* TupleType */); node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26147,7 +26269,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - const node = createBaseDeclaration(202 /* NamedTupleMember */); + const node = createBaseDeclaration(203 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -26160,7 +26282,7 @@ function createNodeFactory(flags, baseFactory2) { return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; } function createOptionalTypeNode(type) { - const node = createBaseNode(190 /* OptionalType */); + const node = createBaseNode(191 /* OptionalType */); node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26169,7 +26291,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createOptionalTypeNode(type), node) : node; } function createRestTypeNode(type) { - const node = createBaseNode(191 /* RestType */); + const node = createBaseNode(192 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26187,19 +26309,19 @@ function createNodeFactory(flags, baseFactory2) { return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; } function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + return createUnionOrIntersectionTypeNode(193 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + return createUnionOrIntersectionTypeNode(194 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - const node = createBaseNode(194 /* ConditionalType */); + const node = createBaseNode(195 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); node.trueType = trueType; @@ -26213,7 +26335,7 @@ function createNodeFactory(flags, baseFactory2) { return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; } function createInferTypeNode(typeParameter) { - const node = createBaseNode(195 /* InferType */); + const node = createBaseNode(196 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26222,7 +26344,7 @@ function createNodeFactory(flags, baseFactory2) { return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; } function createTemplateLiteralType(head, templateSpans) { - const node = createBaseNode(203 /* TemplateLiteralType */); + const node = createBaseNode(204 /* TemplateLiteralType */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26232,7 +26354,7 @@ function createNodeFactory(flags, baseFactory2) { return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; } function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) { - const node = createBaseNode(205 /* ImportType */); + const node = createBaseNode(206 /* ImportType */); node.argument = argument; node.attributes = attributes; if (node.assertions && node.assertions.assertClause && node.attributes) { @@ -26248,7 +26370,7 @@ function createNodeFactory(flags, baseFactory2) { return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node; } function createParenthesizedType(type) { - const node = createBaseNode(196 /* ParenthesizedType */); + const node = createBaseNode(197 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26257,12 +26379,12 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createParenthesizedType(type), node) : node; } function createThisTypeNode() { - const node = createBaseNode(197 /* ThisType */); + const node = createBaseNode(198 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } function createTypeOperatorNode(operator, type) { - const node = createBaseNode(198 /* TypeOperator */); + const node = createBaseNode(199 /* TypeOperator */); node.operator = operator; node.type = operator === 148 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -26272,7 +26394,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; } function createIndexedAccessTypeNode(objectType, indexType) { - const node = createBaseNode(199 /* IndexedAccessType */); + const node = createBaseNode(200 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -26282,7 +26404,7 @@ function createNodeFactory(flags, baseFactory2) { return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { - const node = createBaseDeclaration(200 /* MappedType */); + const node = createBaseDeclaration(201 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.nameType = nameType; @@ -26298,7 +26420,7 @@ function createNodeFactory(flags, baseFactory2) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; } function createLiteralTypeNode(literal) { - const node = createBaseNode(201 /* LiteralType */); + const node = createBaseNode(202 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -26307,7 +26429,7 @@ function createNodeFactory(flags, baseFactory2) { return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; } function createObjectBindingPattern(elements) { - const node = createBaseNode(206 /* ObjectBindingPattern */); + const node = createBaseNode(207 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { @@ -26319,7 +26441,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; } function createArrayBindingPattern(elements) { - const node = createBaseNode(207 /* ArrayBindingPattern */); + const node = createBaseNode(208 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; return node; @@ -26328,7 +26450,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; } function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - const node = createBaseDeclaration(208 /* BindingElement */); + const node = createBaseDeclaration(209 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -26341,7 +26463,7 @@ function createNodeFactory(flags, baseFactory2) { return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; } function createArrayLiteralExpression(elements, multiLine) { - const node = createBaseNode(209 /* ArrayLiteralExpression */); + const node = createBaseNode(210 /* ArrayLiteralExpression */); const lastElement = elements && lastOrUndefined(elements); const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); @@ -26353,7 +26475,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node; } function createObjectLiteralExpression(properties, multiLine) { - const node = createBaseDeclaration(210 /* ObjectLiteralExpression */); + const node = createBaseDeclaration(211 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -26364,7 +26486,7 @@ function createNodeFactory(flags, baseFactory2) { return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node; } function createBasePropertyAccessExpression(expression, questionDotToken, name) { - const node = createBaseDeclaration(211 /* PropertyAccessExpression */); + const node = createBaseDeclaration(212 /* PropertyAccessExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.name = name; @@ -26414,7 +26536,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; } function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { - const node = createBaseDeclaration(212 /* ElementAccessExpression */); + const node = createBaseDeclaration(213 /* ElementAccessExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.argumentExpression = argumentExpression; @@ -26464,7 +26586,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; } function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { - const node = createBaseDeclaration(213 /* CallExpression */); + const node = createBaseDeclaration(214 /* CallExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.typeArguments = typeArguments; @@ -26521,7 +26643,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; } function createNewExpression(expression, typeArguments, argumentsArray) { - const node = createBaseDeclaration(214 /* NewExpression */); + const node = createBaseDeclaration(215 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; @@ -26535,7 +26657,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node; } function createTaggedTemplateExpression(tag, typeArguments, template) { - const node = createBaseNode(215 /* TaggedTemplateExpression */); + const node = createBaseNode(216 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess( tag, /*optionalChain*/ @@ -26556,7 +26678,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; } function createTypeAssertion(type, expression) { - const node = createBaseNode(216 /* TypeAssertionExpression */); + const node = createBaseNode(217 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -26566,7 +26688,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; } function createParenthesizedExpression(expression) { - const node = createBaseNode(217 /* ParenthesizedExpression */); + const node = createBaseNode(218 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -26576,7 +26698,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; } function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(218 /* FunctionExpression */); + const node = createBaseDeclaration(219 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -26601,7 +26723,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - const node = createBaseDeclaration(219 /* ArrowFunction */); + const node = createBaseDeclaration(220 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -26623,7 +26745,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; } function createDeleteExpression(expression) { - const node = createBaseNode(220 /* DeleteExpression */); + const node = createBaseNode(221 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -26632,7 +26754,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createDeleteExpression(expression), node) : node; } function createTypeOfExpression(expression) { - const node = createBaseNode(221 /* TypeOfExpression */); + const node = createBaseNode(222 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -26641,7 +26763,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node; } function createVoidExpression(expression) { - const node = createBaseNode(222 /* VoidExpression */); + const node = createBaseNode(223 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -26650,7 +26772,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createVoidExpression(expression), node) : node; } function createAwaitExpression(expression) { - const node = createBaseNode(223 /* AwaitExpression */); + const node = createBaseNode(224 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */; return node; @@ -26659,7 +26781,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createAwaitExpression(expression), node) : node; } function createPrefixUnaryExpression(operator, operand) { - const node = createBaseNode(224 /* PrefixUnaryExpression */); + const node = createBaseNode(225 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -26672,7 +26794,7 @@ function createNodeFactory(flags, baseFactory2) { return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node; } function createPostfixUnaryExpression(operand, operator) { - const node = createBaseNode(225 /* PostfixUnaryExpression */); + const node = createBaseNode(226 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -26685,7 +26807,7 @@ function createNodeFactory(flags, baseFactory2) { return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node; } function createBinaryExpression(left, operator, right) { - const node = createBaseDeclaration(226 /* BinaryExpression */); + const node = createBaseDeclaration(227 /* BinaryExpression */); const operatorToken = asToken(operator); const operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -26718,7 +26840,7 @@ function createNodeFactory(flags, baseFactory2) { return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; } function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - const node = createBaseNode(227 /* ConditionalExpression */); + const node = createBaseNode(228 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken ?? createToken(58 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -26733,7 +26855,7 @@ function createNodeFactory(flags, baseFactory2) { return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; } function createTemplateExpression(head, templateSpans) { - const node = createBaseNode(228 /* TemplateExpression */); + const node = createBaseNode(229 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; @@ -26808,7 +26930,7 @@ function createNodeFactory(flags, baseFactory2) { } function createYieldExpression(asteriskToken, expression) { Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - const node = createBaseNode(229 /* YieldExpression */); + const node = createBaseNode(230 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */; @@ -26818,7 +26940,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node; } function createSpreadElement(expression) { - const node = createBaseNode(230 /* SpreadElement */); + const node = createBaseNode(231 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */; return node; @@ -26827,7 +26949,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createSpreadElement(expression), node) : node; } function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(231 /* ClassExpression */); + const node = createBaseDeclaration(232 /* ClassExpression */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -26841,10 +26963,10 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createOmittedExpression() { - return createBaseNode(232 /* OmittedExpression */); + return createBaseNode(233 /* OmittedExpression */); } function createExpressionWithTypeArguments(expression, typeArguments) { - const node = createBaseNode(233 /* ExpressionWithTypeArguments */); + const node = createBaseNode(234 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -26858,7 +26980,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; } function createAsExpression(expression, type) { - const node = createBaseNode(234 /* AsExpression */); + const node = createBaseNode(235 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -26868,7 +26990,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; } function createNonNullExpression(expression) { - const node = createBaseNode(235 /* NonNullExpression */); + const node = createBaseNode(236 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -26884,7 +27006,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; } function createSatisfiesExpression(expression, type) { - const node = createBaseNode(238 /* SatisfiesExpression */); + const node = createBaseNode(239 /* SatisfiesExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -26894,7 +27016,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; } function createNonNullChain(expression) { - const node = createBaseNode(235 /* NonNullExpression */); + const node = createBaseNode(236 /* NonNullExpression */); node.flags |= 64 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, @@ -26909,7 +27031,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createNonNullChain(expression), node) : node; } function createMetaProperty(keywordToken, name) { - const node = createBaseNode(236 /* MetaProperty */); + const node = createBaseNode(237 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -26930,7 +27052,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; } function createTemplateSpan(expression, literal) { - const node = createBaseNode(239 /* TemplateSpan */); + const node = createBaseNode(240 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; @@ -26940,12 +27062,12 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; } function createSemicolonClassElement() { - const node = createBaseNode(240 /* SemicolonClassElement */); + const node = createBaseNode(241 /* SemicolonClassElement */); node.transformFlags |= 1024 /* ContainsES2015 */; return node; } function createBlock(statements, multiLine) { - const node = createBaseNode(241 /* Block */); + const node = createBaseNode(242 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -26958,7 +27080,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; } function createVariableStatement(modifiers, declarationList) { - const node = createBaseNode(243 /* VariableStatement */); + const node = createBaseNode(244 /* VariableStatement */); node.modifiers = asNodeArray(modifiers); node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); @@ -26973,12 +27095,12 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; } function createEmptyStatement() { - const node = createBaseNode(242 /* EmptyStatement */); + const node = createBaseNode(243 /* EmptyStatement */); node.jsDoc = void 0; return node; } function createExpressionStatement(expression) { - const node = createBaseNode(244 /* ExpressionStatement */); + const node = createBaseNode(245 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -26989,7 +27111,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; } function createIfStatement(expression, thenStatement, elseStatement) { - const node = createBaseNode(245 /* IfStatement */); + const node = createBaseNode(246 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -27002,7 +27124,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node; } function createDoStatement(statement, expression) { - const node = createBaseNode(246 /* DoStatement */); + const node = createBaseNode(247 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); @@ -27014,7 +27136,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node; } function createWhileStatement(expression, statement) { - const node = createBaseNode(247 /* WhileStatement */); + const node = createBaseNode(248 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); @@ -27026,7 +27148,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node; } function createForStatement(initializer, condition, incrementor, statement) { - const node = createBaseNode(248 /* ForStatement */); + const node = createBaseNode(249 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -27042,7 +27164,7 @@ function createNodeFactory(flags, baseFactory2) { return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node; } function createForInStatement(initializer, expression, statement) { - const node = createBaseNode(249 /* ForInStatement */); + const node = createBaseNode(250 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -27057,7 +27179,7 @@ function createNodeFactory(flags, baseFactory2) { return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node; } function createForOfStatement(awaitModifier, initializer, expression, statement) { - const node = createBaseNode(250 /* ForOfStatement */); + const node = createBaseNode(251 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -27074,7 +27196,7 @@ function createNodeFactory(flags, baseFactory2) { return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node; } function createContinueStatement(label) { - const node = createBaseNode(251 /* ContinueStatement */); + const node = createBaseNode(252 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -27085,7 +27207,7 @@ function createNodeFactory(flags, baseFactory2) { return node.label !== label ? update(createContinueStatement(label), node) : node; } function createBreakStatement(label) { - const node = createBaseNode(252 /* BreakStatement */); + const node = createBaseNode(253 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -27096,7 +27218,7 @@ function createNodeFactory(flags, baseFactory2) { return node.label !== label ? update(createBreakStatement(label), node) : node; } function createReturnStatement(expression) { - const node = createBaseNode(253 /* ReturnStatement */); + const node = createBaseNode(254 /* ReturnStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -27107,7 +27229,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createReturnStatement(expression), node) : node; } function createWithStatement(expression, statement) { - const node = createBaseNode(254 /* WithStatement */); + const node = createBaseNode(255 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); @@ -27119,7 +27241,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node; } function createSwitchStatement(expression, caseBlock) { - const node = createBaseNode(255 /* SwitchStatement */); + const node = createBaseNode(256 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); @@ -27132,7 +27254,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node; } function createLabeledStatement(label, statement) { - const node = createBaseNode(256 /* LabeledStatement */); + const node = createBaseNode(257 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); @@ -27144,7 +27266,7 @@ function createNodeFactory(flags, baseFactory2) { return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node; } function createThrowStatement(expression) { - const node = createBaseNode(257 /* ThrowStatement */); + const node = createBaseNode(258 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -27155,7 +27277,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createThrowStatement(expression), node) : node; } function createTryStatement(tryBlock, catchClause, finallyBlock) { - const node = createBaseNode(258 /* TryStatement */); + const node = createBaseNode(259 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -27168,13 +27290,13 @@ function createNodeFactory(flags, baseFactory2) { return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; } function createDebuggerStatement() { - const node = createBaseNode(259 /* DebuggerStatement */); + const node = createBaseNode(260 /* DebuggerStatement */); node.jsDoc = void 0; node.flowNode = void 0; return node; } function createVariableDeclaration(name, exclamationToken, type, initializer) { - const node = createBaseDeclaration(260 /* VariableDeclaration */); + const node = createBaseDeclaration(261 /* VariableDeclaration */); node.name = asName(name); node.exclamationToken = exclamationToken; node.type = type; @@ -27187,7 +27309,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; } function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { - const node = createBaseNode(261 /* VariableDeclarationList */); + const node = createBaseNode(262 /* VariableDeclarationList */); node.flags |= flags2 & 7 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; @@ -27203,7 +27325,7 @@ function createNodeFactory(flags, baseFactory2) { return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; } function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(262 /* FunctionDeclaration */); + const node = createBaseDeclaration(263 /* FunctionDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -27239,7 +27361,7 @@ function createNodeFactory(flags, baseFactory2) { return finishUpdateBaseSignatureDeclaration(updated, original); } function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(263 /* ClassDeclaration */); + const node = createBaseDeclaration(264 /* ClassDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -27260,7 +27382,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(264 /* InterfaceDeclaration */); + const node = createBaseDeclaration(265 /* InterfaceDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -27274,7 +27396,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { - const node = createBaseDeclaration(265 /* TypeAliasDeclaration */); + const node = createBaseDeclaration(266 /* TypeAliasDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -27289,7 +27411,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } function createEnumDeclaration(modifiers, name, members) { - const node = createBaseDeclaration(266 /* EnumDeclaration */); + const node = createBaseDeclaration(267 /* EnumDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.members = createNodeArray(members); @@ -27302,7 +27424,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { - const node = createBaseDeclaration(267 /* ModuleDeclaration */); + const node = createBaseDeclaration(268 /* ModuleDeclaration */); node.modifiers = asNodeArray(modifiers); node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */); node.name = name; @@ -27322,7 +27444,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } function createModuleBlock(statements) { - const node = createBaseNode(268 /* ModuleBlock */); + const node = createBaseNode(269 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; @@ -27332,7 +27454,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements ? update(createModuleBlock(statements), node) : node; } function createCaseBlock(clauses) { - const node = createBaseNode(269 /* CaseBlock */); + const node = createBaseNode(270 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); node.locals = void 0; @@ -27343,7 +27465,7 @@ function createNodeFactory(flags, baseFactory2) { return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; } function createNamespaceExportDeclaration(name) { - const node = createBaseDeclaration(270 /* NamespaceExportDeclaration */); + const node = createBaseDeclaration(271 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; node.modifiers = void 0; @@ -27360,7 +27482,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { - const node = createBaseDeclaration(271 /* ImportEqualsDeclaration */); + const node = createBaseDeclaration(272 /* ImportEqualsDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.isTypeOnly = isTypeOnly; @@ -27377,7 +27499,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) { - const node = createBaseNode(272 /* ImportDeclaration */); + const node = createBaseNode(273 /* ImportDeclaration */); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; @@ -27390,23 +27512,30 @@ function createNodeFactory(flags, baseFactory2) { function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) { return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node; } - function createImportClause2(isTypeOnly, name, namedBindings) { - const node = createBaseDeclaration(273 /* ImportClause */); - node.isTypeOnly = isTypeOnly; + function createImportClause2(phaseModifier, name, namedBindings) { + const node = createBaseDeclaration(274 /* ImportClause */); + if (typeof phaseModifier === "boolean") { + phaseModifier = phaseModifier ? 156 /* TypeKeyword */ : void 0; + } + node.isTypeOnly = phaseModifier === 156 /* TypeKeyword */; + node.phaseModifier = phaseModifier; node.name = name; node.namedBindings = namedBindings; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.namedBindings); - if (isTypeOnly) { + if (phaseModifier === 156 /* TypeKeyword */) { node.transformFlags |= 1 /* ContainsTypeScript */; } node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; return node; } - function updateImportClause(node, isTypeOnly, name, namedBindings) { - return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause2(isTypeOnly, name, namedBindings), node) : node; + function updateImportClause(node, phaseModifier, name, namedBindings) { + if (typeof phaseModifier === "boolean") { + phaseModifier = phaseModifier ? 156 /* TypeKeyword */ : void 0; + } + return node.phaseModifier !== phaseModifier || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause2(phaseModifier, name, namedBindings), node) : node; } function createAssertClause(elements, multiLine) { - const node = createBaseNode(300 /* AssertClause */); + const node = createBaseNode(301 /* AssertClause */); node.elements = createNodeArray(elements); node.multiLine = multiLine; node.token = 132 /* AssertKeyword */; @@ -27417,7 +27546,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node; } function createAssertEntry(name, value) { - const node = createBaseNode(301 /* AssertEntry */); + const node = createBaseNode(302 /* AssertEntry */); node.name = name; node.value = value; node.transformFlags |= 4 /* ContainsESNext */; @@ -27427,7 +27556,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node; } function createImportTypeAssertionContainer(clause, multiLine) { - const node = createBaseNode(302 /* ImportTypeAssertionContainer */); + const node = createBaseNode(303 /* ImportTypeAssertionContainer */); node.assertClause = clause; node.multiLine = multiLine; return node; @@ -27436,7 +27565,7 @@ function createNodeFactory(flags, baseFactory2) { return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; } function createImportAttributes(elements, multiLine, token) { - const node = createBaseNode(300 /* ImportAttributes */); + const node = createBaseNode(301 /* ImportAttributes */); node.token = token ?? 118 /* WithKeyword */; node.elements = createNodeArray(elements); node.multiLine = multiLine; @@ -27447,7 +27576,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node; } function createImportAttribute(name, value) { - const node = createBaseNode(301 /* ImportAttribute */); + const node = createBaseNode(302 /* ImportAttribute */); node.name = name; node.value = value; node.transformFlags |= 4 /* ContainsESNext */; @@ -27457,7 +27586,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node; } function createNamespaceImport(name) { - const node = createBaseDeclaration(274 /* NamespaceImport */); + const node = createBaseDeclaration(275 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27467,7 +27596,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createNamespaceImport(name), node) : node; } function createNamespaceExport(name) { - const node = createBaseDeclaration(280 /* NamespaceExport */); + const node = createBaseDeclaration(281 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27477,7 +27606,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createNamespaceExport(name), node) : node; } function createNamedImports(elements) { - const node = createBaseNode(275 /* NamedImports */); + const node = createBaseNode(276 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27487,7 +27616,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createNamedImports(elements), node) : node; } function createImportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseDeclaration(276 /* ImportSpecifier */); + const node = createBaseDeclaration(277 /* ImportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = propertyName; node.name = name; @@ -27499,7 +27628,7 @@ function createNodeFactory(flags, baseFactory2) { return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createExportAssignment2(modifiers, isExportEquals, expression) { - const node = createBaseDeclaration(277 /* ExportAssignment */); + const node = createBaseDeclaration(278 /* ExportAssignment */); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary( @@ -27517,7 +27646,7 @@ function createNodeFactory(flags, baseFactory2) { return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; } function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) { - const node = createBaseDeclaration(278 /* ExportDeclaration */); + const node = createBaseDeclaration(279 /* ExportDeclaration */); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; @@ -27540,7 +27669,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createNamedExports(elements) { - const node = createBaseNode(279 /* NamedExports */); + const node = createBaseNode(280 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27550,7 +27679,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createNamedExports(elements), node) : node; } function createExportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseNode(281 /* ExportSpecifier */); + const node = createBaseNode(282 /* ExportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = asName(propertyName); node.name = asName(name); @@ -27563,12 +27692,12 @@ function createNodeFactory(flags, baseFactory2) { return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createMissingDeclaration() { - const node = createBaseDeclaration(282 /* MissingDeclaration */); + const node = createBaseDeclaration(283 /* MissingDeclaration */); node.jsDoc = void 0; return node; } function createExternalModuleReference(expression) { - const node = createBaseNode(283 /* ExternalModuleReference */); + const node = createBaseNode(284 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -27600,7 +27729,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node; } function createJSDocFunctionType(parameters, type) { - const node = createBaseDeclaration(317 /* JSDocFunctionType */); + const node = createBaseDeclaration(318 /* JSDocFunctionType */); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); @@ -27614,7 +27743,7 @@ function createNodeFactory(flags, baseFactory2) { return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; } function createJSDocTypeLiteral(propertyTags, isArrayType = false) { - const node = createBaseDeclaration(322 /* JSDocTypeLiteral */); + const node = createBaseDeclaration(323 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -27623,7 +27752,7 @@ function createNodeFactory(flags, baseFactory2) { return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; } function createJSDocTypeExpression(type) { - const node = createBaseNode(309 /* JSDocTypeExpression */); + const node = createBaseNode(310 /* JSDocTypeExpression */); node.type = type; return node; } @@ -27631,7 +27760,7 @@ function createNodeFactory(flags, baseFactory2) { return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; } function createJSDocSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(323 /* JSDocSignature */); + const node = createBaseDeclaration(324 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -27660,7 +27789,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(345 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); + const node = createBaseJSDocTag(346 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -27669,7 +27798,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; } function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(346 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); + const node = createBaseJSDocTagDeclaration(347 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -27681,7 +27810,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(341 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); + const node = createBaseJSDocTagDeclaration(342 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -27692,7 +27821,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(348 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); + const node = createBaseJSDocTagDeclaration(349 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -27703,7 +27832,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(338 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); + const node = createBaseJSDocTagDeclaration(339 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -27715,7 +27844,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocOverloadTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTag(339 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); + const node = createBaseJSDocTag(340 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); node.typeExpression = typeExpression; return node; } @@ -27723,7 +27852,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; } function createJSDocAugmentsTag(tagName, className, comment) { - const node = createBaseJSDocTag(328 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); + const node = createBaseJSDocTag(329 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); node.class = className; return node; } @@ -27731,12 +27860,12 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; } function createJSDocImplementsTag(tagName, className, comment) { - const node = createBaseJSDocTag(329 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); + const node = createBaseJSDocTag(330 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); node.class = className; return node; } function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(347 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); + const node = createBaseJSDocTag(348 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); node.name = name; return node; } @@ -27744,7 +27873,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node; } function createJSDocNameReference(name) { - const node = createBaseNode(310 /* JSDocNameReference */); + const node = createBaseNode(311 /* JSDocNameReference */); node.name = name; return node; } @@ -27752,7 +27881,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocNameReference(name), node) : node; } function createJSDocMemberName(left, right) { - const node = createBaseNode(311 /* JSDocMemberName */); + const node = createBaseNode(312 /* JSDocMemberName */); node.left = left; node.right = right; node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); @@ -27762,7 +27891,7 @@ function createNodeFactory(flags, baseFactory2) { return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node; } function createJSDocLink(name, text) { - const node = createBaseNode(324 /* JSDocLink */); + const node = createBaseNode(325 /* JSDocLink */); node.name = name; node.text = text; return node; @@ -27771,7 +27900,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocLink(name, text), node) : node; } function createJSDocLinkCode(name, text) { - const node = createBaseNode(325 /* JSDocLinkCode */); + const node = createBaseNode(326 /* JSDocLinkCode */); node.name = name; node.text = text; return node; @@ -27780,7 +27909,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node; } function createJSDocLinkPlain(name, text) { - const node = createBaseNode(326 /* JSDocLinkPlain */); + const node = createBaseNode(327 /* JSDocLinkPlain */); node.name = name; node.text = text; return node; @@ -27807,14 +27936,14 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node; } function createJSDocUnknownTag(tagName, comment) { - const node = createBaseJSDocTag(327 /* JSDocTag */, tagName, comment); + const node = createBaseJSDocTag(328 /* JSDocTag */, tagName, comment); return node; } function updateJSDocUnknownTag(node, tagName, comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; } function createJSDocEnumTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTagDeclaration(340 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(340 /* JSDocEnumTag */)), comment); + const node = createBaseJSDocTagDeclaration(341 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(341 /* JSDocEnumTag */)), comment); node.typeExpression = typeExpression; node.locals = void 0; node.nextContainer = void 0; @@ -27824,7 +27953,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; } function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) { - const node = createBaseJSDocTag(351 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment); + const node = createBaseJSDocTag(352 /* JSDocImportTag */, tagName ?? createIdentifier("import"), comment); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.attributes = attributes; @@ -27835,7 +27964,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment), node) : node; } function createJSDocText(text) { - const node = createBaseNode(321 /* JSDocText */); + const node = createBaseNode(322 /* JSDocText */); node.text = text; return node; } @@ -27843,7 +27972,7 @@ function createNodeFactory(flags, baseFactory2) { return node.text !== text ? update(createJSDocText(text), node) : node; } function createJSDocComment(comment, tags) { - const node = createBaseNode(320 /* JSDoc */); + const node = createBaseNode(321 /* JSDoc */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -27852,7 +27981,7 @@ function createNodeFactory(flags, baseFactory2) { return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; } function createJsxElement(openingElement, children, closingElement) { - const node = createBaseNode(284 /* JsxElement */); + const node = createBaseNode(285 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -27863,7 +27992,7 @@ function createNodeFactory(flags, baseFactory2) { return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; } function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - const node = createBaseNode(285 /* JsxSelfClosingElement */); + const node = createBaseNode(286 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -27877,7 +28006,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; } function createJsxOpeningElement(tagName, typeArguments, attributes) { - const node = createBaseNode(286 /* JsxOpeningElement */); + const node = createBaseNode(287 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -27891,7 +28020,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; } function createJsxClosingElement(tagName) { - const node = createBaseNode(287 /* JsxClosingElement */); + const node = createBaseNode(288 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; return node; @@ -27900,7 +28029,7 @@ function createNodeFactory(flags, baseFactory2) { return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; } function createJsxFragment(openingFragment, children, closingFragment) { - const node = createBaseNode(288 /* JsxFragment */); + const node = createBaseNode(289 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -27921,17 +28050,17 @@ function createNodeFactory(flags, baseFactory2) { return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; } function createJsxOpeningFragment() { - const node = createBaseNode(289 /* JsxOpeningFragment */); + const node = createBaseNode(290 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } function createJsxJsxClosingFragment() { - const node = createBaseNode(290 /* JsxClosingFragment */); + const node = createBaseNode(291 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } function createJsxAttribute(name, initializer) { - const node = createBaseDeclaration(291 /* JsxAttribute */); + const node = createBaseDeclaration(292 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; @@ -27941,7 +28070,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; } function createJsxAttributes(properties) { - const node = createBaseDeclaration(292 /* JsxAttributes */); + const node = createBaseDeclaration(293 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; return node; @@ -27950,7 +28079,7 @@ function createNodeFactory(flags, baseFactory2) { return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; } function createJsxSpreadAttribute(expression) { - const node = createBaseNode(293 /* JsxSpreadAttribute */); + const node = createBaseNode(294 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; @@ -27959,7 +28088,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; } function createJsxExpression(dotDotDotToken, expression) { - const node = createBaseNode(294 /* JsxExpression */); + const node = createBaseNode(295 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; @@ -27969,7 +28098,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; } function createJsxNamespacedName(namespace, name) { - const node = createBaseNode(295 /* JsxNamespacedName */); + const node = createBaseNode(296 /* JsxNamespacedName */); node.namespace = namespace; node.name = name; node.transformFlags |= propagateChildFlags(node.namespace) | propagateChildFlags(node.name) | 2 /* ContainsJsx */; @@ -27979,7 +28108,7 @@ function createNodeFactory(flags, baseFactory2) { return node.namespace !== namespace || node.name !== name ? update(createJsxNamespacedName(namespace, name), node) : node; } function createCaseClause(expression, statements) { - const node = createBaseNode(296 /* CaseClause */); + const node = createBaseNode(297 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); @@ -27990,7 +28119,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; } function createDefaultClause(statements) { - const node = createBaseNode(297 /* DefaultClause */); + const node = createBaseNode(298 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -27999,7 +28128,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements ? update(createDefaultClause(statements), node) : node; } function createHeritageClause(token, types) { - const node = createBaseNode(298 /* HeritageClause */); + const node = createBaseNode(299 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -28019,7 +28148,7 @@ function createNodeFactory(flags, baseFactory2) { return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; } function createCatchClause(variableDeclaration, block) { - const node = createBaseNode(299 /* CatchClause */); + const node = createBaseNode(300 /* CatchClause */); node.variableDeclaration = asVariableDeclaration(variableDeclaration); node.block = block; node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */); @@ -28031,7 +28160,7 @@ function createNodeFactory(flags, baseFactory2) { return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; } function createPropertyAssignment(name, initializer) { - const node = createBaseDeclaration(303 /* PropertyAssignment */); + const node = createBaseDeclaration(304 /* PropertyAssignment */); node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); @@ -28053,7 +28182,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - const node = createBaseDeclaration(304 /* ShorthandPropertyAssignment */); + const node = createBaseDeclaration(305 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; @@ -28077,7 +28206,7 @@ function createNodeFactory(flags, baseFactory2) { return update(updated, original); } function createSpreadAssignment(expression) { - const node = createBaseDeclaration(305 /* SpreadAssignment */); + const node = createBaseDeclaration(306 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; @@ -28087,7 +28216,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; } function createEnumMember(name, initializer) { - const node = createBaseDeclaration(306 /* EnumMember */); + const node = createBaseDeclaration(307 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; @@ -28098,7 +28227,7 @@ function createNodeFactory(flags, baseFactory2) { return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; } function createSourceFile2(statements, endOfFileToken, flags2) { - const node = baseFactory2.createBaseSourceFileNode(307 /* SourceFile */); + const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags2; @@ -28178,7 +28307,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function cloneSourceFileWorker(source) { - const node = baseFactory2.createBaseSourceFileNode(307 /* SourceFile */); + const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */); node.flags |= source.flags & ~16 /* Synthesized */; for (const p in source) { if (hasProperty(node, p) || !hasProperty(source, p)) { @@ -28212,7 +28341,7 @@ function createNodeFactory(flags, baseFactory2) { return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; } function createBundle(sourceFiles) { - const node = createBaseNode(308 /* Bundle */); + const node = createBaseNode(309 /* Bundle */); node.sourceFiles = sourceFiles; node.syntheticFileReferences = void 0; node.syntheticTypeReferences = void 0; @@ -28224,25 +28353,25 @@ function createNodeFactory(flags, baseFactory2) { return node.sourceFiles !== sourceFiles ? update(createBundle(sourceFiles), node) : node; } function createSyntheticExpression(type, isSpread = false, tupleNameSource) { - const node = createBaseNode(237 /* SyntheticExpression */); + const node = createBaseNode(238 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; return node; } function createSyntaxList3(children) { - const node = createBaseNode(352 /* SyntaxList */); + const node = createBaseNode(353 /* SyntaxList */); node._children = children; return node; } function createNotEmittedStatement(original) { - const node = createBaseNode(353 /* NotEmittedStatement */); + const node = createBaseNode(354 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } function createPartiallyEmittedExpression(expression, original) { - const node = createBaseNode(355 /* PartiallyEmittedExpression */); + const node = createBaseNode(356 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; @@ -28253,7 +28382,7 @@ function createNodeFactory(flags, baseFactory2) { return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; } function createNotEmittedTypeElement() { - return createBaseNode(354 /* NotEmittedTypeElement */); + return createBaseNode(355 /* NotEmittedTypeElement */); } function flattenCommaElements(node) { if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { @@ -28267,7 +28396,7 @@ function createNodeFactory(flags, baseFactory2) { return node; } function createCommaListExpression(elements) { - const node = createBaseNode(356 /* CommaListExpression */); + const node = createBaseNode(357 /* CommaListExpression */); node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -28276,7 +28405,7 @@ function createNodeFactory(flags, baseFactory2) { return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(357 /* SyntheticReferenceExpression */); + const node = createBaseNode(358 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -28511,19 +28640,19 @@ function createNodeFactory(flags, baseFactory2) { } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 234 /* AsExpression */: + case 235 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return updateExpressionWithTypeArguments(outerExpression, expression, outerExpression.typeArguments); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } @@ -28563,13 +28692,13 @@ function createNodeFactory(flags, baseFactory2) { case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: return false; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: const elements = target.elements; if (elements.length === 0) { return false; } return true; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -28831,19 +28960,19 @@ function createNodeFactory(flags, baseFactory2) { } function replacePropertyName(node, name) { switch (node.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return updateGetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.type, node.body); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return updateSetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.body); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return updateMethodDeclaration(node, node.modifiers, node.asteriskToken, name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body); - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: return updateMethodSignature(node, node.modifiers, name, node.questionToken, node.typeParameters, node.parameters, node.type); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return updatePropertyDeclaration2(node, node.modifiers, name, node.questionToken ?? node.exclamationToken, node.type, node.initializer); - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return updatePropertySignature(node, node.modifiers, name, node.questionToken, node.type); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return updatePropertyAssignment(node, name, node.initializer); } } @@ -28889,45 +29018,45 @@ function createNodeFactory(flags, baseFactory2) { } function getDefaultTagNameForKind(kind) { switch (kind) { - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: return "type"; - case 342 /* JSDocReturnTag */: + case 343 /* JSDocReturnTag */: return "returns"; - case 343 /* JSDocThisTag */: + case 344 /* JSDocThisTag */: return "this"; - case 340 /* JSDocEnumTag */: + case 341 /* JSDocEnumTag */: return "enum"; - case 330 /* JSDocAuthorTag */: + case 331 /* JSDocAuthorTag */: return "author"; - case 332 /* JSDocClassTag */: + case 333 /* JSDocClassTag */: return "class"; - case 333 /* JSDocPublicTag */: + case 334 /* JSDocPublicTag */: return "public"; - case 334 /* JSDocPrivateTag */: + case 335 /* JSDocPrivateTag */: return "private"; - case 335 /* JSDocProtectedTag */: + case 336 /* JSDocProtectedTag */: return "protected"; - case 336 /* JSDocReadonlyTag */: + case 337 /* JSDocReadonlyTag */: return "readonly"; - case 337 /* JSDocOverrideTag */: + case 338 /* JSDocOverrideTag */: return "override"; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return "template"; - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return "typedef"; - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: return "param"; - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: return "prop"; - case 338 /* JSDocCallbackTag */: + case 339 /* JSDocCallbackTag */: return "callback"; - case 339 /* JSDocOverloadTag */: + case 340 /* JSDocOverloadTag */: return "overload"; - case 328 /* JSDocAugmentsTag */: + case 329 /* JSDocAugmentsTag */: return "augments"; - case 329 /* JSDocImplementsTag */: + case 330 /* JSDocImplementsTag */: return "implements"; - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return "import"; default: return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`); @@ -29010,35 +29139,35 @@ function aggregateChildrenFlags(children) { children.transformFlags = subtreeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) { + if (kind >= 183 /* FirstTypeNode */ && kind <= 206 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 209 /* ArrayLiteralExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 210 /* ArrayLiteralExpression */: return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return -1941676032 /* ModuleExcludes */; - case 169 /* Parameter */: + case 170 /* Parameter */: return -2147483648 /* ParameterExcludes */; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return -2072174592 /* ArrowFunctionExcludes */; - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: return -1937940480 /* FunctionExcludes */; - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return -2146893824 /* VariableDeclarationListExcludes */; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return -2147344384 /* ClassExcludes */; - case 176 /* Constructor */: + case 177 /* Constructor */: return -1937948672 /* ConstructorExcludes */; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return -2013249536 /* PropertyExcludes */; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return -2005057536 /* MethodOrAccessorExcludes */; case 133 /* AnyKeyword */: case 150 /* NumberKeyword */: @@ -29049,31 +29178,31 @@ function getTransformFlagsSubtreeExclusions(kind) { case 136 /* BooleanKeyword */: case 155 /* SymbolKeyword */: case 116 /* VoidKeyword */: - case 168 /* TypeParameter */: - case 171 /* PropertySignature */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 169 /* TypeParameter */: + case 172 /* PropertySignature */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return -2147278848 /* ObjectLiteralExcludes */; - case 299 /* CatchClause */: + case 300 /* CatchClause */: return -2147418112 /* CatchClauseExcludes */; - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return -2147450880 /* BindingPatternExcludes */; - case 216 /* TypeAssertionExpression */: - case 238 /* SatisfiesExpression */: - case 234 /* AsExpression */: - case 355 /* PartiallyEmittedExpression */: - case 217 /* ParenthesizedExpression */: + case 217 /* TypeAssertionExpression */: + case 239 /* SatisfiesExpression */: + case 235 /* AsExpression */: + case 356 /* PartiallyEmittedExpression */: + case 218 /* ParenthesizedExpression */: case 108 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return -2147483648 /* PropertyAccessExcludes */; default: return -2147483648 /* NodeExcludes */; @@ -29178,7 +29307,7 @@ function mergeTokenSourceMapRanges(sourceRanges, destRanges) { function getOrCreateEmitNode(node) { if (!node.emitNode) { if (isParseTreeNode(node)) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } const sourceFile = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node))) ?? Debug.fail("Could not determine parsed source file."); @@ -30593,583 +30722,583 @@ function isCaseKeyword(node) { return node.kind === 84 /* CaseKeyword */; } function isQualifiedName(node) { - return node.kind === 166 /* QualifiedName */; + return node.kind === 167 /* QualifiedName */; } function isComputedPropertyName(node) { - return node.kind === 167 /* ComputedPropertyName */; + return node.kind === 168 /* ComputedPropertyName */; } function isTypeParameterDeclaration(node) { - return node.kind === 168 /* TypeParameter */; + return node.kind === 169 /* TypeParameter */; } function isParameter(node) { - return node.kind === 169 /* Parameter */; + return node.kind === 170 /* Parameter */; } function isDecorator(node) { - return node.kind === 170 /* Decorator */; + return node.kind === 171 /* Decorator */; } function isPropertySignature(node) { - return node.kind === 171 /* PropertySignature */; + return node.kind === 172 /* PropertySignature */; } function isPropertyDeclaration(node) { - return node.kind === 172 /* PropertyDeclaration */; + return node.kind === 173 /* PropertyDeclaration */; } function isMethodSignature(node) { - return node.kind === 173 /* MethodSignature */; + return node.kind === 174 /* MethodSignature */; } function isMethodDeclaration(node) { - return node.kind === 174 /* MethodDeclaration */; + return node.kind === 175 /* MethodDeclaration */; } function isClassStaticBlockDeclaration(node) { - return node.kind === 175 /* ClassStaticBlockDeclaration */; + return node.kind === 176 /* ClassStaticBlockDeclaration */; } function isConstructorDeclaration(node) { - return node.kind === 176 /* Constructor */; + return node.kind === 177 /* Constructor */; } function isGetAccessorDeclaration(node) { - return node.kind === 177 /* GetAccessor */; + return node.kind === 178 /* GetAccessor */; } function isSetAccessorDeclaration(node) { - return node.kind === 178 /* SetAccessor */; + return node.kind === 179 /* SetAccessor */; } function isCallSignatureDeclaration(node) { - return node.kind === 179 /* CallSignature */; + return node.kind === 180 /* CallSignature */; } function isConstructSignatureDeclaration(node) { - return node.kind === 180 /* ConstructSignature */; + return node.kind === 181 /* ConstructSignature */; } function isIndexSignatureDeclaration(node) { - return node.kind === 181 /* IndexSignature */; + return node.kind === 182 /* IndexSignature */; } function isTypePredicateNode(node) { - return node.kind === 182 /* TypePredicate */; + return node.kind === 183 /* TypePredicate */; } function isTypeReferenceNode(node) { - return node.kind === 183 /* TypeReference */; + return node.kind === 184 /* TypeReference */; } function isFunctionTypeNode(node) { - return node.kind === 184 /* FunctionType */; + return node.kind === 185 /* FunctionType */; } function isConstructorTypeNode(node) { - return node.kind === 185 /* ConstructorType */; + return node.kind === 186 /* ConstructorType */; } function isTypeQueryNode(node) { - return node.kind === 186 /* TypeQuery */; + return node.kind === 187 /* TypeQuery */; } function isTypeLiteralNode(node) { - return node.kind === 187 /* TypeLiteral */; + return node.kind === 188 /* TypeLiteral */; } function isArrayTypeNode(node) { - return node.kind === 188 /* ArrayType */; + return node.kind === 189 /* ArrayType */; } function isTupleTypeNode(node) { - return node.kind === 189 /* TupleType */; + return node.kind === 190 /* TupleType */; } function isNamedTupleMember(node) { - return node.kind === 202 /* NamedTupleMember */; + return node.kind === 203 /* NamedTupleMember */; } function isOptionalTypeNode(node) { - return node.kind === 190 /* OptionalType */; + return node.kind === 191 /* OptionalType */; } function isRestTypeNode(node) { - return node.kind === 191 /* RestType */; + return node.kind === 192 /* RestType */; } function isUnionTypeNode(node) { - return node.kind === 192 /* UnionType */; + return node.kind === 193 /* UnionType */; } function isIntersectionTypeNode(node) { - return node.kind === 193 /* IntersectionType */; + return node.kind === 194 /* IntersectionType */; } function isConditionalTypeNode(node) { - return node.kind === 194 /* ConditionalType */; + return node.kind === 195 /* ConditionalType */; } function isInferTypeNode(node) { - return node.kind === 195 /* InferType */; + return node.kind === 196 /* InferType */; } function isParenthesizedTypeNode(node) { - return node.kind === 196 /* ParenthesizedType */; + return node.kind === 197 /* ParenthesizedType */; } function isThisTypeNode(node) { - return node.kind === 197 /* ThisType */; + return node.kind === 198 /* ThisType */; } function isTypeOperatorNode(node) { - return node.kind === 198 /* TypeOperator */; + return node.kind === 199 /* TypeOperator */; } function isIndexedAccessTypeNode(node) { - return node.kind === 199 /* IndexedAccessType */; + return node.kind === 200 /* IndexedAccessType */; } function isMappedTypeNode(node) { - return node.kind === 200 /* MappedType */; + return node.kind === 201 /* MappedType */; } function isLiteralTypeNode(node) { - return node.kind === 201 /* LiteralType */; + return node.kind === 202 /* LiteralType */; } function isImportTypeNode(node) { - return node.kind === 205 /* ImportType */; + return node.kind === 206 /* ImportType */; } function isTemplateLiteralTypeSpan(node) { - return node.kind === 204 /* TemplateLiteralTypeSpan */; + return node.kind === 205 /* TemplateLiteralTypeSpan */; } function isTemplateLiteralTypeNode(node) { - return node.kind === 203 /* TemplateLiteralType */; + return node.kind === 204 /* TemplateLiteralType */; } function isObjectBindingPattern(node) { - return node.kind === 206 /* ObjectBindingPattern */; + return node.kind === 207 /* ObjectBindingPattern */; } function isArrayBindingPattern(node) { - return node.kind === 207 /* ArrayBindingPattern */; + return node.kind === 208 /* ArrayBindingPattern */; } function isBindingElement(node) { - return node.kind === 208 /* BindingElement */; + return node.kind === 209 /* BindingElement */; } function isArrayLiteralExpression(node) { - return node.kind === 209 /* ArrayLiteralExpression */; + return node.kind === 210 /* ArrayLiteralExpression */; } function isObjectLiteralExpression(node) { - return node.kind === 210 /* ObjectLiteralExpression */; + return node.kind === 211 /* ObjectLiteralExpression */; } function isPropertyAccessExpression(node) { - return node.kind === 211 /* PropertyAccessExpression */; + return node.kind === 212 /* PropertyAccessExpression */; } function isElementAccessExpression(node) { - return node.kind === 212 /* ElementAccessExpression */; + return node.kind === 213 /* ElementAccessExpression */; } function isCallExpression(node) { - return node.kind === 213 /* CallExpression */; + return node.kind === 214 /* CallExpression */; } function isNewExpression(node) { - return node.kind === 214 /* NewExpression */; + return node.kind === 215 /* NewExpression */; } function isTaggedTemplateExpression(node) { - return node.kind === 215 /* TaggedTemplateExpression */; + return node.kind === 216 /* TaggedTemplateExpression */; } function isTypeAssertionExpression(node) { - return node.kind === 216 /* TypeAssertionExpression */; + return node.kind === 217 /* TypeAssertionExpression */; } function isParenthesizedExpression(node) { - return node.kind === 217 /* ParenthesizedExpression */; + return node.kind === 218 /* ParenthesizedExpression */; } function isFunctionExpression(node) { - return node.kind === 218 /* FunctionExpression */; + return node.kind === 219 /* FunctionExpression */; } function isArrowFunction(node) { - return node.kind === 219 /* ArrowFunction */; + return node.kind === 220 /* ArrowFunction */; } function isDeleteExpression(node) { - return node.kind === 220 /* DeleteExpression */; + return node.kind === 221 /* DeleteExpression */; } function isTypeOfExpression(node) { - return node.kind === 221 /* TypeOfExpression */; + return node.kind === 222 /* TypeOfExpression */; } function isVoidExpression(node) { - return node.kind === 222 /* VoidExpression */; + return node.kind === 223 /* VoidExpression */; } function isAwaitExpression(node) { - return node.kind === 223 /* AwaitExpression */; + return node.kind === 224 /* AwaitExpression */; } function isPrefixUnaryExpression(node) { - return node.kind === 224 /* PrefixUnaryExpression */; + return node.kind === 225 /* PrefixUnaryExpression */; } function isPostfixUnaryExpression(node) { - return node.kind === 225 /* PostfixUnaryExpression */; + return node.kind === 226 /* PostfixUnaryExpression */; } function isBinaryExpression(node) { - return node.kind === 226 /* BinaryExpression */; + return node.kind === 227 /* BinaryExpression */; } function isConditionalExpression(node) { - return node.kind === 227 /* ConditionalExpression */; + return node.kind === 228 /* ConditionalExpression */; } function isTemplateExpression(node) { - return node.kind === 228 /* TemplateExpression */; + return node.kind === 229 /* TemplateExpression */; } function isYieldExpression(node) { - return node.kind === 229 /* YieldExpression */; + return node.kind === 230 /* YieldExpression */; } function isSpreadElement(node) { - return node.kind === 230 /* SpreadElement */; + return node.kind === 231 /* SpreadElement */; } function isClassExpression(node) { - return node.kind === 231 /* ClassExpression */; + return node.kind === 232 /* ClassExpression */; } function isOmittedExpression(node) { - return node.kind === 232 /* OmittedExpression */; + return node.kind === 233 /* OmittedExpression */; } function isExpressionWithTypeArguments(node) { - return node.kind === 233 /* ExpressionWithTypeArguments */; + return node.kind === 234 /* ExpressionWithTypeArguments */; } function isAsExpression(node) { - return node.kind === 234 /* AsExpression */; + return node.kind === 235 /* AsExpression */; } function isSatisfiesExpression(node) { - return node.kind === 238 /* SatisfiesExpression */; + return node.kind === 239 /* SatisfiesExpression */; } function isNonNullExpression(node) { - return node.kind === 235 /* NonNullExpression */; + return node.kind === 236 /* NonNullExpression */; } function isMetaProperty(node) { - return node.kind === 236 /* MetaProperty */; + return node.kind === 237 /* MetaProperty */; } function isSyntheticExpression(node) { - return node.kind === 237 /* SyntheticExpression */; + return node.kind === 238 /* SyntheticExpression */; } function isPartiallyEmittedExpression(node) { - return node.kind === 355 /* PartiallyEmittedExpression */; + return node.kind === 356 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 356 /* CommaListExpression */; + return node.kind === 357 /* CommaListExpression */; } function isTemplateSpan(node) { - return node.kind === 239 /* TemplateSpan */; + return node.kind === 240 /* TemplateSpan */; } function isSemicolonClassElement(node) { - return node.kind === 240 /* SemicolonClassElement */; + return node.kind === 241 /* SemicolonClassElement */; } function isBlock(node) { - return node.kind === 241 /* Block */; + return node.kind === 242 /* Block */; } function isVariableStatement(node) { - return node.kind === 243 /* VariableStatement */; + return node.kind === 244 /* VariableStatement */; } function isEmptyStatement(node) { - return node.kind === 242 /* EmptyStatement */; + return node.kind === 243 /* EmptyStatement */; } function isExpressionStatement(node) { - return node.kind === 244 /* ExpressionStatement */; + return node.kind === 245 /* ExpressionStatement */; } function isIfStatement(node) { - return node.kind === 245 /* IfStatement */; + return node.kind === 246 /* IfStatement */; } function isDoStatement(node) { - return node.kind === 246 /* DoStatement */; + return node.kind === 247 /* DoStatement */; } function isWhileStatement(node) { - return node.kind === 247 /* WhileStatement */; + return node.kind === 248 /* WhileStatement */; } function isForStatement(node) { - return node.kind === 248 /* ForStatement */; + return node.kind === 249 /* ForStatement */; } function isForInStatement(node) { - return node.kind === 249 /* ForInStatement */; + return node.kind === 250 /* ForInStatement */; } function isForOfStatement(node) { - return node.kind === 250 /* ForOfStatement */; + return node.kind === 251 /* ForOfStatement */; } function isContinueStatement(node) { - return node.kind === 251 /* ContinueStatement */; + return node.kind === 252 /* ContinueStatement */; } function isBreakStatement(node) { - return node.kind === 252 /* BreakStatement */; + return node.kind === 253 /* BreakStatement */; } function isReturnStatement(node) { - return node.kind === 253 /* ReturnStatement */; + return node.kind === 254 /* ReturnStatement */; } function isWithStatement(node) { - return node.kind === 254 /* WithStatement */; + return node.kind === 255 /* WithStatement */; } function isSwitchStatement(node) { - return node.kind === 255 /* SwitchStatement */; + return node.kind === 256 /* SwitchStatement */; } function isLabeledStatement(node) { - return node.kind === 256 /* LabeledStatement */; + return node.kind === 257 /* LabeledStatement */; } function isThrowStatement(node) { - return node.kind === 257 /* ThrowStatement */; + return node.kind === 258 /* ThrowStatement */; } function isTryStatement(node) { - return node.kind === 258 /* TryStatement */; + return node.kind === 259 /* TryStatement */; } function isDebuggerStatement(node) { - return node.kind === 259 /* DebuggerStatement */; + return node.kind === 260 /* DebuggerStatement */; } function isVariableDeclaration(node) { - return node.kind === 260 /* VariableDeclaration */; + return node.kind === 261 /* VariableDeclaration */; } function isVariableDeclarationList(node) { - return node.kind === 261 /* VariableDeclarationList */; + return node.kind === 262 /* VariableDeclarationList */; } function isFunctionDeclaration(node) { - return node.kind === 262 /* FunctionDeclaration */; + return node.kind === 263 /* FunctionDeclaration */; } function isClassDeclaration(node) { - return node.kind === 263 /* ClassDeclaration */; + return node.kind === 264 /* ClassDeclaration */; } function isInterfaceDeclaration(node) { - return node.kind === 264 /* InterfaceDeclaration */; + return node.kind === 265 /* InterfaceDeclaration */; } function isTypeAliasDeclaration(node) { - return node.kind === 265 /* TypeAliasDeclaration */; + return node.kind === 266 /* TypeAliasDeclaration */; } function isEnumDeclaration(node) { - return node.kind === 266 /* EnumDeclaration */; + return node.kind === 267 /* EnumDeclaration */; } function isModuleDeclaration(node) { - return node.kind === 267 /* ModuleDeclaration */; + return node.kind === 268 /* ModuleDeclaration */; } function isModuleBlock(node) { - return node.kind === 268 /* ModuleBlock */; + return node.kind === 269 /* ModuleBlock */; } function isCaseBlock(node) { - return node.kind === 269 /* CaseBlock */; + return node.kind === 270 /* CaseBlock */; } function isNamespaceExportDeclaration(node) { - return node.kind === 270 /* NamespaceExportDeclaration */; + return node.kind === 271 /* NamespaceExportDeclaration */; } function isImportEqualsDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */; + return node.kind === 272 /* ImportEqualsDeclaration */; } function isImportDeclaration(node) { - return node.kind === 272 /* ImportDeclaration */; + return node.kind === 273 /* ImportDeclaration */; } function isImportClause(node) { - return node.kind === 273 /* ImportClause */; + return node.kind === 274 /* ImportClause */; } function isImportTypeAssertionContainer(node) { - return node.kind === 302 /* ImportTypeAssertionContainer */; + return node.kind === 303 /* ImportTypeAssertionContainer */; } function isAssertClause(node) { - return node.kind === 300 /* AssertClause */; + return node.kind === 301 /* AssertClause */; } function isAssertEntry(node) { - return node.kind === 301 /* AssertEntry */; + return node.kind === 302 /* AssertEntry */; } function isImportAttributes(node) { - return node.kind === 300 /* ImportAttributes */; + return node.kind === 301 /* ImportAttributes */; } function isImportAttribute(node) { - return node.kind === 301 /* ImportAttribute */; + return node.kind === 302 /* ImportAttribute */; } function isNamespaceImport(node) { - return node.kind === 274 /* NamespaceImport */; + return node.kind === 275 /* NamespaceImport */; } function isNamespaceExport(node) { - return node.kind === 280 /* NamespaceExport */; + return node.kind === 281 /* NamespaceExport */; } function isNamedImports(node) { - return node.kind === 275 /* NamedImports */; + return node.kind === 276 /* NamedImports */; } function isImportSpecifier(node) { - return node.kind === 276 /* ImportSpecifier */; + return node.kind === 277 /* ImportSpecifier */; } function isExportAssignment(node) { - return node.kind === 277 /* ExportAssignment */; + return node.kind === 278 /* ExportAssignment */; } function isExportDeclaration(node) { - return node.kind === 278 /* ExportDeclaration */; + return node.kind === 279 /* ExportDeclaration */; } function isNamedExports(node) { - return node.kind === 279 /* NamedExports */; + return node.kind === 280 /* NamedExports */; } function isExportSpecifier(node) { - return node.kind === 281 /* ExportSpecifier */; + return node.kind === 282 /* ExportSpecifier */; } function isModuleExportName(node) { return node.kind === 80 /* Identifier */ || node.kind === 11 /* StringLiteral */; } function isMissingDeclaration(node) { - return node.kind === 282 /* MissingDeclaration */; + return node.kind === 283 /* MissingDeclaration */; } function isNotEmittedStatement(node) { - return node.kind === 353 /* NotEmittedStatement */; + return node.kind === 354 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 357 /* SyntheticReferenceExpression */; + return node.kind === 358 /* SyntheticReferenceExpression */; } function isExternalModuleReference(node) { - return node.kind === 283 /* ExternalModuleReference */; + return node.kind === 284 /* ExternalModuleReference */; } function isJsxElement(node) { - return node.kind === 284 /* JsxElement */; + return node.kind === 285 /* JsxElement */; } function isJsxSelfClosingElement(node) { - return node.kind === 285 /* JsxSelfClosingElement */; + return node.kind === 286 /* JsxSelfClosingElement */; } function isJsxOpeningElement(node) { - return node.kind === 286 /* JsxOpeningElement */; + return node.kind === 287 /* JsxOpeningElement */; } function isJsxClosingElement(node) { - return node.kind === 287 /* JsxClosingElement */; + return node.kind === 288 /* JsxClosingElement */; } function isJsxFragment(node) { - return node.kind === 288 /* JsxFragment */; + return node.kind === 289 /* JsxFragment */; } function isJsxOpeningFragment(node) { - return node.kind === 289 /* JsxOpeningFragment */; + return node.kind === 290 /* JsxOpeningFragment */; } function isJsxClosingFragment(node) { - return node.kind === 290 /* JsxClosingFragment */; + return node.kind === 291 /* JsxClosingFragment */; } function isJsxAttribute(node) { - return node.kind === 291 /* JsxAttribute */; + return node.kind === 292 /* JsxAttribute */; } function isJsxAttributes(node) { - return node.kind === 292 /* JsxAttributes */; + return node.kind === 293 /* JsxAttributes */; } function isJsxSpreadAttribute(node) { - return node.kind === 293 /* JsxSpreadAttribute */; + return node.kind === 294 /* JsxSpreadAttribute */; } function isJsxExpression(node) { - return node.kind === 294 /* JsxExpression */; + return node.kind === 295 /* JsxExpression */; } function isJsxNamespacedName(node) { - return node.kind === 295 /* JsxNamespacedName */; + return node.kind === 296 /* JsxNamespacedName */; } function isCaseClause(node) { - return node.kind === 296 /* CaseClause */; + return node.kind === 297 /* CaseClause */; } function isDefaultClause(node) { - return node.kind === 297 /* DefaultClause */; + return node.kind === 298 /* DefaultClause */; } function isHeritageClause(node) { - return node.kind === 298 /* HeritageClause */; + return node.kind === 299 /* HeritageClause */; } function isCatchClause(node) { - return node.kind === 299 /* CatchClause */; + return node.kind === 300 /* CatchClause */; } function isPropertyAssignment(node) { - return node.kind === 303 /* PropertyAssignment */; + return node.kind === 304 /* PropertyAssignment */; } function isShorthandPropertyAssignment(node) { - return node.kind === 304 /* ShorthandPropertyAssignment */; + return node.kind === 305 /* ShorthandPropertyAssignment */; } function isSpreadAssignment(node) { - return node.kind === 305 /* SpreadAssignment */; + return node.kind === 306 /* SpreadAssignment */; } function isEnumMember(node) { - return node.kind === 306 /* EnumMember */; + return node.kind === 307 /* EnumMember */; } function isSourceFile(node) { - return node.kind === 307 /* SourceFile */; + return node.kind === 308 /* SourceFile */; } function isBundle(node) { - return node.kind === 308 /* Bundle */; + return node.kind === 309 /* Bundle */; } function isJSDocTypeExpression(node) { - return node.kind === 309 /* JSDocTypeExpression */; + return node.kind === 310 /* JSDocTypeExpression */; } function isJSDocNameReference(node) { - return node.kind === 310 /* JSDocNameReference */; + return node.kind === 311 /* JSDocNameReference */; } function isJSDocMemberName(node) { - return node.kind === 311 /* JSDocMemberName */; + return node.kind === 312 /* JSDocMemberName */; } function isJSDocLink(node) { - return node.kind === 324 /* JSDocLink */; + return node.kind === 325 /* JSDocLink */; } function isJSDocLinkCode(node) { - return node.kind === 325 /* JSDocLinkCode */; + return node.kind === 326 /* JSDocLinkCode */; } function isJSDocLinkPlain(node) { - return node.kind === 326 /* JSDocLinkPlain */; + return node.kind === 327 /* JSDocLinkPlain */; } function isJSDocAllType(node) { - return node.kind === 312 /* JSDocAllType */; + return node.kind === 313 /* JSDocAllType */; } function isJSDocUnknownType(node) { - return node.kind === 313 /* JSDocUnknownType */; + return node.kind === 314 /* JSDocUnknownType */; } function isJSDocNullableType(node) { - return node.kind === 314 /* JSDocNullableType */; + return node.kind === 315 /* JSDocNullableType */; } function isJSDocNonNullableType(node) { - return node.kind === 315 /* JSDocNonNullableType */; + return node.kind === 316 /* JSDocNonNullableType */; } function isJSDocOptionalType(node) { - return node.kind === 316 /* JSDocOptionalType */; + return node.kind === 317 /* JSDocOptionalType */; } function isJSDocFunctionType(node) { - return node.kind === 317 /* JSDocFunctionType */; + return node.kind === 318 /* JSDocFunctionType */; } function isJSDocVariadicType(node) { - return node.kind === 318 /* JSDocVariadicType */; + return node.kind === 319 /* JSDocVariadicType */; } function isJSDocNamepathType(node) { - return node.kind === 319 /* JSDocNamepathType */; + return node.kind === 320 /* JSDocNamepathType */; } function isJSDoc(node) { - return node.kind === 320 /* JSDoc */; + return node.kind === 321 /* JSDoc */; } function isJSDocTypeLiteral(node) { - return node.kind === 322 /* JSDocTypeLiteral */; + return node.kind === 323 /* JSDocTypeLiteral */; } function isJSDocSignature(node) { - return node.kind === 323 /* JSDocSignature */; + return node.kind === 324 /* JSDocSignature */; } function isJSDocAugmentsTag(node) { - return node.kind === 328 /* JSDocAugmentsTag */; + return node.kind === 329 /* JSDocAugmentsTag */; } function isJSDocAuthorTag(node) { - return node.kind === 330 /* JSDocAuthorTag */; + return node.kind === 331 /* JSDocAuthorTag */; } function isJSDocClassTag(node) { - return node.kind === 332 /* JSDocClassTag */; + return node.kind === 333 /* JSDocClassTag */; } function isJSDocCallbackTag(node) { - return node.kind === 338 /* JSDocCallbackTag */; + return node.kind === 339 /* JSDocCallbackTag */; } function isJSDocPublicTag(node) { - return node.kind === 333 /* JSDocPublicTag */; + return node.kind === 334 /* JSDocPublicTag */; } function isJSDocPrivateTag(node) { - return node.kind === 334 /* JSDocPrivateTag */; + return node.kind === 335 /* JSDocPrivateTag */; } function isJSDocProtectedTag(node) { - return node.kind === 335 /* JSDocProtectedTag */; + return node.kind === 336 /* JSDocProtectedTag */; } function isJSDocReadonlyTag(node) { - return node.kind === 336 /* JSDocReadonlyTag */; + return node.kind === 337 /* JSDocReadonlyTag */; } function isJSDocOverrideTag(node) { - return node.kind === 337 /* JSDocOverrideTag */; + return node.kind === 338 /* JSDocOverrideTag */; } function isJSDocOverloadTag(node) { - return node.kind === 339 /* JSDocOverloadTag */; + return node.kind === 340 /* JSDocOverloadTag */; } function isJSDocDeprecatedTag(node) { - return node.kind === 331 /* JSDocDeprecatedTag */; + return node.kind === 332 /* JSDocDeprecatedTag */; } function isJSDocSeeTag(node) { - return node.kind === 347 /* JSDocSeeTag */; + return node.kind === 348 /* JSDocSeeTag */; } function isJSDocEnumTag(node) { - return node.kind === 340 /* JSDocEnumTag */; + return node.kind === 341 /* JSDocEnumTag */; } function isJSDocParameterTag(node) { - return node.kind === 341 /* JSDocParameterTag */; + return node.kind === 342 /* JSDocParameterTag */; } function isJSDocReturnTag(node) { - return node.kind === 342 /* JSDocReturnTag */; + return node.kind === 343 /* JSDocReturnTag */; } function isJSDocThisTag(node) { - return node.kind === 343 /* JSDocThisTag */; + return node.kind === 344 /* JSDocThisTag */; } function isJSDocTypeTag(node) { - return node.kind === 344 /* JSDocTypeTag */; + return node.kind === 345 /* JSDocTypeTag */; } function isJSDocTemplateTag(node) { - return node.kind === 345 /* JSDocTemplateTag */; + return node.kind === 346 /* JSDocTemplateTag */; } function isJSDocTypedefTag(node) { - return node.kind === 346 /* JSDocTypedefTag */; + return node.kind === 347 /* JSDocTypedefTag */; } function isJSDocUnknownTag(node) { - return node.kind === 327 /* JSDocTag */; + return node.kind === 328 /* JSDocTag */; } function isJSDocPropertyTag(node) { - return node.kind === 348 /* JSDocPropertyTag */; + return node.kind === 349 /* JSDocPropertyTag */; } function isJSDocImplementsTag(node) { - return node.kind === 329 /* JSDocImplementsTag */; + return node.kind === 330 /* JSDocImplementsTag */; } function isJSDocSatisfiesTag(node) { - return node.kind === 350 /* JSDocSatisfiesTag */; + return node.kind === 351 /* JSDocSatisfiesTag */; } function isJSDocThrowsTag(node) { - return node.kind === 349 /* JSDocThrowsTag */; + return node.kind === 350 /* JSDocThrowsTag */; } function isJSDocImportTag(node) { - return node.kind === 351 /* JSDocImportTag */; + return node.kind === 352 /* JSDocImportTag */; } function isSyntaxList(n) { - return n.kind === 352 /* SyntaxList */; + return n.kind === 353 /* SyntaxList */; } // src/compiler/factory/nodeChildren.ts @@ -31180,13 +31309,13 @@ function getNodeChildren(node, sourceFile) { if (!isNodeKind(kind)) { return emptyArray; } - if (kind === 352 /* SyntaxList */) { + if (kind === 353 /* SyntaxList */) { return node._children; } return (_a = sourceFileToNodeChildren.get(sourceFile)) == null ? void 0 : _a.get(node); } function setNodeChildren(node, sourceFile, children) { - if (node.kind === 352 /* SyntaxList */) { + if (node.kind === 353 /* SyntaxList */) { Debug.fail("Should not need to re-set the children of a SyntaxList."); } let map2 = sourceFileToNodeChildren.get(sourceFile); @@ -31199,7 +31328,7 @@ function setNodeChildren(node, sourceFile, children) { } function unsetNodeChildren(node, origSourceFile) { var _a; - if (node.kind === 352 /* SyntaxList */) { + if (node.kind === 353 /* SyntaxList */) { Debug.fail("Did not expect to unset the children of a SyntaxList."); } (_a = sourceFileToNodeChildren.get(origSourceFile)) == null ? void 0 : _a.delete(node); @@ -31506,14 +31635,14 @@ function createExpressionForObjectLiteralElementLike(factory2, node, property, r Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory2, property, receiver); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory2, property, receiver); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory2, property, receiver); } } @@ -31566,7 +31695,7 @@ function startsWithUseStrict(statements) { return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } function isCommaExpression(node) { - return node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; + return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; } function isCommaSequence(node) { return isCommaExpression(node) || isCommaListExpression(node); @@ -31581,21 +31710,21 @@ function getJSDocTypeAssertionType(node) { } function isOuterExpression(node, kinds = 63 /* All */) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: if (kinds & -2147483648 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) { return false; } return (kinds & 1 /* Parentheses */) !== 0; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return (kinds & (2 /* TypeAssertions */ | 32 /* Satisfies */)) !== 0; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return (kinds & 16 /* ExpressionsWithTypeArguments */) !== 0; - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -31636,7 +31765,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto const moduleKind = getEmitModuleKind(compilerOptions); const impliedModuleKind = getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions); const helpers = getImportedHelpers(sourceFile); - if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */) { + if (impliedModuleKind !== 1 /* CommonJS */ && (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */)) { if (helpers) { const helperNames = []; for (const helper of helpers) { @@ -31668,8 +31797,8 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto /*modifiers*/ void 0, nodeFactory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, namedBindings @@ -31723,10 +31852,10 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) { } return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name)); } - if (node.kind === 272 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 273 /* ImportDeclaration */ && node.importClause) { return factory2.getGeneratedNameForNode(node); } - if (node.kind === 278 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 279 /* ExportDeclaration */ && node.moduleSpecifier) { return factory2.getGeneratedNameForNode(node); } return void 0; @@ -31789,11 +31918,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) { } if (isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return bindingElement.name; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return void 0; @@ -31812,11 +31941,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) { } function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 169 /* Parameter */: - case 208 /* BindingElement */: + case 170 /* Parameter */: + case 209 /* BindingElement */: return bindingElement.dotDotDotToken; - case 230 /* SpreadElement */: - case 305 /* SpreadAssignment */: + case 231 /* SpreadElement */: + case 306 /* SpreadAssignment */: return bindingElement; } return void 0; @@ -31828,7 +31957,7 @@ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { } function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 208 /* BindingElement */: + case 209 /* BindingElement */: if (bindingElement.propertyName) { const propertyName = bindingElement.propertyName; if (isPrivateIdentifier(propertyName)) { @@ -31837,7 +31966,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; } break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (bindingElement.name) { const propertyName = bindingElement.name; if (isPrivateIdentifier(propertyName)) { @@ -31846,7 +31975,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; } break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) { return Debug.failBadSyntaxKind(bindingElement.name); } @@ -31863,11 +31992,11 @@ function isStringOrNumericLiteral(node) { } function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: - case 209 /* ArrayLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 210 /* ArrayLiteralExpression */: return name.elements; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return name.properties; } } @@ -31884,19 +32013,19 @@ function getJSDocTypeAliasName(fullName) { } function canHaveIllegalType(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */; + return kind === 177 /* Constructor */ || kind === 179 /* SetAccessor */; } function canHaveIllegalTypeParameters(node) { const kind = node.kind; - return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 177 /* Constructor */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function canHaveIllegalDecorators(node) { const kind = node.kind; - return kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 262 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 243 /* VariableStatement */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */; + return kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 177 /* Constructor */ || kind === 182 /* IndexSignature */ || kind === 176 /* ClassStaticBlockDeclaration */ || kind === 283 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 278 /* ExportAssignment */; } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 282 /* MissingDeclaration */ || kind === 270 /* NamespaceExportDeclaration */; + return kind === 176 /* ClassStaticBlockDeclaration */ || kind === 304 /* PropertyAssignment */ || kind === 305 /* ShorthandPropertyAssignment */ || kind === 283 /* MissingDeclaration */ || kind === 271 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -32283,11 +32412,11 @@ function setTextRange(range, location) { } function canHaveModifiers(node) { const kind = node.kind; - return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 231 /* ClassExpression */ || kind === 243 /* VariableStatement */ || kind === 262 /* FunctionDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 278 /* ExportDeclaration */; + return kind === 169 /* TypeParameter */ || kind === 170 /* Parameter */ || kind === 172 /* PropertySignature */ || kind === 173 /* PropertyDeclaration */ || kind === 174 /* MethodSignature */ || kind === 175 /* MethodDeclaration */ || kind === 177 /* Constructor */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 182 /* IndexSignature */ || kind === 186 /* ConstructorType */ || kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* InterfaceDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 267 /* EnumDeclaration */ || kind === 268 /* ModuleDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 278 /* ExportAssignment */ || kind === 279 /* ExportDeclaration */; } function canHaveDecorators(node) { const kind = node.kind; - return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 231 /* ClassExpression */ || kind === 263 /* ClassDeclaration */; + return kind === 170 /* Parameter */ || kind === 173 /* PropertyDeclaration */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */; } // src/compiler/parser.ts @@ -32342,429 +32471,429 @@ function isImportMeta2(node) { return isMetaProperty(node) && node.keywordToken === 102 /* ImportKeyword */ && node.name.escapedText === "meta"; } var forEachChildTable = { - [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { + [167 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); }, - [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { + [169 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, - [304 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { + [305 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, - [305 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { + [306 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { + [170 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { + [173 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { + [172 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [303 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { + [304 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, - [260 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { + [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { + [209 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { + [182 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { + [186 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { + [185 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [179 /* CallSignature */]: forEachChildInCallOrConstructSignature, - [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, - [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { + [180 /* CallSignature */]: forEachChildInCallOrConstructSignature, + [181 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, + [175 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { + [174 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { + [177 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { + [178 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { + [179 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [262 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { + [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { + [219 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { + [220 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, - [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { + [176 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, - [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { + [184 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { + [183 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type); }, - [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { + [187 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { + [188 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.members); }, - [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { + [189 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.elementType); }, - [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { + [190 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [192 /* UnionType */]: forEachChildInUnionOrIntersectionType, - [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, - [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { + [193 /* UnionType */]: forEachChildInUnionOrIntersectionType, + [194 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, + [195 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType); }, - [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { + [196 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.typeParameter); }, - [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { + [206 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { + [303 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.assertClause); }, - [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, - [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, - [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { + [197 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, + [199 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, + [200 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType); }, - [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { + [201 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members); }, - [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { + [202 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.literal); }, - [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { + [203 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type); }, - [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { + [207 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, + [208 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, + [210 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { + [211 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.properties); }, - [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { + [212 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name); }, - [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { + [213 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression); }, - [213 /* CallExpression */]: forEachChildInCallOrNewExpression, - [214 /* NewExpression */]: forEachChildInCallOrNewExpression, - [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { + [214 /* CallExpression */]: forEachChildInCallOrNewExpression, + [215 /* NewExpression */]: forEachChildInCallOrNewExpression, + [216 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template); }, - [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { + [217 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression); }, - [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { + [218 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [220 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { + [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [221 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { + [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [222 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { + [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [224 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { + [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.operand); }, - [229 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { + [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression); }, - [223 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { + [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [225 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { + [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.operand); }, - [226 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { + [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right); }, - [234 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { + [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); }, - [235 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { + [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [238 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { + [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); }, - [236 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { + [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [227 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { + [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse); }, - [230 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { + [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [241 /* Block */]: forEachChildInBlock, - [268 /* ModuleBlock */]: forEachChildInBlock, - [307 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { + [242 /* Block */]: forEachChildInBlock, + [269 /* ModuleBlock */]: forEachChildInBlock, + [308 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, - [243 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { + [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, - [261 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { + [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); }, - [244 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { + [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [245 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { + [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement); }, - [246 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { + [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression); }, - [247 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { + [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [248 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { + [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement); }, - [249 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { + [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [250 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { + [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [251 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, - [252 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, - [253 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { + [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, + [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, + [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [254 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { + [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [255 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { + [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock); }, - [269 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { + [270 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.clauses); }, - [296 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { + [297 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); }, - [297 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { + [298 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.statements); }, - [256 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { + [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement); }, - [257 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { + [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [258 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { + [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock); }, - [299 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { + [300 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block); }, - [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { + [171 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [263 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, - [231 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, - [264 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { + [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, + [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, + [265 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, - [265 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { + [266 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, - [266 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { + [267 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, - [306 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { + [307 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [267 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { + [268 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, - [271 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { + [272 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, - [272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { + [273 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); }, - [273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { + [274 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); }, - [300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { + [301 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { + [302 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, - [270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { + [271 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, - [274 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { + [275 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [280 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { + [281 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [275 /* NamedImports */]: forEachChildInNamedImportsOrExports, - [279 /* NamedExports */]: forEachChildInNamedImportsOrExports, - [278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { + [276 /* NamedImports */]: forEachChildInNamedImportsOrExports, + [280 /* NamedExports */]: forEachChildInNamedImportsOrExports, + [279 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); }, - [276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, - [281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, - [277 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { + [277 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, + [282 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, + [278 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, - [228 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { + [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); }, - [239 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { + [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal); }, - [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { + [204 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); }, - [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { + [205 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal); }, - [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { + [168 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [298 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { + [299 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.types); }, - [233 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { + [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [283 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { + [284 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { + [283 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers); }, - [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { + [285 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement); }, - [288 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { + [289 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment); }, - [285 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [286 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [292 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { + [286 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, + [287 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, + [293 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.properties); }, - [291 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { + [292 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [293 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { + [294 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [294 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { + [295 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression); }, - [287 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { + [288 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.tagName); }, - [295 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { + [296 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.namespace) || visitNode2(cbNode, node.name); }, - [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [309 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [315 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [314 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [316 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [318 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [317 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { + [191 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [192 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [310 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [316 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [315 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [317 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [319 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [318 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [320 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { + [321 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); }, - [347 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { + [348 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [310 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { + [311 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [311 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { + [312 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); }, - [341 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, - [348 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, - [330 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { + [342 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, + [349 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, + [331 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [329 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { + [330 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [328 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { + [329 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [345 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { + [346 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [346 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 309 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); + [347 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 310 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); }, - [338 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { + [339 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [342 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, - [344 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, - [343 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, - [340 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, - [350 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, - [349 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, - [339 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, - [323 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { + [343 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, + [345 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, + [344 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, + [341 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [351 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, + [350 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, + [340 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, + [324 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type); }, - [324 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, - [325 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, - [326 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, - [322 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { + [325 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, + [326 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, + [327 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, + [323 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { return forEach(node.jsDocPropertyTags, cbNode); }, - [327 /* JSDocTag */]: forEachChildInJSDocTag, - [332 /* JSDocClassTag */]: forEachChildInJSDocTag, - [333 /* JSDocPublicTag */]: forEachChildInJSDocTag, - [334 /* JSDocPrivateTag */]: forEachChildInJSDocTag, - [335 /* JSDocProtectedTag */]: forEachChildInJSDocTag, - [336 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, - [331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, - [337 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [351 /* JSDocImportTag */]: forEachChildInJSDocImportTag, - [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [328 /* JSDocTag */]: forEachChildInJSDocTag, + [333 /* JSDocClassTag */]: forEachChildInJSDocTag, + [334 /* JSDocPublicTag */]: forEachChildInJSDocTag, + [335 /* JSDocPrivateTag */]: forEachChildInJSDocTag, + [336 /* JSDocProtectedTag */]: forEachChildInJSDocTag, + [337 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, + [332 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, + [338 /* JSDocOverrideTag */]: forEachChildInJSDocTag, + [352 /* JSDocImportTag */]: forEachChildInJSDocImportTag, + [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); @@ -32822,7 +32951,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); } function forEachChild(node, cbNode, cbNodes) { - if (node === void 0 || node.kind <= 165 /* LastToken */) { + if (node === void 0 || node.kind <= 166 /* LastToken */) { return; } const fn = forEachChildTable[node.kind]; @@ -32855,7 +32984,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) { if (res === "skip") continue; return res; } - if (current.kind >= 166 /* FirstNode */) { + if (current.kind >= 167 /* FirstNode */) { for (const child of gatherPossibleChildren(current)) { queue.push(child); parents.push(current); @@ -33851,7 +33980,7 @@ var Parser; "", /*isSingleQuote*/ void 0 - ) : kind === 282 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); + ) : kind === 283 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -34301,14 +34430,14 @@ var Parser; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 176 /* Constructor */: - case 181 /* IndexSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 172 /* PropertyDeclaration */: - case 240 /* SemicolonClassElement */: + case 177 /* Constructor */: + case 182 /* IndexSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 241 /* SemicolonClassElement */: return true; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: const methodDeclaration = node; const nameIsConstructor = methodDeclaration.name.kind === 80 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; @@ -34319,8 +34448,8 @@ var Parser; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return true; } } @@ -34329,65 +34458,65 @@ var Parser; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 243 /* VariableStatement */: - case 241 /* Block */: - case 245 /* IfStatement */: - case 244 /* ExpressionStatement */: - case 257 /* ThrowStatement */: - case 253 /* ReturnStatement */: - case 255 /* SwitchStatement */: - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: - case 242 /* EmptyStatement */: - case 258 /* TryStatement */: - case 256 /* LabeledStatement */: - case 246 /* DoStatement */: - case 259 /* DebuggerStatement */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 263 /* FunctionDeclaration */: + case 244 /* VariableStatement */: + case 242 /* Block */: + case 246 /* IfStatement */: + case 245 /* ExpressionStatement */: + case 258 /* ThrowStatement */: + case 254 /* ReturnStatement */: + case 256 /* SwitchStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: + case 243 /* EmptyStatement */: + case 259 /* TryStatement */: + case 257 /* LabeledStatement */: + case 247 /* DoStatement */: + case 260 /* DebuggerStatement */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 306 /* EnumMember */; + return node.kind === 307 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 181 /* IndexSignature */: - case 171 /* PropertySignature */: - case 179 /* CallSignature */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 182 /* IndexSignature */: + case 172 /* PropertySignature */: + case 180 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 260 /* VariableDeclaration */) { + if (node.kind !== 261 /* VariableDeclaration */) { return false; } const variableDeclarator = node; return variableDeclarator.initializer === void 0; } function isReusableParameter(node) { - if (node.kind !== 169 /* Parameter */) { + if (node.kind !== 170 /* Parameter */) { return false; } const parameter = node; @@ -34734,14 +34863,14 @@ var Parser; } function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return nodeIsMissing(node.typeName); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: { + case 185 /* FunctionType */: + case 186 /* ConstructorType */: { const { parameters, type } = node; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -35032,7 +35161,7 @@ var Parser; function parseSignatureMember(kind) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 180 /* ConstructSignature */) { + if (kind === 181 /* ConstructSignature */) { parseExpected(105 /* NewKeyword */); } const typeParameters = parseTypeParameters(); @@ -35043,7 +35172,7 @@ var Parser; true ); parseTypeMemberSemicolon(); - const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); + const node = kind === 180 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); } function isIndexSignature() { @@ -35127,10 +35256,10 @@ var Parser; } function parseTypeMember() { if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - return parseSignatureMember(179 /* CallSignature */); + return parseSignatureMember(180 /* CallSignature */); } if (token() === 105 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(180 /* ConstructSignature */); + return parseSignatureMember(181 /* ConstructSignature */); } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); @@ -35139,10 +35268,10 @@ var Parser; false ); if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 4 /* Type */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 4 /* Type */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); @@ -35351,6 +35480,7 @@ var Parser; /*skipKeyword*/ true ); + parseOptional(28 /* CommaToken */); if (!parseExpected(20 /* CloseBraceToken */)) { const lastError = lastOrUndefined(parseDiagnostics); if (lastError && lastError.code === Diagnostics._0_expected.code) { @@ -36083,7 +36213,7 @@ var Parser; return void 0; } let unwrappedType = type; - while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) { + while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 197 /* ParenthesizedType */) { unwrappedType = unwrappedType.type; } const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType); @@ -36108,10 +36238,13 @@ var Parser; if (token() !== 27 /* SemicolonToken */ && token() !== 100 /* FunctionKeyword */ && token() !== 86 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) { return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */)); } + const savedYieldContext = inYieldContext(); + setYieldContext(false); const savedTopLevel = topLevel; topLevel = false; const node = isAsync ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)); topLevel = savedTopLevel; + setYieldContext(savedYieldContext); return node; } function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) { @@ -36228,7 +36361,7 @@ var Parser; if (token() === 43 /* AsteriskAsteriskToken */) { const pos = skipTrivia(sourceText, simpleUnaryExpression.pos); const { end } = simpleUnaryExpression; - if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 217 /* TypeAssertionExpression */) { parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { Debug.assert(isKeywordOrPunctuation(unaryOperator)); @@ -36324,7 +36457,13 @@ var Parser; nextToken(); nextToken(); expression = finishNode(factory2.createMetaProperty(102 /* ImportKeyword */, parseIdentifierName()), pos); - sourceFlags |= 8388608 /* PossiblyContainsImportMeta */; + if (expression.name.escapedText === "defer") { + if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { + sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; + } + } else { + sourceFlags |= 8388608 /* PossiblyContainsImportMeta */; + } } else { expression = parseMemberExpressionOrHigher(); } @@ -36373,11 +36512,11 @@ var Parser; const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; - if (opening.kind === 286 /* JsxOpeningElement */) { + if (opening.kind === 287 /* JsxOpeningElement */) { let children = parseJsxChildren(opening); let closingElement; const lastChild = children[children.length - 1]; - if ((lastChild == null ? void 0 : lastChild.kind) === 284 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { + if ((lastChild == null ? void 0 : lastChild.kind) === 285 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { const end = lastChild.children.end; const newLast = finishNode( factory2.createJsxElement( @@ -36401,10 +36540,10 @@ var Parser; } } result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos); - } else if (opening.kind === 289 /* JsxOpeningFragment */) { + } else if (opening.kind === 290 /* JsxOpeningFragment */) { result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - Debug.assert(opening.kind === 285 /* JsxSelfClosingElement */); + Debug.assert(opening.kind === 286 /* JsxSelfClosingElement */); result = opening; } if (!mustBeUnary && inExpressionContext && token() === 30 /* LessThanToken */) { @@ -36476,7 +36615,7 @@ var Parser; const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); if (!child) break; list.push(child); - if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 284 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { + if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 285 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { break; } } @@ -36755,7 +36894,7 @@ var Parser; continue; } if (isTemplateStartOfTaggedTemplate()) { - expression = !questionDotToken && expression.kind === 233 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( + expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( pos, expression, questionDotToken, @@ -36818,7 +36957,7 @@ var Parser; } } if (typeArguments || token() === 21 /* OpenParenToken */) { - if (!questionDotToken && expression.kind === 233 /* ExpressionWithTypeArguments */) { + if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) { typeArguments = expression.typeArguments; expression = expression.expression; } @@ -36986,10 +37125,10 @@ var Parser; true ); if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -37083,7 +37222,7 @@ var Parser; false ); let typeArguments; - if (expression.kind === 233 /* ExpressionWithTypeArguments */) { + if (expression.kind === 234 /* ExpressionWithTypeArguments */) { typeArguments = expression.typeArguments; expression = expression.expression; } @@ -37228,10 +37367,10 @@ var Parser; function parseBreakOrContinueStatement(kind) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(kind === 252 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); + parseExpected(kind === 253 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); const label = canParseSemicolon() ? void 0 : parseIdentifier(); parseSemicolon(); - const node = kind === 252 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); + const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseReturnStatement() { @@ -37417,6 +37556,7 @@ var Parser; // could be legal, it would add complexity for very little gain. case 120 /* InterfaceKeyword */: case 156 /* TypeKeyword */: + case 166 /* DeferKeyword */: return nextTokenIsIdentifierOnSameLine(); case 144 /* ModuleKeyword */: case 145 /* NamespaceKeyword */: @@ -37443,7 +37583,7 @@ var Parser; return token() === 19 /* OpenBraceToken */ || token() === 80 /* Identifier */ || token() === 95 /* ExportKeyword */; case 102 /* ImportKeyword */: nextToken(); - return token() === 11 /* StringLiteral */ || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */ || tokenIsIdentifierOrKeyword(token()); + return token() === 166 /* DeferKeyword */ || token() === 11 /* StringLiteral */ || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */ || tokenIsIdentifierOrKeyword(token()); case 95 /* ExportKeyword */: let currentToken2 = nextToken(); if (currentToken2 === 156 /* TypeKeyword */) { @@ -37505,6 +37645,7 @@ var Parser; case 145 /* NamespaceKeyword */: case 156 /* TypeKeyword */: case 162 /* GlobalKeyword */: + case 166 /* DeferKeyword */: return true; case 129 /* AccessorKeyword */: case 125 /* PublicKeyword */: @@ -37530,9 +37671,15 @@ var Parser; true ); } + function nextTokenIsEqualsOrSemicolonOrColonToken() { + nextToken(); + return token() === 64 /* EqualsToken */ || token() === 27 /* SemicolonToken */ || token() === 59 /* ColonToken */; + } function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf) { nextToken(); - if (disallowOf && token() === 165 /* OfKeyword */) return false; + if (disallowOf && token() === 165 /* OfKeyword */) { + return lookAhead(nextTokenIsEqualsOrSemicolonOrColonToken); + } return (isBindingIdentifier() || token() === 19 /* OpenBraceToken */) && !scanner2.hasPrecedingLineBreak(); } function isUsingDeclaration() { @@ -37616,9 +37763,9 @@ var Parser; case 99 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 88 /* ContinueKeyword */: - return parseBreakOrContinueStatement(251 /* ContinueStatement */); + return parseBreakOrContinueStatement(252 /* ContinueStatement */); case 83 /* BreakKeyword */: - return parseBreakOrContinueStatement(252 /* BreakStatement */); + return parseBreakOrContinueStatement(253 /* BreakStatement */); case 107 /* ReturnKeyword */: return parseReturnStatement(); case 118 /* WithKeyword */: @@ -37732,7 +37879,7 @@ var Parser; default: if (modifiersIn) { const missing = createMissingNode( - 282 /* MissingDeclaration */, + 283 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected @@ -38015,7 +38162,7 @@ var Parser; false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); + const node = kind === 178 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -38183,10 +38330,10 @@ var Parser; return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 179 /* SetAccessor */, 0 /* None */); } if (token() === 137 /* ConstructorKeyword */ || token() === 11 /* StringLiteral */) { const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); @@ -38234,10 +38381,10 @@ var Parser; true ); if (token() === 86 /* ClassKeyword */) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 231 /* ClassExpression */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 232 /* ClassExpression */); } const missing = createMissingNode( - 282 /* MissingDeclaration */, + 283 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, Diagnostics.Expression_expected @@ -38252,11 +38399,11 @@ var Parser; hasPrecedingJSDocComment(), /*modifiers*/ void 0, - 231 /* ClassExpression */ + 232 /* ClassExpression */ ); } function parseClassDeclaration(pos, hasJSDoc, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 263 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 264 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); @@ -38276,7 +38423,7 @@ var Parser; members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 263 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); + const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { @@ -38302,7 +38449,7 @@ var Parser; function parseExpressionWithTypeArguments() { const pos = getNodePos(); const expression = parseLeftHandSideExpressionOrHigher(); - if (expression.kind === 233 /* ExpressionWithTypeArguments */) { + if (expression.kind === 234 /* ExpressionWithTypeArguments */) { return expression; } const typeArguments = tryParseTypeArguments(); @@ -38445,27 +38592,36 @@ var Parser; if (isIdentifier2()) { identifier = parseIdentifier(); } - let isTypeOnly = false; + let phaseModifier; if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) { - isTypeOnly = true; + phaseModifier = 156 /* TypeKeyword */; + identifier = isIdentifier2() ? parseIdentifier() : void 0; + } else if ((identifier == null ? void 0 : identifier.escapedText) === "defer" && (token() === 161 /* FromKeyword */ ? !lookAhead(nextTokenIsStringLiteral) : token() !== 28 /* CommaToken */ && token() !== 64 /* EqualsToken */)) { + phaseModifier = 166 /* DeferKeyword */; identifier = isIdentifier2() ? parseIdentifier() : void 0; } - if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { - return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); + if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() && phaseModifier !== 166 /* DeferKeyword */) { + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, phaseModifier === 156 /* TypeKeyword */); } - const importClause = tryParseImportClause(identifier, afterImportPos, isTypeOnly); + const importClause = tryParseImportClause( + identifier, + afterImportPos, + phaseModifier, + /*skipJsDocLeadingAsterisks*/ + void 0 + ); const moduleSpecifier = parseModuleSpecifier(); const attributes = tryParseImportAttributes(); parseSemicolon(); const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function tryParseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks = false) { + function tryParseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks = false) { let importClause; if (identifier || // import id token() === 42 /* AsteriskToken */ || // import * token() === 19 /* OpenBraceToken */) { - importClause = parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks); + importClause = parseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks); parseExpected(161 /* FromKeyword */); } return importClause; @@ -38541,14 +38697,18 @@ var Parser; const finished = withJSDoc(finishNode(node, pos), hasJSDoc); return finished; } - function parseImportClause(identifier, pos, isTypeOnly, skipJsDocLeadingAsterisks) { + function parseImportClause(identifier, pos, phaseModifier, skipJsDocLeadingAsterisks) { let namedBindings; if (!identifier || parseOptional(28 /* CommaToken */)) { if (skipJsDocLeadingAsterisks) scanner2.setSkipJsDocLeadingAsterisks(true); - namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(275 /* NamedImports */); + if (token() === 42 /* AsteriskToken */) { + namedBindings = parseNamespaceImport(); + } else { + namedBindings = parseNamedImportsOrExports(276 /* NamedImports */); + } if (skipJsDocLeadingAsterisks) scanner2.setSkipJsDocLeadingAsterisks(false); } - return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos); + return finishNode(factory2.createImportClause(phaseModifier, identifier, namedBindings), pos); } function parseModuleReference() { return isExternalModuleReference2() ? parseExternalModuleReference() : parseEntityName( @@ -38588,15 +38748,15 @@ var Parser; } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 275 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)); + const node = kind === 276 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { const hasJSDoc = hasPrecedingJSDocComment(); - return withJSDoc(parseImportOrExportSpecifier(281 /* ExportSpecifier */), hasJSDoc); + return withJSDoc(parseImportOrExportSpecifier(282 /* ExportSpecifier */), hasJSDoc); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(276 /* ImportSpecifier */); + return parseImportOrExportSpecifier(277 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { const pos = getNodePos(); @@ -38640,7 +38800,7 @@ var Parser; parseExpected(130 /* AsKeyword */); name = parseModuleExportName(parseNameWithKeywordCheck); } - if (kind === 276 /* ImportSpecifier */) { + if (kind === 277 /* ImportSpecifier */) { if (name.kind !== 80 /* Identifier */) { parseErrorAt(skipTrivia(sourceText, name.pos), name.end, Diagnostics.Identifier_expected); name = setTextRangePosEnd(createMissingNode( @@ -38652,7 +38812,7 @@ var Parser; parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected); } } - const node = kind === 276 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); + const node = kind === 277 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); return finishNode(node, pos); function parseNameWithKeywordCheck() { checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); @@ -38682,7 +38842,7 @@ var Parser; parseExpected(161 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(279 /* NamedExports */); + exportClause = parseNamedImportsOrExports(280 /* NamedExports */); if (token() === 161 /* FromKeyword */ || token() === 11 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) { parseExpected(161 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); @@ -39336,7 +39496,7 @@ var Parser; switch (node.kind) { case 151 /* ObjectKeyword */: return true; - case 188 /* ArrayType */: + case 189 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -39366,14 +39526,14 @@ var Parser; let child; let children; while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) { - if (child.kind === 341 /* JSDocParameterTag */ || child.kind === 348 /* JSDocPropertyTag */) { + if (child.kind === 342 /* JSDocParameterTag */ || child.kind === 349 /* JSDocPropertyTag */) { children = append(children, child); - } else if (child.kind === 345 /* JSDocTemplateTag */) { + } else if (child.kind === 346 /* JSDocTemplateTag */) { parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); } } if (children) { - const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos); + const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 189 /* ArrayType */), pos); return finishNode(factory2.createJSDocTypeExpression(literal), pos); } } @@ -39462,8 +39622,7 @@ var Parser; const importClause = tryParseImportClause( identifier, afterImportTagPos, - /*isTypeOnly*/ - true, + 156 /* TypeKeyword */, /*skipJsDocLeadingAsterisks*/ true ); @@ -39528,11 +39687,11 @@ var Parser; let jsDocPropertyTags; let hasChildren = false; while (child = tryParse(() => parseChildPropertyTag(indent3))) { - if (child.kind === 345 /* JSDocTemplateTag */) { + if (child.kind === 346 /* JSDocTemplateTag */) { break; } hasChildren = true; - if (child.kind === 344 /* JSDocTypeTag */) { + if (child.kind === 345 /* JSDocTypeTag */) { if (childTypeTag) { const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); if (lastError) { @@ -39547,7 +39706,7 @@ var Parser; } } if (hasChildren) { - const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */; + const isArrayType = typeExpression && typeExpression.type.kind === 189 /* ArrayType */; const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); end2 = typeExpression.end; @@ -39590,7 +39749,7 @@ var Parser; let child; let parameters; while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) { - if (child.kind === 345 /* JSDocTemplateTag */) { + if (child.kind === 346 /* JSDocTemplateTag */) { parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); break; } @@ -39603,7 +39762,7 @@ var Parser; const returnTag = tryParse(() => { if (parseOptionalJsdoc(60 /* AtToken */)) { const tag = parseTag(indent3); - if (tag && tag.kind === 342 /* JSDocReturnTag */) { + if (tag && tag.kind === 343 /* JSDocReturnTag */) { return tag; } } @@ -39658,7 +39817,7 @@ var Parser; case 60 /* AtToken */: if (canParseTag) { const child = tryParseChildTag(target, indent3); - if (child && (child.kind === 341 /* JSDocParameterTag */ || child.kind === 348 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { + if (child && (child.kind === 342 /* JSDocParameterTag */ || child.kind === 349 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } return child; @@ -40410,7 +40569,7 @@ function tagNamesAreEquivalent(lhs, rhs) { if (lhs.kind === 110 /* ThisKeyword */) { return true; } - if (lhs.kind === 295 /* JsxNamespacedName */) { + if (lhs.kind === 296 /* JsxNamespacedName */) { return lhs.namespace.escapedText === rhs.namespace.escapedText && lhs.name.escapedText === rhs.name.escapedText; } return lhs.name.escapedText === rhs.name.escapedText && tagNamesAreEquivalent(lhs.expression, rhs.expression); @@ -40425,9 +40584,9 @@ var compileOnSaveCommandLineOption = { var jsxOptionMap = new Map(Object.entries({ "preserve": 1 /* Preserve */, "react-native": 3 /* ReactNative */, - "react": 2 /* React */, "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */ + "react-jsxdev": 5 /* ReactJSXDev */, + "react": 2 /* React */ })); var inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key])); var libEntries = [ @@ -40530,6 +40689,8 @@ var libEntries = [ ["esnext.iterator", "lib.esnext.iterator.d.ts"], ["esnext.promise", "lib.esnext.promise.d.ts"], ["esnext.float16", "lib.esnext.float16.d.ts"], + ["esnext.error", "lib.esnext.error.d.ts"], + ["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"], ["decorators", "lib.decorators.d.ts"], ["decorators.legacy", "lib.decorators.legacy.d.ts"] ]; @@ -40857,6 +41018,7 @@ var moduleOptionDeclaration = { esnext: 99 /* ESNext */, node16: 100 /* Node16 */, node18: 101 /* Node18 */, + node20: 102 /* Node20 */, nodenext: 199 /* NodeNext */, preserve: 200 /* Preserve */ })), @@ -40948,7 +41110,7 @@ var commandOptionsWithoutBuild = [ affectsBuildInfo: true, showInSimplifiedHelpView: true, category: Diagnostics.JavaScript_Support, - description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, + description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files, defaultValueDescription: false }, { @@ -42459,7 +42621,7 @@ function getTsconfigRootOptionsMap() { function convertConfigFileToObject(sourceFile, errors, jsonConversionNotifier) { var _a; const rootExpression = (_a = sourceFile.statements[0]) == null ? void 0 : _a.expression; - if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) { + if (rootExpression && rootExpression.kind !== 211 /* ObjectLiteralExpression */) { errors.push(createDiagnosticForNodeInSourceFile( sourceFile, rootExpression, @@ -42511,7 +42673,7 @@ function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConv var _a; const result = returnValue ? {} : void 0; for (const element of node.properties) { - if (element.kind !== 303 /* PropertyAssignment */) { + if (element.kind !== 304 /* PropertyAssignment */) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected)); continue; } @@ -42557,15 +42719,15 @@ function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConv return valueExpression.text; case 9 /* NumericLiteral */: return Number(valueExpression.text); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: if (valueExpression.operator !== 41 /* MinusToken */ || valueExpression.operand.kind !== 9 /* NumericLiteral */) { break; } return -Number(valueExpression.operand.text); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: const objectLiteralExpression = valueExpression; return convertObjectLiteralExpressionToJson(objectLiteralExpression, option); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return convertArrayLiteralExpressionToJson( valueExpression.elements, option && option.element @@ -42750,106 +42912,178 @@ function serializeOptionBaseObject(options, { optionsNameMap }, pathOptions) { } return result; } -function getCompilerOptionsDiffValue(options, newLine) { - const compilerOptionsMap = getSerializedCompilerOption(options); - return getOverwrittenDefaultOptions(); - function makePadding(paddingLength) { - return Array(paddingLength + 1).join(" "); +function generateTSConfig(options, newLine) { + const tab = " "; + const result = []; + const allSetOptions = Object.keys(options).filter((k) => k !== "init" && k !== "help" && k !== "watch"); + result.push(`{`); + result.push(`${tab}// ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)}`); + result.push(`${tab}"compilerOptions": {`); + emitHeader(Diagnostics.File_Layout); + emitOption("rootDir", "./src", "optional"); + emitOption("outDir", "./dist", "optional"); + newline(); + emitHeader(Diagnostics.Environment_Settings); + emitHeader(Diagnostics.See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule); + emitOption("module", 199 /* NodeNext */); + emitOption("target", 99 /* ESNext */); + emitOption("types", []); + if (options.lib) { + emitOption("lib", options.lib); + } + emitHeader(Diagnostics.For_nodejs_Colon); + result.push(`${tab}${tab}// "lib": ["esnext"],`); + result.push(`${tab}${tab}// "types": ["node"],`); + emitHeader(Diagnostics.and_npm_install_D_types_Slashnode); + newline(); + emitHeader(Diagnostics.Other_Outputs); + emitOption( + "sourceMap", + /*defaultValue*/ + true + ); + emitOption( + "declaration", + /*defaultValue*/ + true + ); + emitOption( + "declarationMap", + /*defaultValue*/ + true + ); + newline(); + emitHeader(Diagnostics.Stricter_Typechecking_Options); + emitOption( + "noUncheckedIndexedAccess", + /*defaultValue*/ + true + ); + emitOption( + "exactOptionalPropertyTypes", + /*defaultValue*/ + true + ); + newline(); + emitHeader(Diagnostics.Style_Options); + emitOption( + "noImplicitReturns", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noImplicitOverride", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noUnusedLocals", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noUnusedParameters", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noFallthroughCasesInSwitch", + /*defaultValue*/ + true, + "optional" + ); + emitOption( + "noPropertyAccessFromIndexSignature", + /*defaultValue*/ + true, + "optional" + ); + newline(); + emitHeader(Diagnostics.Recommended_Options); + emitOption( + "strict", + /*defaultValue*/ + true + ); + emitOption("jsx", 4 /* ReactJSX */); + emitOption( + "verbatimModuleSyntax", + /*defaultValue*/ + true + ); + emitOption( + "isolatedModules", + /*defaultValue*/ + true + ); + emitOption( + "noUncheckedSideEffectImports", + /*defaultValue*/ + true + ); + emitOption("moduleDetection", 3 /* Force */); + emitOption( + "skipLibCheck", + /*defaultValue*/ + true + ); + if (allSetOptions.length > 0) { + newline(); + while (allSetOptions.length > 0) { + emitOption(allSetOptions[0], options[allSetOptions[0]]); + } } - function getOverwrittenDefaultOptions() { - const result = []; - const tab = makePadding(2); - commandOptionsWithoutBuild.forEach((cmd) => { - if (!compilerOptionsMap.has(cmd.name)) { - return; - } - const newValue = compilerOptionsMap.get(cmd.name); - const defaultValue = getDefaultValueForOption(cmd); - if (newValue !== defaultValue) { - result.push(`${tab}${cmd.name}: ${newValue}`); - } else if (hasProperty(defaultInitCompilerOptions, cmd.name)) { - result.push(`${tab}${cmd.name}: ${defaultValue}`); - } - }); - return result.join(newLine) + newLine; - } -} -function getSerializedCompilerOption(options) { - const compilerOptions = extend(options, defaultInitCompilerOptions); - return serializeCompilerOptions(compilerOptions); -} -function generateTSConfig(options, fileNames, newLine) { - const compilerOptionsMap = getSerializedCompilerOption(options); - return writeConfigurations(); - function makePadding(paddingLength) { - return Array(paddingLength + 1).join(" "); - } - function isAllowedOptionForOutput({ category, name, isCommandLineOnly }) { - const categoriesToSkip = [Diagnostics.Command_line_Options, Diagnostics.Editor_Support, Diagnostics.Compiler_Diagnostics, Diagnostics.Backwards_Compatibility, Diagnostics.Watch_and_Build_Modes, Diagnostics.Output_Formatting]; - return !isCommandLineOnly && category !== void 0 && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name)); - } - function writeConfigurations() { - const categorizedOptions = /* @__PURE__ */ new Map(); - categorizedOptions.set(Diagnostics.Projects, []); - categorizedOptions.set(Diagnostics.Language_and_Environment, []); - categorizedOptions.set(Diagnostics.Modules, []); - categorizedOptions.set(Diagnostics.JavaScript_Support, []); - categorizedOptions.set(Diagnostics.Emit, []); - categorizedOptions.set(Diagnostics.Interop_Constraints, []); - categorizedOptions.set(Diagnostics.Type_Checking, []); - categorizedOptions.set(Diagnostics.Completeness, []); - for (const option of optionDeclarations) { - if (isAllowedOptionForOutput(option)) { - let listForCategory = categorizedOptions.get(option.category); - if (!listForCategory) categorizedOptions.set(option.category, listForCategory = []); - listForCategory.push(option); - } - } - let marginLength = 0; - let seenKnownKeys = 0; - const entries = []; - categorizedOptions.forEach((options2, category) => { - if (entries.length !== 0) { - entries.push({ value: "" }); - } - entries.push({ value: `/* ${getLocaleSpecificMessage(category)} */` }); - for (const option of options2) { - let optionName; - if (compilerOptionsMap.has(option.name)) { - optionName = `"${option.name}": ${JSON.stringify(compilerOptionsMap.get(option.name))}${(seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ","}`; - } else { - optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`; - } - entries.push({ - value: optionName, - description: `/* ${option.description && getLocaleSpecificMessage(option.description) || option.name} */` - }); - marginLength = Math.max(optionName.length, marginLength); - } - }); - const tab = makePadding(2); - const result = []; - result.push(`{`); - result.push(`${tab}"compilerOptions": {`); - result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`); + function newline() { result.push(""); - for (const entry of entries) { - const { value, description: description3 = "" } = entry; - result.push(value && `${tab}${tab}${value}${description3 && makePadding(marginLength - value.length + 2) + description3}`); + } + function emitHeader(header) { + result.push(`${tab}${tab}// ${getLocaleSpecificMessage(header)}`); + } + function emitOption(setting, defaultValue, commented = "never") { + const existingOptionIndex = allSetOptions.indexOf(setting); + if (existingOptionIndex >= 0) { + allSetOptions.splice(existingOptionIndex, 1); } - if (fileNames.length) { - result.push(`${tab}},`); - result.push(`${tab}"files": [`); - for (let i = 0; i < fileNames.length; i++) { - result.push(`${tab}${tab}${JSON.stringify(fileNames[i])}${i === fileNames.length - 1 ? "" : ","}`); - } - result.push(`${tab}]`); + let comment; + if (commented === "always") { + comment = true; + } else if (commented === "never") { + comment = false; } else { - result.push(`${tab}}`); + comment = !hasProperty(options, setting); + } + const value = options[setting] ?? defaultValue; + if (comment) { + result.push(`${tab}${tab}// "${setting}": ${formatValueOrArray(setting, value)},`); + } else { + result.push(`${tab}${tab}"${setting}": ${formatValueOrArray(setting, value)},`); + } + } + function formatValueOrArray(settingName, value) { + const option = optionDeclarations.filter((c) => c.name === settingName)[0]; + if (!option) Debug.fail(`No option named ${settingName}?`); + const map2 = option.type instanceof Map ? option.type : void 0; + if (isArray(value)) { + const map3 = "element" in option && option.element.type instanceof Map ? option.element.type : void 0; + return `[${value.map((v) => formatSingleValue(v, map3)).join(", ")}]`; + } else { + return formatSingleValue(value, map2); + } + } + function formatSingleValue(value, map2) { + if (map2) { + value = getNameOfCompilerOptionValue(value, map2) ?? Debug.fail(`No matching value of ${value}`); } - result.push(`}`); - return result.join(newLine) + newLine; + return JSON.stringify(value); } + result.push(`${tab}}`); + result.push(`}`); + result.push(``); + return result.join(newLine); } function convertToOptionsWithAbsolutePaths(options, toAbsolutePath) { const result = {}; @@ -43787,27 +44021,6 @@ function getOptionValueWithEmptyStrings(value, option) { }); } } -function getDefaultValueForOption(option) { - switch (option.type) { - case "number": - return 1; - case "boolean": - return true; - case "string": - const defaultValue = option.defaultValueDescription; - return option.isFilePath ? `./${defaultValue && typeof defaultValue === "string" ? defaultValue : ""}` : ""; - case "list": - return []; - case "listOrElement": - return getDefaultValueForOption(option.element); - case "object": - return {}; - default: - const value = firstOrUndefinedIterator(option.type.keys()); - if (value !== void 0) return value; - return Debug.fail("Expected 'option.type' to have entries."); - } -} // src/compiler/moduleNameResolver.ts function trace(host, message, ...args) { @@ -46461,26 +46674,26 @@ function getModuleInstanceStateCached(node, visited = /* @__PURE__ */ new Map()) function getModuleInstanceStateWorker(node, visited) { switch (node.kind) { // 1. interface declarations, type alias declarations - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: if (isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (!hasSyntacticModifier(node, 32 /* Export */)) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 279 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 280 /* NamedExports */) { let state = 0 /* NonInstantiated */; for (const specifier of exportDeclaration.exportClause.elements) { const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); @@ -46495,7 +46708,7 @@ function getModuleInstanceStateWorker(node, visited) { } break; // 5. other uninstantiated module declarations. - case 268 /* ModuleBlock */: { + case 269 /* ModuleBlock */: { let state = 0 /* NonInstantiated */; forEachChild(node, (n) => { const childState = getModuleInstanceStateCached(n, visited); @@ -46514,7 +46727,7 @@ function getModuleInstanceStateWorker(node, visited) { }); return state; } - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 80 /* Identifier */: if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { @@ -46550,7 +46763,7 @@ function getModuleInstanceStateForAliasTarget(specifier, visited) { if (found === 1 /* Instantiated */) { return found; } - if (statement.kind === 271 /* ImportEqualsDeclaration */) { + if (statement.kind === 272 /* ImportEqualsDeclaration */) { found = 1 /* Instantiated */; } } @@ -46714,7 +46927,7 @@ function createBinder() { } } function getDeclarationName(node) { - if (node.kind === 277 /* ExportAssignment */) { + if (node.kind === 278 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } const name = getNameOfDeclaration(node); @@ -46723,7 +46936,7 @@ function createBinder() { const moduleName = getTextOfIdentifierOrLiteral(name); return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`; } - if (name.kind === 167 /* ComputedPropertyName */) { + if (name.kind === 168 /* ComputedPropertyName */) { const nameExpression = name.expression; if (isStringOrNumericLiteralLike(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -46748,31 +46961,31 @@ function createBinder() { return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0; } switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return "__constructor" /* Constructor */; - case 184 /* FunctionType */: - case 179 /* CallSignature */: - case 323 /* JSDocSignature */: + case 185 /* FunctionType */: + case 180 /* CallSignature */: + case 324 /* JSDocSignature */: return "__call" /* Call */; - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: return "__new" /* New */; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return "__index" /* Index */; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return "export=" /* ExportEquals */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { return "export=" /* ExportEquals */; } Debug.fail("Unknown binary declaration kind"); break; - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */; - case 169 /* Parameter */: - Debug.assert(node.parent.kind === 317 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); + case 170 /* Parameter */: + Debug.assert(node.parent.kind === 318 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); const functionType = node.parent; const index = functionType.parameters.indexOf(node); return "arg" + index; @@ -46818,7 +47031,7 @@ function createBinder() { messageNeedsName = false; multipleDefaultExports = true; } else { - if (symbol.declarations && symbol.declarations.length && (node.kind === 277 /* ExportAssignment */ && !node.isExportEquals)) { + if (symbol.declarations && symbol.declarations.length && (node.kind === 278 /* ExportAssignment */ && !node.isExportEquals)) { message = Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName = false; multipleDefaultExports = true; @@ -46857,7 +47070,7 @@ function createBinder() { function declareModuleMember(node, symbolFlags, symbolExcludes) { const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node); if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) { + if (node.kind === 282 /* ExportSpecifier */ || node.kind === 272 /* ImportEqualsDeclaration */ && hasExportModifier) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { Debug.assertNode(container, canHaveLocals); @@ -46918,9 +47131,9 @@ function createBinder() { const saveThisParentContainer = thisParentContainer; const savedBlockScopeContainer = blockScopeContainer; const savedInReturnPosition = inReturnPosition; - if (node.kind === 219 /* ArrowFunction */ && node.body.kind !== 241 /* Block */) inReturnPosition = true; + if (node.kind === 220 /* ArrowFunction */ && node.body.kind !== 242 /* Block */) inReturnPosition = true; if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 219 /* ArrowFunction */) { + if (node.kind !== 220 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -46942,7 +47155,7 @@ function createBinder() { const saveExceptionTarget = currentExceptionTarget; const saveActiveLabelList = activeLabelList; const saveHasExplicitReturn = hasExplicitReturn; - const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */; + const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */; if (!isImmediatelyInvoked) { currentFlow = createFlowNode( 2 /* Start */, @@ -46955,7 +47168,7 @@ function createBinder() { currentFlow.node = node; } } - currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0; + currentReturnTarget = isImmediatelyInvoked || node.kind === 177 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */) ? createBranchLabel() : void 0; currentExceptionTarget = void 0; currentBreakTarget = void 0; currentContinueTarget = void 0; @@ -46968,14 +47181,14 @@ function createBinder() { if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { node.flags |= emitFlags; node.endFlowNode = currentFlow; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { + if (node.kind === 177 /* Constructor */ || node.kind === 176 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */)) { node.returnFlowNode = currentFlow; } } @@ -47002,8 +47215,8 @@ function createBinder() { blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, (n) => n.kind === 262 /* FunctionDeclaration */ ? bind(n) : void 0); - bindEach(nodes, (n) => n.kind !== 262 /* FunctionDeclaration */ ? bind(n) : void 0); + bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0); + bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0); } function bindEach(nodes, bindFunction = bind) { if (nodes === void 0) { @@ -47026,59 +47239,59 @@ function createBinder() { inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 243 /* FirstStatement */ && node.kind <= 259 /* LastStatement */ && (!options.allowUnreachableCode || node.kind === 253 /* ReturnStatement */)) { + if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && (!options.allowUnreachableCode || node.kind === 254 /* ReturnStatement */)) { node.flowNode = currentFlow; } switch (node.kind) { - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: bindWhileStatement(node); break; - case 246 /* DoStatement */: + case 247 /* DoStatement */: bindDoStatement(node); break; - case 248 /* ForStatement */: + case 249 /* ForStatement */: bindForStatement(node); break; - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 245 /* IfStatement */: + case 246 /* IfStatement */: bindIfStatement(node); break; - case 253 /* ReturnStatement */: - case 257 /* ThrowStatement */: + case 254 /* ReturnStatement */: + case 258 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 258 /* TryStatement */: + case 259 /* TryStatement */: bindTryStatement(node); break; - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: bindSwitchStatement(node); break; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: bindCaseBlock(node); break; - case 296 /* CaseClause */: + case 297 /* CaseClause */: bindCaseClause(node); break; - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: bindLabeledStatement(node); break; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isDestructuringAssignment(node)) { inAssignmentPattern = saveInAssignmentPattern; bindDestructuringAssignmentFlow(node); @@ -47086,53 +47299,53 @@ function createBinder() { } bindBinaryExpressionFlow(node); break; - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: bindCallExpressionFlow(node); break; - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: bindJSDocImportTag(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 307 /* SourceFile */: { + case 308 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 241 /* Block */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 269 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: bindBindingElementFlow(node); break; - case 169 /* Parameter */: + case 170 /* Parameter */: bindParameterFlow(node); break; - case 210 /* ObjectLiteralExpression */: - case 209 /* ArrayLiteralExpression */: - case 303 /* PropertyAssignment */: - case 230 /* SpreadElement */: + case 211 /* ObjectLiteralExpression */: + case 210 /* ArrayLiteralExpression */: + case 304 /* PropertyAssignment */: + case 231 /* SpreadElement */: inAssignmentPattern = saveInAssignmentPattern; // falls through default: @@ -47147,23 +47360,23 @@ function createBinder() { case 80 /* Identifier */: case 110 /* ThisKeyword */: return true; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return hasNarrowableArgument(expr); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: if (isJSDocTypeAssertion(expr)) { return false; } // fallthrough - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return isNarrowingExpression(expr.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return expr.operator === 54 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 221 /* TypeOfExpression */: + case 222 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -47173,15 +47386,15 @@ function createBinder() { case 80 /* Identifier */: case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return true; - case 211 /* PropertyAccessExpression */: - case 217 /* ParenthesizedExpression */: - case 235 /* NonNullExpression */: + case 212 /* PropertyAccessExpression */: + case 218 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: return isNarrowableReference(expr.expression); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return (isStringOrNumericLiteralLike(expr.argumentExpression) || isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return expr.operatorToken.kind === 28 /* CommaToken */ && isNarrowableReference(expr.right) || isAssignmentOperator(expr.operatorToken.kind) && isLeftHandSideExpression(expr.left); } return false; @@ -47197,7 +47410,7 @@ function createBinder() { } } } - if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { + if (expr.expression.kind === 212 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } return false; @@ -47230,9 +47443,9 @@ function createBinder() { } function isNarrowableOperand(expr) { switch (expr.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 64 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -47319,21 +47532,21 @@ function createBinder() { function isStatementCondition(node) { const parent3 = node.parent; switch (parent3.kind) { - case 245 /* IfStatement */: - case 247 /* WhileStatement */: - case 246 /* DoStatement */: + case 246 /* IfStatement */: + case 248 /* WhileStatement */: + case 247 /* DoStatement */: return parent3.expression === node; - case 248 /* ForStatement */: - case 227 /* ConditionalExpression */: + case 249 /* ForStatement */: + case 228 /* ConditionalExpression */: return parent3.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 217 /* ParenthesizedExpression */) { + if (node.kind === 218 /* ParenthesizedExpression */) { node = node.expression; - } else if (node.kind === 224 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { + } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { node = node.operand; } else { return isLogicalOrCoalescingBinaryExpression(node); @@ -47376,7 +47589,7 @@ function createBinder() { } function setContinueTarget(node, target) { let label = activeLabelList; - while (label && node.parent.kind === 256 /* LabeledStatement */) { + while (label && node.parent.kind === 257 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -47430,12 +47643,12 @@ function createBinder() { bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 250 /* ForOfStatement */) { + if (node.kind === 251 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 261 /* VariableDeclarationList */) { + if (node.initializer.kind !== 262 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -47460,7 +47673,7 @@ function createBinder() { inReturnPosition = true; bind(node.expression); inReturnPosition = savedInReturnPosition; - if (node.kind === 253 /* ReturnStatement */) { + if (node.kind === 254 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -47478,7 +47691,7 @@ function createBinder() { return void 0; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - const flowLabel = node.kind === 252 /* BreakStatement */ ? breakTarget : continueTarget; + const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -47549,7 +47762,7 @@ function createBinder() { preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 297 /* DefaultClause */); + const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 298 /* DefaultClause */); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedent; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -47595,7 +47808,7 @@ function createBinder() { maybeBindExpressionFlowIfCall(node.expression); } function maybeBindExpressionFlowIfCall(node) { - if (node.kind === 213 /* CallExpression */) { + if (node.kind === 214 /* CallExpression */) { const call = node; if (call.expression.kind !== 108 /* SuperKeyword */ && isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -47621,7 +47834,7 @@ function createBinder() { currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { + if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { bindAssignmentTargetFlow(node); @@ -47630,21 +47843,21 @@ function createBinder() { function bindAssignmentTargetFlow(node) { if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); - } else if (node.kind === 209 /* ArrayLiteralExpression */) { + } else if (node.kind === 210 /* ArrayLiteralExpression */) { for (const e of node.elements) { - if (e.kind === 230 /* SpreadElement */) { + if (e.kind === 231 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { bindDestructuringTargetFlow(e); } } - } else if (node.kind === 210 /* ObjectLiteralExpression */) { + } else if (node.kind === 211 /* ObjectLiteralExpression */) { for (const p of node.properties) { - if (p.kind === 303 /* PropertyAssignment */) { + if (p.kind === 304 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); - } else if (p.kind === 304 /* ShorthandPropertyAssignment */) { + } else if (p.kind === 305 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); - } else if (p.kind === 305 /* SpreadAssignment */) { + } else if (p.kind === 306 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -47779,7 +47992,7 @@ function createBinder() { const operator = node.operatorToken.kind; if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 64 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) { + if (operator === 64 /* EqualsToken */ && node.left.kind === 213 /* ElementAccessExpression */) { const elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -47807,7 +48020,7 @@ function createBinder() { } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 211 /* PropertyAccessExpression */) { + if (node.expression.kind === 212 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -47882,7 +48095,7 @@ function createBinder() { } function bindJSDocTypeAlias(node) { bind(node.tagName); - if (node.kind !== 340 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 341 /* JSDocEnumTag */ && node.fullName) { setParent(node.fullName, node); setParentRecursive( node.fullName, @@ -47897,7 +48110,7 @@ function createBinder() { function bindJSDocClassTag(node) { bindEachChild(node); const host = getHostSignatureFromJSDoc(node); - if (host && host.kind !== 174 /* MethodDeclaration */) { + if (host && host.kind !== 175 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -47918,15 +48131,15 @@ function createBinder() { } function bindOptionalChainRest(node) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -47976,7 +48189,7 @@ function createBinder() { bindOptionalChainFlow(node); } else { const expr = skipParentheses(node.expression); - if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) { + if (expr.kind === 219 /* FunctionExpression */ || expr.kind === 220 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -47987,7 +48200,7 @@ function createBinder() { } } } - if (node.expression.kind === 211 /* PropertyAccessExpression */) { + if (node.expression.kind === 212 /* PropertyAccessExpression */) { const propertyAccess = node.expression; if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -48006,39 +48219,39 @@ function createBinder() { // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 307 /* SourceFile */: + case 308 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 210 /* ObjectLiteralExpression */: - case 264 /* InterfaceDeclaration */: - case 292 /* JsxAttributes */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 211 /* ObjectLiteralExpression */: + case 265 /* InterfaceDeclaration */: + case 293 /* JsxAttributes */: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 323 /* JSDocSignature */: - case 181 /* IndexSignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 317 /* JSDocFunctionType */: - case 175 /* ClassStaticBlockDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 200 /* MappedType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 324 /* JSDocSignature */: + case 182 /* IndexSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 318 /* JSDocFunctionType */: + case 176 /* ClassStaticBlockDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 201 /* MappedType */: if (container.locals) Debug.assertNode(container, canHaveLocals); return declareSymbol( container.locals, @@ -48139,10 +48352,10 @@ function createBinder() { } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -48357,7 +48570,7 @@ function createBinder() { } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { - if (blockScopeContainer.kind !== 307 /* SourceFile */ && blockScopeContainer.kind !== 267 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { + if (blockScopeContainer.kind !== 308 /* SourceFile */ && blockScopeContainer.kind !== 268 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { const errorSpan = getErrorSpanForNode(file, node); file.bindDiagnostics.push(createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); } @@ -48413,7 +48626,7 @@ function createBinder() { if (tracing) node.tracingPath = file.path; const saveInStrictMode = inStrictMode; bindWorker(node); - if (node.kind > 165 /* LastToken */) { + if (node.kind > 166 /* LastToken */) { const saveParent = parent2; parent2 = node; const containerFlags = getContainerFlags(node); @@ -48480,23 +48693,23 @@ function createBinder() { } // falls through case 110 /* ThisKeyword */: - if (currentFlow && (isExpression(node) || parent2.kind === 304 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: if (currentFlow && isPartOfTypeQuery(node)) { node.flowNode = currentFlow; } break; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: case 108 /* SuperKeyword */: node.flowNode = currentFlow; break; case 81 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -48515,7 +48728,7 @@ function createBinder() { ); } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const specialKind = getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -48550,78 +48763,78 @@ function createBinder() { Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return checkStrictModeCatchClause(node); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return checkStrictModeWithStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 197 /* ThisType */: + case 198 /* ThisType */: seenThisKeyword = true; return; - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: break; // Binding the children will handle everything - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return bindTypeParameter(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return bindParameter(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return bindPropertyWorker(node); - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 306 /* EnumMember */: + case 307 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return declareSymbolAndAddToSymbolTable( node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */ ); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 184 /* FunctionType */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: + case 186 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 200 /* MappedType */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 201 /* MappedType */: return bindAnonymousTypeWorker(node); - case 332 /* JSDocClassTag */: + case 333 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return bindFunctionExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: const assignmentKind = getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -48641,66 +48854,66 @@ function createBinder() { } break; // Members of classes, interfaces, and modules - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: inStrictMode = true; return bindClassLikeDeclaration(node); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return bindJsxAttributes(node); - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 271 /* ImportEqualsDeclaration */: - case 274 /* NamespaceImport */: - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 272 /* ImportEqualsDeclaration */: + case 275 /* NamespaceImport */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 273 /* ImportClause */: + case 274 /* ImportClause */: return bindImportClause(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return bindExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return bindExportAssignment(node); - case 307 /* SourceFile */: + case 308 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 241 /* Block */: + case 242 /* Block */: if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { return; } // falls through - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 341 /* JSDocParameterTag */: - if (node.parent.kind === 323 /* JSDocSignature */) { + case 342 /* JSDocParameterTag */: + if (node.parent.kind === 324 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 322 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 323 /* JSDocTypeLiteral */) { break; } // falls through - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: const propTag = node; - const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 316 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; + const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 317 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); - case 339 /* JSDocOverloadTag */: + case 340 /* JSDocOverloadTag */: return bind(node.typeExpression); - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return (jsDocImports || (jsDocImports = [])).push(node); } } @@ -48852,8 +49065,8 @@ function createBinder() { false ); switch (thisContainer.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: let constructorSymbol = thisContainer.symbol; if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 64 /* EqualsToken */) { const l = thisContainer.parent.left; @@ -48871,12 +49084,12 @@ function createBinder() { addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 176 /* ClassStaticBlockDeclaration */: const containingClass = thisContainer.parent; const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; if (hasDynamicName(node)) { @@ -48893,7 +49106,7 @@ function createBinder() { ); } break; - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (hasDynamicName(node)) { break; } else if (thisContainer.commonJsModuleIndicator) { @@ -48903,7 +49116,7 @@ function createBinder() { } break; // Namespaces are not allowed in javascript files, so do nothing here - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: break; default: Debug.failBadSyntaxKind(thisContainer); @@ -48931,7 +49144,7 @@ function createBinder() { function bindSpecialPropertyDeclaration(node) { if (node.expression.kind === 110 /* ThisKeyword */) { bindThisPropertyAssignment(node); - } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 307 /* SourceFile */) { + } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 308 /* SourceFile */) { if (isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } else { @@ -48980,7 +49193,7 @@ function createBinder() { } function bindObjectDefinePropertyAssignment(node) { let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - const isToplevel = node.parent.parent.kind === 307 /* SourceFile */; + const isToplevel = node.parent.parent.kind === 308 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces( namespaceSymbol, node.arguments[0], @@ -49094,7 +49307,7 @@ function createBinder() { declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */); } function isTopLevelNamespaceAssignment(propertyAccess) { - return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 307 /* SourceFile */ : propertyAccess.parent.parent.kind === 307 /* SourceFile */; + return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 308 /* SourceFile */ : propertyAccess.parent.parent.kind === 308 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { let namespaceSymbol = lookupSymbolForPropertyAccess(name, blockScopeContainer) || lookupSymbolForPropertyAccess(name, container); @@ -49156,7 +49369,7 @@ function createBinder() { } } function bindClassLikeDeclaration(node) { - if (node.kind === 263 /* ClassDeclaration */) { + if (node.kind === 264 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { const bindingName = node.name ? node.name.escapedText : "__class" /* Class */; @@ -49185,7 +49398,7 @@ function createBinder() { checkStrictModeEvalOrArguments(node, node.name); } if (!isBindingPattern(node.name)) { - const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent; + const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent; if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32 /* Export */)) { declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); } else if (isBlockOrCatchScoped(node)) { @@ -49198,7 +49411,7 @@ function createBinder() { } } function bindParameter(node) { - if (node.kind === 341 /* JSDocParameterTag */ && container.kind !== 323 /* JSDocSignature */) { + if (node.kind === 342 /* JSDocParameterTag */ && container.kind !== 324 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 33554432 /* Ambient */)) { @@ -49271,7 +49484,7 @@ function createBinder() { } else { declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } - } else if (node.parent.kind === 195 /* InferType */) { + } else if (node.parent.kind === 196 /* InferType */) { const container2 = getInferTypeContainer(node.parent); if (container2) { Debug.assertNode(container2, canHaveLocals); @@ -49302,10 +49515,10 @@ function createBinder() { if (currentFlow === unreachableFlow) { const reportError = ( // report error on all statements except empty ones - isStatementButNotDeclaration(node) && node.kind !== 242 /* EmptyStatement */ || // report error on class declarations - node.kind === 263 /* ClassDeclaration */ || // report errors on enums with preserved emit + isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || // report error on class declarations + node.kind === 264 /* ClassDeclaration */ || // report errors on enums with preserved emit isEnumDeclarationWithPreservedEmit(node, options) || // report error on instantiated modules - node.kind === 267 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) + node.kind === 268 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) ); if (reportError) { currentFlow = reportedUnreachableFlow; @@ -49319,7 +49532,7 @@ function createBinder() { } } function isEnumDeclarationWithPreservedEmit(node, options) { - return node.kind === 266 /* EnumDeclaration */ && (!isEnumConst(node) || shouldPreserveConstEnums(options)); + return node.kind === 267 /* EnumDeclaration */ && (!isEnumConst(node) || shouldPreserveConstEnums(options)); } function eachUnreachableRange(node, options, cb) { if (isStatement(node) && isExecutableStatement(node) && isBlock(node.parent)) { @@ -49335,12 +49548,12 @@ function eachUnreachableRange(node, options, cb) { } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return true; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return !isEnumDeclarationWithPreservedEmit(s, options); default: return false; @@ -49376,55 +49589,57 @@ function isExportsOrModuleExportsOrAlias(sourceFile, node) { } function getContainerFlags(node) { switch (node.kind) { - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 210 /* ObjectLiteralExpression */: - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 292 /* JsxAttributes */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 211 /* ObjectLiteralExpression */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 293 /* JsxAttributes */: return 1 /* IsContainer */; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 200 /* MappedType */: - case 181 /* IndexSignature */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 201 /* MappedType */: + case 182 /* IndexSignature */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */; } // falls through - case 176 /* Constructor */: - case 262 /* FunctionDeclaration */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 323 /* JSDocSignature */: - case 317 /* JSDocFunctionType */: - case 184 /* FunctionType */: - case 180 /* ConstructSignature */: - case 185 /* ConstructorType */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 263 /* FunctionDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 324 /* JSDocSignature */: + case 318 /* JSDocFunctionType */: + case 185 /* FunctionType */: + case 181 /* ConstructSignature */: + case 186 /* ConstructorType */: + case 176 /* ClassStaticBlockDeclaration */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 352 /* JSDocImportTag */: + return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 299 /* CatchClause */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 269 /* CaseBlock */: + case 300 /* CatchClause */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 270 /* CaseBlock */: return 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; - case 241 /* Block */: + case 242 /* Block */: return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; } return 0 /* None */; @@ -49584,7 +49799,7 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu symbol.exports.forEach(visitSymbol); } forEach(symbol.declarations, (d) => { - if (d.type && d.type.kind === 186 /* TypeQuery */) { + if (d.type && d.type.kind === 187 /* TypeQuery */) { const query = d.type; const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName)); visitSymbol(entity); @@ -49978,10 +50193,10 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) { ); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { - var _a; + var _a, _b; const getCanonicalFileName = hostGetCanonicalFileName(host); const cwd = host.getCurrentDirectory(); - const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : void 0; + const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? (_a = host.getRedirectFromSourceFile(importedFileName)) == null ? void 0 : _a.outputDts : void 0; const importedPath = toPath(importedFileName, cwd, getCanonicalFileName); const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray; const importedFileNames = [...referenceRedirect ? [referenceRedirect] : emptyArray, importedFileName, ...redirects]; @@ -49991,7 +50206,7 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref const result2 = forEach(targets, (p) => !(shouldFilterIgnoredPaths && containsIgnoredPath(p)) && cb(p, referenceRedirect === p)); if (result2) return result2; } - const symlinkedDirectories = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath(); + const symlinkedDirectories = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host).getSymlinkedDirectoriesByRealpath(); const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd); const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache( host, @@ -50983,11 +51198,11 @@ function createTypeChecker(host) { typePredicateToString: (predicate, enclosingDeclaration, flags) => { return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags); }, - writeSignature: (signature, enclosingDeclaration, flags, kind, writer) => { - return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer); + writeSignature: (signature, enclosingDeclaration, flags, kind, writer, maximumLength, verbosityLevel, out) => { + return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, maximumLength, verbosityLevel, out); }, - writeType: (type, enclosingDeclaration, flags, writer) => { - return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer); + writeType: (type, enclosingDeclaration, flags, writer, maximumLength, verbosityLevel, out) => { + return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, maximumLength, verbosityLevel, out); }, writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => { return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer); @@ -51115,6 +51330,7 @@ function createTypeChecker(host) { getNullType: () => nullType, getESSymbolType: () => esSymbolType, getNeverType: () => neverType, + getNonPrimitiveType: () => nonPrimitiveType, getOptionalType: () => optionalType, getPromiseType: () => getGlobalPromiseType( /*reportErrors*/ @@ -51221,7 +51437,8 @@ function createTypeChecker(host) { isTypeParameterPossiblyReferenced, typeHasCallOrConstructSignatures, getSymbolFlags, - getTypeArgumentsForResolvedSignature + getTypeArgumentsForResolvedSignature, + isLibType }; function getTypeArgumentsForResolvedSignature(signature) { if (signature.mapper === void 0) return void 0; @@ -51622,6 +51839,7 @@ function createTypeChecker(host) { } }; var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); + var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType); var asyncIterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", iteratorCacheKey: "iterationTypesOfAsyncIterator", @@ -51733,6 +51951,9 @@ function createTypeChecker(host) { var inferenceContextNodes = []; var inferenceContexts = []; var inferenceContextCount = 0; + var activeTypeMappers = []; + var activeTypeMappersCaches = []; + var activeTypeMappersCount = 0; var emptyStringType = getStringLiteralType(""); var zeroType = getNumberLiteralType(0); var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); @@ -51906,6 +52127,15 @@ function createTypeChecker(host) { diagnostics.add(diagnostic); return diagnostic; } + function getVerbatimModuleSyntaxErrorMessage(node) { + const sourceFile = getSourceFileOfNode(node); + const fileName = sourceFile.fileName; + if (fileExtensionIsOneOf(fileName, [".cts" /* Cts */, ".cjs" /* Cjs */])) { + return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax; + } else { + return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript; + } + } function addErrorOrSuggestion(isError, diagnostic) { if (isError) { diagnostics.add(diagnostic); @@ -52255,13 +52485,13 @@ function createTypeChecker(host) { return true; } if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { - if (declaration.kind === 208 /* BindingElement */) { - const errorBindingElement = getAncestor(usage, 208 /* BindingElement */); + if (declaration.kind === 209 /* BindingElement */) { + const errorBindingElement = getAncestor(usage, 209 /* BindingElement */); if (errorBindingElement) { return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 260 /* VariableDeclaration */), usage); - } else if (declaration.kind === 260 /* VariableDeclaration */) { + return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage); + } else if (declaration.kind === 261 /* VariableDeclaration */) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } else if (isClassLike(declaration)) { const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : !legacyDecorators && isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration)); @@ -52284,10 +52514,10 @@ function createTypeChecker(host) { } return true; } - if (usage.parent.kind === 281 /* ExportSpecifier */ || usage.parent.kind === 277 /* ExportAssignment */ && usage.parent.isExportEquals) { + if (usage.parent.kind === 282 /* ExportSpecifier */ || usage.parent.kind === 278 /* ExportAssignment */ && usage.parent.isExportEquals) { return true; } - if (usage.kind === 277 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 278 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { @@ -52305,9 +52535,9 @@ function createTypeChecker(host) { return false; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) { switch (declaration2.parent.parent.kind) { - case 243 /* VariableStatement */: - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: + case 244 /* VariableStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) { return true; } @@ -52317,12 +52547,15 @@ function createTypeChecker(host) { return isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage2, grandparent.expression, declContainer); } function isUsedInFunctionOrInstanceProperty(usage2, declaration2) { + return isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2); + } + function isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2) { return !!findAncestor(usage2, (current) => { if (current === declContainer) { return "quit"; } if (isFunctionLike(current)) { - return true; + return !getImmediatelyInvokedFunctionExpression(current); } if (isClassStaticBlockDeclaration(current)) { return declaration2.pos < usage2.pos; @@ -52332,7 +52565,7 @@ function createTypeChecker(host) { const initializerOfProperty = propertyDeclaration.initializer === current; if (initializerOfProperty) { if (isStatic(current.parent)) { - if (declaration2.kind === 174 /* MethodDeclaration */) { + if (declaration2.kind === 175 /* MethodDeclaration */) { return true; } if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) { @@ -52346,13 +52579,22 @@ function createTypeChecker(host) { } } } else { - const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2); + const isDeclarationInstanceProperty = declaration2.kind === 173 /* PropertyDeclaration */ && !isStatic(declaration2); if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) { return true; } } } } + const decorator = tryCast(current.parent, isDecorator); + if (decorator && decorator.expression === current) { + if (isParameter(decorator.parent)) { + return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent.parent, declaration2) ? true : "quit"; + } + if (isMethodDeclaration(decorator.parent)) { + return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent, declaration2) ? true : "quit"; + } + } return false; }); } @@ -52365,15 +52607,15 @@ function createTypeChecker(host) { return "quit"; } switch (node.kind) { - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return true; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true; - case 241 /* Block */: + case 242 /* Block */: switch (node.parent.kind) { - case 177 /* GetAccessor */: - case 174 /* MethodDeclaration */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 175 /* MethodDeclaration */: + case 179 /* SetAccessor */: return true; default: return false; @@ -52409,7 +52651,7 @@ function createTypeChecker(host) { function onFailedToResolveSymbol(errorLocation, nameArg, meaning, nameNotFoundMessage) { const name = isString(nameArg) ? nameArg : nameArg.escapedText; addLazyDiagnostic(() => { - if (!errorLocation || errorLocation.parent.kind !== 324 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { + if (!errorLocation || errorLocation.parent.kind !== 325 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { let suggestion; let suggestedLib; if (nameArg) { @@ -52480,7 +52722,7 @@ function createTypeChecker(host) { if (errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 281 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( error2(errorLocation, message, unescapedName), @@ -52493,7 +52735,7 @@ function createTypeChecker(host) { const isGlobal = getSymbol2(globals, name, meaning) === result; const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && getSymbol2(lastLocation.locals, name, ~111551 /* Value */); if (nonValueSymbol) { - const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 276 /* ImportSpecifier */ || d.kind === 273 /* ImportClause */ || d.kind === 274 /* NamespaceImport */ || d.kind === 271 /* ImportEqualsDeclaration */); + const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 277 /* ImportSpecifier */ || d.kind === 274 /* ImportClause */ || d.kind === 275 /* NamespaceImport */ || d.kind === 272 /* ImportEqualsDeclaration */); if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) { error2(importDecl, Diagnostics.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, unescapeLeadingUnderscores(name)); } @@ -52507,7 +52749,7 @@ function createTypeChecker(host) { diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 281 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); @@ -52566,9 +52808,9 @@ function createTypeChecker(host) { function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: if (isEntityNameExpression(node.expression)) { return node.expression; } @@ -52633,7 +52875,7 @@ function createTypeChecker(host) { return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 281 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 282 /* ExportSpecifier */) { error2(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -52646,7 +52888,7 @@ function createTypeChecker(host) { if (grandparent && grandparent.parent && isHeritageClause(grandparent)) { const heritageKind = grandparent.token; const containerKind = grandparent.parent.kind; - if (containerKind === 264 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) { + if (containerKind === 265 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) { error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name)); } else if (isClassLike(grandparent.parent) && heritageKind === 96 /* ExtendsKeyword */) { error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name)); @@ -52750,7 +52992,7 @@ function createTypeChecker(host) { return; } const declaration = (_a = result.declarations) == null ? void 0 : _a.find( - (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 266 /* EnumDeclaration */ + (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 267 /* EnumDeclaration */ ); if (declaration === void 0) return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -52778,13 +53020,13 @@ function createTypeChecker(host) { } function getAnyImportSyntax(node) { switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return node; - case 273 /* ImportClause */: + case 274 /* ImportClause */: return node.parent; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return node.parent.parent; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return node.parent.parent.parent; default: return void 0; @@ -52794,7 +53036,7 @@ function createTypeChecker(host) { return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration); } function isAliasSymbolDeclaration(node) { - return node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 270 /* NamespaceExportDeclaration */ || node.kind === 273 /* ImportClause */ && !!node.name || node.kind === 274 /* NamespaceImport */ || node.kind === 280 /* NamespaceExport */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 281 /* ExportSpecifier */ || node.kind === 277 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 304 /* ShorthandPropertyAssignment */ || node.kind === 303 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 260 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + return node.kind === 272 /* ImportEqualsDeclaration */ || node.kind === 271 /* NamespaceExportDeclaration */ || node.kind === 274 /* ImportClause */ && !!node.name || node.kind === 275 /* NamespaceImport */ || node.kind === 281 /* NamespaceExport */ || node.kind === 277 /* ImportSpecifier */ || node.kind === 282 /* ExportSpecifier */ || node.kind === 278 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 305 /* ShorthandPropertyAssignment */ || node.kind === 304 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 209 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); } function isAliasableOrJsExpression(e) { return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e); @@ -52805,12 +53047,18 @@ function createTypeChecker(host) { const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0; } - if (isVariableDeclaration(node) || node.moduleReference.kind === 283 /* ExternalModuleReference */) { + if (isVariableDeclaration(node) || node.moduleReference.kind === 284 /* ExternalModuleReference */) { const immediate = resolveExternalModuleName( node, getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node) ); const resolved2 = resolveExternalModuleSymbol(immediate); + if (resolved2 && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) { + const moduleExports = getExportOfModule(resolved2, "module.exports", node, dontResolveAlias); + if (moduleExports) { + return moduleExports; + } + } markSymbolOfAliasDeclarationIfTypeOnly( node, immediate, @@ -52834,10 +53082,10 @@ function createTypeChecker(host) { false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */; + const isExport = typeOnlyDeclaration.kind === 282 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 279 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name); + const name = typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name); addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } @@ -52940,14 +53188,29 @@ function createTypeChecker(host) { } function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) { var _a; + const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); + const specifier = getModuleSpecifierForImportOrExport(node); let exportDefaultSymbol; + let exportModuleDotExportsSymbol; if (isShorthandAmbientModuleSymbol(moduleSymbol)) { exportDefaultSymbol = moduleSymbol; + } else if (file && specifier && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && getEmitSyntaxForModuleSpecifierExpression(specifier) === 1 /* CommonJS */ && host.getImpliedNodeFormatForEmit(file) === 99 /* ESNext */ && (exportModuleDotExportsSymbol = resolveExportByName(moduleSymbol, "module.exports", node, dontResolveAlias))) { + if (!getESModuleInterop(compilerOptions)) { + error2(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), "esModuleInterop"); + return void 0; + } + markSymbolOfAliasDeclarationIfTypeOnly( + node, + exportModuleDotExportsSymbol, + /*finalTarget*/ + void 0, + /*overwriteEmpty*/ + false + ); + return exportModuleDotExportsSymbol; } else { exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias); } - const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const specifier = getModuleSpecifierForImportOrExport(node); if (!specifier) { return exportDefaultSymbol; } @@ -52997,15 +53260,15 @@ function createTypeChecker(host) { } function getModuleSpecifierForImportOrExport(node) { switch (node.kind) { - case 273 /* ImportClause */: + case 274 /* ImportClause */: return node.parent.moduleSpecifier; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return node.parent.parent.moduleSpecifier; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier; default: return Debug.assertNever(node); @@ -53338,26 +53601,26 @@ function createTypeChecker(host) { } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) { switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: - case 260 /* VariableDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 261 /* VariableDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 273 /* ImportClause */: + case 274 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 276 /* ImportSpecifier */: - case 208 /* BindingElement */: + case 277 /* ImportSpecifier */: + case 209 /* BindingElement */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 277 /* ExportAssignment */: - case 226 /* BinaryExpression */: + case 278 /* ExportAssignment */: + case 227 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return resolveEntityName( node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, @@ -53365,10 +53628,10 @@ function createTypeChecker(host) { true, dontRecursivelyResolve ); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve); - case 212 /* ElementAccessExpression */: - case 211 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: return getTargetOfAccessExpression(node, dontRecursivelyResolve); default: return Debug.fail(); @@ -53490,7 +53753,7 @@ function createTypeChecker(host) { return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + const resolved = links.typeOnlyDeclaration.kind === 279 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; @@ -53499,7 +53762,7 @@ function createTypeChecker(host) { if (entityName.kind === 80 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) { + if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 167 /* QualifiedName */) { return resolveEntityName( entityName, 1920 /* Namespace */, @@ -53508,7 +53771,7 @@ function createTypeChecker(host) { dontResolveAlias ); } else { - Debug.assert(entityName.parent.kind === 271 /* ImportEqualsDeclaration */); + Debug.assert(entityName.parent.kind === 272 /* ImportEqualsDeclaration */); return resolveEntityName( entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, @@ -53579,9 +53842,9 @@ function createTypeChecker(host) { if (!symbol) { return getMergedSymbol(symbolFromJSPrototype); } - } else if (name.kind === 166 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) { - const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression; - const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name; + } else if (name.kind === 167 /* QualifiedName */ || name.kind === 212 /* PropertyAccessExpression */) { + const left = name.kind === 167 /* QualifiedName */ ? name.left : name.expression; + const right = name.kind === 167 /* QualifiedName */ ? name.right : name.name; let namespace = resolveEntityName( left, namespaceMeaning, @@ -53647,7 +53910,7 @@ function createTypeChecker(host) { } else { Debug.assertNever(name, "Unknown entity name kind."); } - if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 277 /* ExportAssignment */)) { + if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 278 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly( getAliasDeclarationFromName(name), symbol, @@ -53739,7 +54002,7 @@ function createTypeChecker(host) { return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; if (errorNode && startsWith(moduleReference, "@types/")) { const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1; const withoutAtTypePrefix = removePrefix(moduleReference, "@types/"); @@ -53798,7 +54061,7 @@ function createTypeChecker(host) { getAnyExtensionFromPath(moduleReference) ); } else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) { - const redirect = host.getResolvedProjectReferenceToRedirect(sourceFile.path); + const redirect = (_i = host.getRedirectFromSourceFile(sourceFile.path)) == null ? void 0 : _i.resolvedRef; if (redirect) { const ignoreCase = !host.useCaseSensitiveFileNames(); const ownRootDir = host.getCommonSourceDirectory(); @@ -53838,7 +54101,7 @@ function createTypeChecker(host) { if (ext === ".ts" /* Ts */ || ext === ".js" /* Js */ || ext === ".tsx" /* Tsx */ || ext === ".jsx" /* Jsx */) { diagnosticDetails = createModeMismatchDetails(currentSourceFile); } - const message = (overrideHost == null ? void 0 : overrideHost.kind) === 272 /* ImportDeclaration */ && ((_i = overrideHost.importClause) == null ? void 0 : _i.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 205 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead; + const message = (overrideHost == null ? void 0 : overrideHost.kind) === 273 /* ImportDeclaration */ && ((_j = overrideHost.importClause) == null ? void 0 : _j.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 206 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead; diagnostics.add(createDiagnosticForNodeFromMessageChain( getSourceFileOfNode(errorNode), errorNode, @@ -53886,9 +54149,9 @@ function createTypeChecker(host) { } if (moduleNotFoundError) { if (resolvedModule) { - const redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName); - if (redirect) { - error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName); + const redirect = host.getRedirectFromSourceFile(resolvedModule.resolvedFileName); + if (redirect == null ? void 0 : redirect.outputDts) { + error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, resolvedModule.resolvedFileName); return void 0; } } @@ -53901,14 +54164,14 @@ function createTypeChecker(host) { error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); - const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1]; + const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1]; if (suggestedExt) { error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); } else { error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path); } } else { - if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) { + if ((_l = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _l.alternateResult) { const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference); errorOrSuggestion( /*isError*/ @@ -53988,13 +54251,14 @@ function createTypeChecker(host) { var _a; const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 307 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 308 /* SourceFile */)) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; error2(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); return symbol; } const referenceParent = referencingLocation.parent; - if (isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent) || isImportCall(referenceParent)) { + const namespaceImport = isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent); + if (namespaceImport || isImportCall(referenceParent)) { const reference = isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier; const type = getTypeOfSymbol(symbol); const defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference); @@ -54002,13 +54266,20 @@ function createTypeChecker(host) { return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent); } const targetFile = (_a = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile); - const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(reference), host.getImpliedNodeFormatForEmit(targetFile)); - if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { - let sigs = getSignaturesOfStructuredType(type, 0 /* Call */); - if (!sigs || !sigs.length) { - sigs = getSignaturesOfStructuredType(type, 1 /* Construct */); + const usageMode = getEmitSyntaxForModuleSpecifierExpression(reference); + let exportModuleDotExportsSymbol; + if (namespaceImport && targetFile && 102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && usageMode === 1 /* CommonJS */ && host.getImpliedNodeFormatForEmit(targetFile) === 99 /* ESNext */ && (exportModuleDotExportsSymbol = resolveExportByName(symbol, "module.exports", namespaceImport, dontResolveAlias))) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + error2(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, "esModuleInterop"); } - if (sigs && sigs.length || getPropertyOfType( + if (getESModuleInterop(compilerOptions) && hasSignatures(type)) { + return cloneTypeAsModuleType(exportModuleDotExportsSymbol, type, referenceParent); + } + return exportModuleDotExportsSymbol; + } + const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(usageMode, host.getImpliedNodeFormatForEmit(targetFile)); + if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { + if (hasSignatures(type) || getPropertyOfType( type, "default" /* Default */, /*skipObjectFunctionPropertyAugment*/ @@ -54022,6 +54293,9 @@ function createTypeChecker(host) { } return symbol; } + function hasSignatures(type) { + return some(getSignaturesOfStructuredType(type, 0 /* Call */)) || some(getSignaturesOfStructuredType(type, 1 /* Construct */)); + } function cloneTypeAsModuleType(symbol, moduleType, referenceParent) { const result = createSymbol(symbol.flags, symbol.escapedName); result.declarations = symbol.declarations ? symbol.declarations.slice() : []; @@ -54205,7 +54479,7 @@ function createTypeChecker(host) { } function getFunctionExpressionParentSymbolOrSymbol(symbol) { var _a, _b; - return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol; + return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 220 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 219 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol; } function getAlternativeContainingModules(symbol, enclosingDeclaration) { const containingFile = getSourceFileOfNode(enclosingDeclaration); @@ -54465,12 +54739,12 @@ function createTypeChecker(host) { } } switch (location.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (!isExternalOrCommonJsModule(location)) { break; } // falls through - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const sym = getSymbolOfDeclaration(location); if (result = callback( (sym == null ? void 0 : sym.exports) || emptySymbols, @@ -54483,9 +54757,9 @@ function createTypeChecker(host) { return result; } break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: let table; (getSymbolOfDeclaration(location).members || emptySymbols).forEach((memberSymbol, key) => { if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) { @@ -54563,7 +54837,7 @@ function createTypeChecker(host) { return [symbol]; } const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => { - if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */))) { + if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 282 /* ExportSpecifier */))) { const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -54608,7 +54882,7 @@ function createTypeChecker(host) { if (symbolFromSymbolTable === symbol) { return true; } - const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */); + const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 282 /* ExportSpecifier */); symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; if (flags & meaning) { @@ -54623,10 +54897,10 @@ function createTypeChecker(host) { if (symbol.declarations && symbol.declarations.length) { for (const declaration of symbol.declarations) { switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: continue; default: return false; @@ -54761,10 +55035,10 @@ function createTypeChecker(host) { return node && getSymbolOfDeclaration(node); } function hasExternalModuleSymbol(declaration) { - return isAmbientModule(declaration) || declaration.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(declaration); + return isAmbientModule(declaration) || declaration.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(declaration); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return isModuleWithStringLiteralName(declaration) || declaration.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(declaration); + return isModuleWithStringLiteralName(declaration) || declaration.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(declaration); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { let aliasesToMakeVisible; @@ -54788,7 +55062,14 @@ function createTypeChecker(host) { if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); } else if (symbol.flags & 2 /* BlockScopedVariable */) { - const variableStatement = findAncestor(declaration, isVariableStatement); + const rootDeclaration = walkUpBindingElementsAndPatterns(declaration); + if (rootDeclaration.kind === 170 /* Parameter */) { + return false; + } + const variableStatement = rootDeclaration.parent.parent; + if (variableStatement.kind !== 244 /* VariableStatement */) { + return false; + } if (hasSyntacticModifier(variableStatement, 32 /* Export */)) { return true; } @@ -54812,9 +55093,9 @@ function createTypeChecker(host) { } function getMeaningOfEntityNameReference(entityName) { let meaning; - if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */ || entityName.parent.kind === 182 /* TypePredicate */ && entityName.parent.parameterName === entityName) { + if (entityName.parent.kind === 187 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 168 /* ComputedPropertyName */ || entityName.parent.kind === 183 /* TypePredicate */ && entityName.parent.parameterName === entityName) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; - } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) { + } else if (entityName.kind === 167 /* QualifiedName */ || entityName.kind === 212 /* PropertyAccessExpression */ || entityName.parent.kind === 272 /* ImportEqualsDeclaration */ || entityName.parent.kind === 167 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 212 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 213 /* ElementAccessExpression */ && entityName.parent.expression === entityName) { meaning = 1920 /* Namespace */; } else { meaning = 788968 /* Type */; @@ -54886,7 +55167,7 @@ function createTypeChecker(host) { return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags, internalNodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 307 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -54898,16 +55179,28 @@ function createTypeChecker(host) { return writer2; } } - function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer) { + function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer, maximumLength, verbosityLevel, out) { return writer ? signatureToStringWorker(writer).getText() : usingSingleLineStringWriter(signatureToStringWorker); function signatureToStringWorker(writer2) { let sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 186 /* ConstructorType */ : 185 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 181 /* ConstructSignature */ : 180 /* CallSignature */; } - const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + const sig = nodeBuilder.signatureToSignatureDeclaration( + signature, + sigOutput, + enclosingDeclaration, + toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */, + /*internalFlags*/ + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + out + ); const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( @@ -54920,14 +55213,19 @@ function createTypeChecker(host) { return writer2; } } - function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter("")) { - const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; + function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), maximumLength, verbosityLevel, out) { + const noTruncation = !maximumLength && compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; const typeNode = nodeBuilder.typeToTypeNode( type, enclosingDeclaration, - toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0 /* None */), + toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), /*internalFlags*/ - void 0 + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + out ); if (typeNode === void 0) return Debug.fail("should always get typenode"); const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); @@ -54940,7 +55238,7 @@ function createTypeChecker(host) { writer ); const result = writer.getText(); - const maxLength2 = noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2; + const maxLength2 = maximumLength || (noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2); if (maxLength2 && result && result.length >= maxLength2) { return result.substr(0, maxLength2 - "...".length) + "..."; } @@ -54991,14 +55289,14 @@ function createTypeChecker(host) { requiresAddingImplicitUndefined(declaration, symbol, enclosingDeclaration) { var _a; switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 348 /* JSDocPropertyTag */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 349 /* JSDocPropertyTag */: symbol ?? (symbol = getSymbolOfDeclaration(declaration)); const type = getTypeOfSymbol(symbol); return !!(symbol.flags & 4 /* Property */ && symbol.flags & 16777216 /* Optional */ && isOptionalDeclaration(declaration) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type)); - case 169 /* Parameter */: - case 341 /* JSDocParameterTag */: + case 170 /* Parameter */: + case 342 /* JSDocParameterTag */: return requiresAddingImplicitUndefined(declaration, enclosingDeclaration); default: Debug.assertNever(declaration); @@ -55006,7 +55304,6 @@ function createTypeChecker(host) { }, isOptionalParameter, isUndefinedIdentifierExpression(node) { - Debug.assert(isExpressionNode(node)); return getSymbolAtLocation(node) === undefinedSymbol; }, isEntityNameVisible(context, entityName, shouldComputeAliasToMakeVisible) { @@ -55015,10 +55312,11 @@ function createTypeChecker(host) { serializeExistingTypeNode(context, typeNode, addUndefined) { return serializeExistingTypeNode(context, typeNode, !!addUndefined); }, - serializeReturnTypeForSignature(syntacticContext, signatureDeclaration) { + serializeReturnTypeForSignature(syntacticContext, signatureDeclaration, symbol) { const context = syntacticContext; const signature = getSignatureFromDeclaration(signatureDeclaration); - const returnType = context.enclosingSymbolTypes.get(getSymbolId(getSymbolOfDeclaration(signatureDeclaration))) ?? instantiateType(getReturnTypeOfSignature(signature), context.mapper); + symbol ?? (symbol = getSymbolOfDeclaration(signatureDeclaration)); + const returnType = context.enclosingSymbolTypes.get(getSymbolId(symbol)) ?? instantiateType(getReturnTypeOfSignature(signature), context.mapper); return serializeInferredReturnTypeForSignature(context, signature, returnType); }, serializeTypeOfExpression(syntacticContext, expr) { @@ -55032,7 +55330,7 @@ function createTypeChecker(host) { symbol ?? (symbol = getSymbolOfDeclaration(declaration)); let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol)); if (type === void 0) { - type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType; + type = symbol.flags & 98304 /* Accessor */ && declaration.kind === 179 /* SetAccessor */ ? instantiateType(getWriteTypeOfSymbol(symbol), context.mapper) : symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType; } const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration); if (addUndefinedForParameter) { @@ -55092,6 +55390,7 @@ function createTypeChecker(host) { const context = syntacticContext; if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) { let name = lit.text; + const originalName = name; const nodeSymbol = getNodeLinks(parent2).resolvedSymbol; const meaning = parent2.isTypeOf ? 111551 /* Value */ : 788968 /* Type */; const parentSymbol = nodeSymbol && isSymbolAccessible( @@ -55121,7 +55420,9 @@ function createTypeChecker(host) { context.tracker.reportLikelyUnsafeImportRequiredError(name); } } - return name; + if (name !== originalName) { + return name; + } } }, canReuseTypeNode(context, typeNode) { @@ -55135,7 +55436,7 @@ function createTypeChecker(host) { let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol)); if (type === void 0) { if (symbol.flags & 98304 /* Accessor */) { - type = node.kind === 178 /* SetAccessor */ ? getWriteTypeOfSymbol(symbol) : getTypeOfAccessors(symbol); + type = node.kind === 179 /* SetAccessor */ ? getWriteTypeOfSymbol(symbol) : getTypeOfAccessors(symbol); } else if (isValueSignatureDeclaration(node)) { type = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } else { @@ -55154,31 +55455,142 @@ function createTypeChecker(host) { }; return { syntacticBuilderResolver, - typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeToTypeNodeHelper(type, context)), - typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)), - serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)), - serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)), - serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)), - indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper( - indexInfo, - context, - /*typeNode*/ - void 0 - )), - signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => signatureToSignatureDeclarationHelper(signature, kind, context)), - symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToName( - symbol, - context, - meaning, - /*expectsIdentifier*/ - false - )), - symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToExpression(symbol, context, meaning)), - symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParametersToTypeParameterDeclarations(symbol, context)), - symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToParameterDeclaration(symbol, context)), - typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParameterToDeclaration(parameter, context)), - symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolTableToDeclarationStatements(symbolTable, context)), - symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToNode(symbol, context, meaning)) + typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out), + typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context) + ), + serializeTypeForDeclaration: (declaration, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context) + ), + serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context) + ), + serializeTypeForExpression: (expr, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context) + ), + indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => indexInfoToIndexSignatureDeclarationHelper( + indexInfo, + context, + /*typeNode*/ + void 0 + ) + ), + signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => signatureToSignatureDeclarationHelper(signature, kind, context), out), + symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToName( + symbol, + context, + meaning, + /*expectsIdentifier*/ + false + ) + ), + symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToExpression(symbol, context, meaning) + ), + symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => typeParametersToTypeParameterDeclarations(symbol, context) + ), + symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToParameterDeclaration(symbol, context) + ), + typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context), out), + symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolTableToDeclarationStatements(symbolTable, context) + ), + symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext2( + enclosingDeclaration, + flags, + internalFlags, + tracker, + /*maximumLength*/ + void 0, + /*verbosityLevel*/ + void 0, + (context) => symbolToNode(symbol, context, meaning) + ), + symbolToDeclarations }; function getTypeFromTypeNode2(context, node, noMappedTypes) { const type = getTypeFromTypeNodeWithoutContext(node); @@ -55220,14 +55632,87 @@ function createTypeChecker(host) { } return symbolToExpression(symbol, context, meaning); } - function withContext2(enclosingDeclaration, flags, internalFlags, tracker, cb) { + function symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out) { + const nodes = withContext2( + /*enclosingDeclaration*/ + void 0, + flags, + /*internalFlags*/ + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + (context) => symbolToDeclarationsWorker(symbol, context), + out + ); + return mapDefined(nodes, (node) => { + switch (node.kind) { + case 264 /* ClassDeclaration */: + return simplifyClassDeclaration(node, symbol); + case 267 /* EnumDeclaration */: + return simplifyModifiers(node, isEnumDeclaration, symbol); + case 265 /* InterfaceDeclaration */: + return simplifyInterfaceDeclaration(node, symbol, meaning); + case 268 /* ModuleDeclaration */: + return simplifyModifiers(node, isModuleDeclaration, symbol); + default: + return void 0; + } + }); + } + function simplifyClassDeclaration(classDecl, symbol) { + const classDeclarations = filter(symbol.declarations, isClassLike); + const originalClassDecl = classDeclarations && classDeclarations.length > 0 ? classDeclarations[0] : classDecl; + const modifiers = getEffectiveModifierFlags(originalClassDecl) & ~(32 /* Export */ | 128 /* Ambient */); + const isAnonymous = isClassExpression(originalClassDecl); + if (isAnonymous) { + classDecl = factory.updateClassDeclaration( + classDecl, + classDecl.modifiers, + /*name*/ + void 0, + classDecl.typeParameters, + classDecl.heritageClauses, + classDecl.members + ); + } + return factory.replaceModifiers(classDecl, modifiers); + } + function simplifyModifiers(newDecl, isDeclKind, symbol) { + const decls = filter(symbol.declarations, isDeclKind); + const declWithModifiers = decls && decls.length > 0 ? decls[0] : newDecl; + const modifiers = getEffectiveModifierFlags(declWithModifiers) & ~(32 /* Export */ | 128 /* Ambient */); + return factory.replaceModifiers(newDecl, modifiers); + } + function simplifyInterfaceDeclaration(interfaceDecl, symbol, meaning) { + if (!(meaning & 64 /* Interface */)) { + return void 0; + } + return simplifyModifiers(interfaceDecl, isInterfaceDeclaration, symbol); + } + function symbolToDeclarationsWorker(symbol, context) { + const type = getDeclaredTypeOfSymbol(symbol); + context.typeStack.push(type.id); + context.typeStack.push(-1); + const table = createSymbolTable([symbol]); + const statements = symbolTableToDeclarationStatements(table, context); + context.typeStack.pop(); + context.typeStack.pop(); + return statements; + } + function withContext2(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, cb, out) { const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0; + flags = flags || 0 /* None */; + const maxTruncationLength = maximumLength || (flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); const context = { enclosingDeclaration, enclosingFile: enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration), - flags: flags || 0 /* None */, + flags, internalFlags: internalFlags || 0 /* None */, tracker: void 0, + maxTruncationLength, + maxExpansionDepth: verbosityLevel ?? -1, encounteredError: false, suppressReportInferenceFallback: false, reportedDiagnostic: false, @@ -55249,13 +55734,23 @@ function createTypeChecker(host) { typeParameterNamesByText: void 0, typeParameterNamesByTextNextNameCount: void 0, enclosingSymbolTypes: /* @__PURE__ */ new Map(), - mapper: void 0 + mapper: void 0, + depth: 0, + typeStack: [], + out: { + canIncreaseExpansionDepth: false, + truncated: false + } }; context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost); const resultingNode = cb(context); if (context.truncating && context.flags & 1 /* NoTruncation */) { context.tracker.reportTruncationError(); } + if (out) { + out.canIncreaseExpansionDepth = context.out.canIncreaseExpansionDepth; + out.truncated = context.out.truncated; + } return context.encounteredError ? void 0 : resultingNode; } function addSymbolTypeToContext(context, symbol, type) { @@ -55274,19 +55769,49 @@ function createTypeChecker(host) { function saveRestoreFlags(context) { const flags = context.flags; const internalFlags = context.internalFlags; + const depth = context.depth; return restore; function restore() { context.flags = flags; context.internalFlags = internalFlags; + context.depth = depth; } } + function checkTruncationLengthIfExpanding(context) { + return context.maxExpansionDepth >= 0 && checkTruncationLength(context); + } function checkTruncationLength(context) { if (context.truncating) return context.truncating; - return context.truncating = context.approximateLength > (context.flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); + return context.truncating = context.approximateLength > context.maxTruncationLength; + } + function canPossiblyExpandType(type, context) { + for (let i = 0; i < context.typeStack.length - 1; i++) { + if (context.typeStack[i] === type.id) { + return false; + } + } + return context.depth < context.maxExpansionDepth || context.depth === context.maxExpansionDepth && !context.out.canIncreaseExpansionDepth; + } + function shouldExpandType(type, context, isAlias = false) { + if (!isAlias && isLibType(type)) { + return false; + } + for (let i = 0; i < context.typeStack.length - 1; i++) { + if (context.typeStack[i] === type.id) { + return false; + } + } + const result = context.depth < context.maxExpansionDepth; + if (!result) { + context.out.canIncreaseExpansionDepth = true; + } + return result; } function typeToTypeNodeHelper(type, context) { const restoreFlags = saveRestoreFlags(context); + if (type) context.typeStack.push(type.id); const typeNode = typeToTypeNodeWorker(type, context); + if (type) context.typeStack.pop(); restoreFlags(); return typeNode; } @@ -55297,6 +55822,7 @@ function createTypeChecker(host) { } const inTypeAlias = context.flags & 8388608 /* InTypeAlias */; context.flags &= ~8388608 /* InTypeAlias */; + let expandingEnum = false; if (!type) { if (!(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { context.encounteredError = true; @@ -55364,7 +55890,11 @@ function createTypeChecker(host) { return Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); } } - return symbolToTypeNode(type.symbol, context, 788968 /* Type */); + if (!shouldExpandType(type, context)) { + return symbolToTypeNode(type.symbol, context, 788968 /* Type */); + } else { + expandingEnum = true; + } } if (type.flags & 128 /* StringLiteral */) { context.approximateLength += type.value.length + 2; @@ -55431,16 +55961,34 @@ function createTypeChecker(host) { return factory.createThisTypeNode(); } if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { - const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); - if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes); - if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) { - return factory.createArrayTypeNode(typeArgumentNodes[0]); + if (!shouldExpandType( + type, + context, + /*isAlias*/ + true + )) { + const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); + if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */)) return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes); + if (length(typeArgumentNodes) === 1 && type.aliasSymbol === globalArrayType.symbol) { + return factory.createArrayTypeNode(typeArgumentNodes[0]); + } + return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes); } - return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes); + context.depth += 1; } const objectFlags = getObjectFlags(type); if (objectFlags & 4 /* Reference */) { Debug.assert(!!(type.flags & 524288 /* Object */)); + if (shouldExpandType(type, context)) { + context.depth += 1; + return createAnonymousTypeNode( + type, + /*forceClassExpansion*/ + true, + /*forceExpansion*/ + true + ); + } return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type); } if (type.flags & 262144 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) { @@ -55470,6 +56018,16 @@ function createTypeChecker(host) { void 0 ); } + if (objectFlags & 3 /* ClassOrInterface */ && shouldExpandType(type, context)) { + context.depth += 1; + return createAnonymousTypeNode( + type, + /*forceClassExpansion*/ + true, + /*forceExpansion*/ + true + ); + } if (type.symbol) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); } @@ -55484,7 +56042,7 @@ function createTypeChecker(host) { type = type.origin; } if (type.flags & (1048576 /* Union */ | 2097152 /* Intersection */)) { - const types = type.flags & 1048576 /* Union */ ? formatUnionTypes(type.types) : type.types; + const types = type.flags & 1048576 /* Union */ ? formatUnionTypes(type.types, expandingEnum) : type.types; if (length(types) === 1) { return typeToTypeNodeHelper(types[0], context); } @@ -55615,12 +56173,19 @@ function createTypeChecker(host) { const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0; let appropriateConstraintTypeNode; let newTypeVariable; + let templateType = getTemplateTypeFromMappedType(type2); + const typeParameter = getTypeParameterFromMappedType(type2); const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a2 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a2.flags) & 4194304 /* Index */); if (isMappedTypeWithKeyofConstraintDeclaration(type2)) { if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) { - const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); - const name = typeParameterToName(newParam, context); + const newConstraintParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); + const name = typeParameterToName(newConstraintParam, context); + const target = type2.target; newTypeVariable = factory.createTypeReferenceNode(name); + templateType = instantiateType( + getTemplateTypeFromMappedType(target), + makeArrayTypeMapper([getTypeParameterFromMappedType(target), getModifiersTypeFromMappedType(target)], [typeParameter, newConstraintParam]) + ); } appropriateConstraintTypeNode = factory.createTypeOperatorNode(143 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type2), context)); } else if (needsModifierPreservingWrapper) { @@ -55631,9 +56196,17 @@ function createTypeChecker(host) { } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type2), context); } - const typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type2), context, appropriateConstraintTypeNode); + const typeParameterNode = typeParameterToDeclarationWithConstraint(typeParameter, context, appropriateConstraintTypeNode); + const cleanup = enterNewScope( + context, + type2.declaration, + /*expandedParams*/ + void 0, + [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type2.declaration.typeParameter))] + ); const nameTypeNode = type2.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type2), context) : void 0; - const templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type2), !!(getMappedTypeModifiers(type2) & 4 /* IncludeOptional */)), context); + const templateTypeNode = typeToTypeNodeHelper(removeMissingType(templateType, !!(getMappedTypeModifiers(type2) & 4 /* IncludeOptional */)), context); + cleanup(); const mappedTypeNode = factory.createMappedTypeNode( readonlyToken, typeParameterNode, @@ -55673,7 +56246,7 @@ function createTypeChecker(host) { } return result; } - function createAnonymousTypeNode(type2) { + function createAnonymousTypeNode(type2, forceClassExpansion = false, forceExpansion = false) { var _a2, _b2; const typeId = type2.id; const symbol = type2.symbol; @@ -55696,15 +56269,20 @@ function createTypeChecker(host) { const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { return symbolToTypeNode(symbol, context, isInstanceType); - } else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( + } else if (!forceExpansion && (symbol.flags & 32 /* Class */ && !forceClassExpansion && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( symbol, context.enclosingDeclaration, isInstanceType, /*shouldComputeAliasesToMakeVisible*/ false - ).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); - } else if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + ).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol())) { + if (shouldExpandType(type2, context)) { + context.depth += 1; + } else { + return symbolToTypeNode(symbol, context, isInstanceType); + } + } + if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) { const typeAlias = getTypeAliasForTypeLiteral(type2); if (typeAlias) { return symbolToTypeNode(typeAlias, context, 788968 /* Type */); @@ -55722,7 +56300,7 @@ function createTypeChecker(host) { const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration))); const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol - forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */)); + forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 269 /* ModuleBlock */)); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); @@ -55740,7 +56318,7 @@ function createTypeChecker(host) { if (id && !context.symbolDepth) { context.symbolDepth = /* @__PURE__ */ new Map(); } - const links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration); + const links = context.maxExpansionDepth >= 0 ? void 0 : context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration); const key = `${getTypeId(type2)}|${context.flags}|${context.internalFlags}`; if (links) { links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map()); @@ -55827,18 +56405,18 @@ function createTypeChecker(host) { } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { const signature = resolved.callSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context); + const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { const signature = resolved.constructSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context); + const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* ConstructorType */, context); return signatureNode; } } const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */)); if (some(abstractSignatures)) { - const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s)); + const types = map(abstractSignatures, getOrCreateTypeFromSignature); const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per // the logic in `createTypeNodesFromResolvedType`. (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties)); @@ -56057,6 +56635,7 @@ function createTypeChecker(host) { } function createTypeNodesFromResolvedType(resolvedType) { if (checkTruncationLength(context)) { + context.out.truncated = true; if (context.flags & 1 /* NoTruncation */) { return [addSyntheticTrailingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, "elided")]; } @@ -56070,23 +56649,28 @@ function createTypeChecker(host) { void 0 )]; } + context.typeStack.push(-1); const typeElements = []; for (const signature of resolvedType.callSignatures) { - typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* CallSignature */, context)); } for (const signature of resolvedType.constructSignatures) { if (signature.flags & 4 /* Abstract */) continue; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* ConstructSignature */, context)); } for (const info of resolvedType.indexInfos) { typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0)); } const properties = resolvedType.properties; if (!properties) { + context.typeStack.pop(); return typeElements; } let i = 0; for (const propertySymbol of properties) { + if (isExpanding(context) && propertySymbol.flags & 4194304 /* Prototype */) { + continue; + } i++; if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) { if (propertySymbol.flags & 4194304 /* Prototype */) { @@ -56097,6 +56681,7 @@ function createTypeChecker(host) { } } if (checkTruncationLength(context) && i + 2 < properties.length - 1) { + context.out.truncated = true; if (context.flags & 1 /* NoTruncation */) { const typeElement = typeElements.pop(); typeElements.push(addSyntheticTrailingComment(typeElement, 3 /* MultiLineCommentTrivia */, `... ${properties.length - i} more elided ...`)); @@ -56116,6 +56701,7 @@ function createTypeChecker(host) { } addPropertyToElementList(propertySymbol, context, typeElements); } + context.typeStack.pop(); return typeElements.length ? typeElements : void 0; } } @@ -56177,33 +56763,84 @@ function createTypeChecker(host) { context.approximateLength += symbolName(propertySymbol).length + 1; if (propertySymbol.flags & 98304 /* Accessor */) { const writeType = getWriteTypeOfSymbol(propertySymbol); - if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) { - const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */); - const getterSignature = getSignatureFromDeclaration(getterDeclaration); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }), - getterDeclaration - ) - ); - const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */); - const setterSignature = getSignatureFromDeclaration(setterDeclaration); - typeElements.push( - setCommentRange2( - context, - signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }), - setterDeclaration - ) - ); - return; + if (!isErrorType(propertyType) && !isErrorType(writeType)) { + const symbolMapper = getSymbolLinks(propertySymbol).mapper; + const propDeclaration = getDeclarationOfKind(propertySymbol, 173 /* PropertyDeclaration */); + if (propertyType !== writeType || propertySymbol.parent.flags & 32 /* Class */ && !propDeclaration) { + const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */); + if (getterDeclaration) { + const getterSignature = getSignatureFromDeclaration(getterDeclaration); + typeElements.push( + setCommentRange2( + context, + signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }), + getterDeclaration + ) + ); + } + const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */); + if (setterDeclaration) { + const setterSignature = getSignatureFromDeclaration(setterDeclaration); + typeElements.push( + setCommentRange2( + context, + signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }), + setterDeclaration + ) + ); + } + return; + } + if (propertySymbol.parent.flags & 32 /* Class */ && propDeclaration && find(propDeclaration.modifiers, isAccessorModifier)) { + const fakeGetterSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + propertyType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 /* None */ + ); + typeElements.push( + setCommentRange2( + context, + signatureToSignatureDeclarationHelper(fakeGetterSignature, 178 /* GetAccessor */, context, { name: propertyName }), + propDeclaration + ) + ); + const setterParam = createSymbol(1 /* FunctionScopedVariable */, "arg"); + setterParam.links.type = writeType; + const fakeSetterSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [setterParam], + voidType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 /* None */ + ); + typeElements.push( + signatureToSignatureDeclarationHelper(fakeSetterSignature, 179 /* SetAccessor */, context, { name: propertyName }) + ); + return; + } } } const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0; if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) { const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */); for (const signature of signatures) { - const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 174 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration, signature.declaration || propertySymbol.valueDeclaration)); } if (signatures.length || !optionalToken) { @@ -56242,7 +56879,7 @@ function createTypeChecker(host) { typeElements.push(preserveCommentsOn(propertySignature, propertySymbol.valueDeclaration)); function preserveCommentsOn(node, range) { var _a2; - const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 348 /* JSDocPropertyTag */); + const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 349 /* JSDocPropertyTag */); if (jsdocPropertyTag) { const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment); if (commentText) { @@ -56263,6 +56900,7 @@ function createTypeChecker(host) { function mapToTypeNodes(types, context, isBareList) { if (some(types)) { if (checkTruncationLength(context)) { + context.out.truncated = true; if (!isBareList) { return [ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided") : factory.createTypeReferenceNode( @@ -56290,6 +56928,7 @@ function createTypeChecker(host) { for (const type of types) { i++; if (checkTruncationLength(context) && i + 2 < types.length - 1) { + context.out.truncated = true; result.push( context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - i} more elided ...`) : factory.createTypeReferenceNode( `... ${types.length - i} more ...`, @@ -56376,7 +57015,7 @@ function createTypeChecker(host) { } const restoreFlags = saveRestoreFlags(context); context.flags &= ~256 /* SuppressAnyReturnType */; - const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */)); + const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 177 /* Constructor */)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { parameters.unshift(thisParameter); @@ -56384,11 +57023,11 @@ function createTypeChecker(host) { restoreFlags(); const returnTypeNode = serializeReturnTypeForSignature(context, signature); let modifiers = options == null ? void 0 : options.modifiers; - if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { + if (kind === 186 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { const flags = modifiersToFlags(modifiers); modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */); } - const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 180 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 181 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, @@ -56400,25 +57039,25 @@ function createTypeChecker(host) { returnTypeNode, /*body*/ void 0 - ) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration( + ) : kind === 177 /* Constructor */ ? factory.createConstructorDeclaration( modifiers, parameters, /*body*/ void 0 - ) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration( + ) : kind === 178 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 - ) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration( + ) : kind === 179 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), parameters, /*body*/ void 0 - ) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 317 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 262 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( + ) : kind === 182 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 318 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 185 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 186 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( modifiers, /*asteriskToken*/ void 0, @@ -56428,7 +57067,7 @@ function createTypeChecker(host) { returnTypeNode, /*body*/ void 0 - ) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression( + ) : kind === 219 /* FunctionExpression */ ? factory.createFunctionExpression( modifiers, /*asteriskToken*/ void 0, @@ -56437,7 +57076,7 @@ function createTypeChecker(host) { parameters, returnTypeNode, factory.createBlock([]) - ) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction( + ) : kind === 220 /* ArrowFunction */ ? factory.createArrowFunction( modifiers, typeParameters, parameters, @@ -56449,7 +57088,7 @@ function createTypeChecker(host) { if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 323 /* JSDocSignature */ && signature.declaration.parent.kind === 339 /* JSDocOverloadTag */) { + if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 324 /* JSDocSignature */ && signature.declaration.parent.kind === 340 /* JSDocOverloadTag */) { const comment = getTextOfNode( signature.declaration.parent.parent, /*includeTrivia*/ @@ -56614,9 +57253,9 @@ function createTypeChecker(host) { function bindPattern(p) { forEach(p.elements, (e) => { switch (e.kind) { - case 232 /* OmittedExpression */: + case 233 /* OmittedExpression */: return; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return bindElement(e); default: return Debug.assertNever(e); @@ -56687,7 +57326,7 @@ function createTypeChecker(host) { return factory.createTypeParameterDeclaration(modifiers, name, constraintNode, defaultParameterNode); } function typeToTypeNodeHelperWithPossibleReusableTypeNode(type, typeNode, context) { - return typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context); + return !canPossiblyExpandType(type, context) && typeNode && getTypeFromTypeNode2(context, typeNode) === type && syntacticNodeBuilder.tryReuseExistingTypeNode(context, typeNode) || typeToTypeNodeHelper(type, context); } function typeParameterToDeclaration(type, context, constraint = getConstraintOfTypeParameter(type)) { const constraintNode = constraint && typeToTypeNodeHelperWithPossibleReusableTypeNode(constraint, getConstraintDeclaration(type), context); @@ -56700,12 +57339,12 @@ function createTypeChecker(host) { return factory.createTypePredicateNode(assertsModifier, parameterName, typeNode); } function getEffectiveParameterDeclaration(parameterSymbol) { - const parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */); + const parameterDeclaration = getDeclarationOfKind(parameterSymbol, 170 /* Parameter */); if (parameterDeclaration) { return parameterDeclaration; } if (!isTransientSymbol(parameterSymbol)) { - return getDeclarationOfKind(parameterSymbol, 341 /* JSDocParameterTag */); + return getDeclarationOfKind(parameterSymbol, 342 /* JSDocParameterTag */); } } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { @@ -56731,7 +57370,7 @@ function createTypeChecker(host) { return parameterNode; } function parameterToParameterDeclarationName(parameterSymbol, parameterDeclaration, context) { - return parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); + return parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 167 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); function cloneBindingName(node) { return elideInitializerAndSetEmitFlags(node); function elideInitializerAndSetEmitFlags(node2) { @@ -56915,11 +57554,11 @@ function createTypeChecker(host) { return top; } function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) { - let file = getDeclarationOfKind(symbol, 307 /* SourceFile */); + let file = getDeclarationOfKind(symbol, 308 /* SourceFile */); if (!file) { const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol)); if (equivalentFileSymbol) { - file = getDeclarationOfKind(equivalentFileSymbol, 307 /* SourceFile */); + file = getDeclarationOfKind(equivalentFileSymbol, 308 /* SourceFile */); } } if (file && file.moduleName !== void 0) { @@ -57206,12 +57845,15 @@ function createTypeChecker(host) { } let firstChar = symbolName2.charCodeAt(0); if (isSingleOrDoubleQuote(firstChar) && some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { - return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context)); + const specifier = getSpecifierForModuleSymbol(symbol2, context); + context.approximateLength += 2 + specifier.length; + return factory.createStringLiteral(specifier); } if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; + context.approximateLength += 1 + symbolName2.length; return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier; } else { if (firstChar === 91 /* openBracket */) { @@ -57220,16 +57862,21 @@ function createTypeChecker(host) { } let expression; if (isSingleOrDoubleQuote(firstChar) && !(symbol2.flags & 8 /* EnumMember */)) { - expression = factory.createStringLiteral(stripQuotes(symbolName2).replace(/\\./g, (s) => s.substring(1)), firstChar === 39 /* singleQuote */); + const literalText = stripQuotes(symbolName2).replace(/\\./g, (s) => s.substring(1)); + context.approximateLength += literalText.length + 2; + expression = factory.createStringLiteral(literalText, firstChar === 39 /* singleQuote */); } else if ("" + +symbolName2 === symbolName2) { + context.approximateLength += symbolName2.length; expression = factory.createNumericLiteral(+symbolName2); } if (!expression) { const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 16777216 /* NoAsciiEscaping */); if (typeParameterNodes) setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); identifier.symbol = symbol2; + context.approximateLength += symbolName2.length; expression = identifier; } + context.approximateLength += 2; return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression); } } @@ -57258,6 +57905,10 @@ function createTypeChecker(host) { ), "'"))); } function getPropertyNameNodeForSymbol(symbol, context) { + const hashPrivateName = getClonedHashPrivateName(symbol); + if (hashPrivateName) { + return hashPrivateName; + } const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed); const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed); const isMethod = !!(symbol.flags & 8192 /* Method */); @@ -57334,14 +57985,14 @@ function createTypeChecker(host) { let result; const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration); const decl = declaration ?? symbol.valueDeclaration ?? getDeclarationWithTypeAnnotation(symbol) ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); - if (decl) { + if (!canPossiblyExpandType(type, context) && decl) { + const restore = addSymbolTypeToContext(context, symbol, type); if (isAccessor(decl)) { result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context); } else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608 /* RequiresWidening */)) { - const restore = addSymbolTypeToContext(context, symbol, type); result = syntacticNodeBuilder.serializeTypeOfDeclaration(decl, symbol, context); - restore(); } + restore(); } if (!result) { if (addUndefinedForParameter) { @@ -57373,7 +58024,7 @@ function createTypeChecker(host) { let returnTypeNode; const returnType = getReturnTypeOfSignature(signature); if (!(suppressAny && isTypeAny(returnType))) { - if (signature.declaration && !nodeIsSynthesized(signature.declaration)) { + if (signature.declaration && !nodeIsSynthesized(signature.declaration) && !canPossiblyExpandType(returnType, context)) { const declarationSymbol = getSymbolOfDeclaration(signature.declaration); const restore = addSymbolTypeToContext(context, declarationSymbol, returnType); returnTypeNode = syntacticNodeBuilder.serializeReturnTypeForSignature(signature.declaration, declarationSymbol, context); @@ -57495,10 +58146,7 @@ function createTypeChecker(host) { /*context*/ void 0 ); - if (updated !== node2) { - setTextRange2(context, updated, node2); - } - return updated; + return setTextRange2(context, updated, node2); } } function serializeTypeName(context, node, isTypeOf, typeArguments) { @@ -57571,13 +58219,13 @@ function createTypeChecker(host) { var _a; const serializePropertySymbolForClass = makeSerializePropertySymbol( factory.createPropertyDeclaration, - 174 /* MethodDeclaration */, + 175 /* MethodDeclaration */, /*useAccessors*/ true ); const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol( (mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), - 173 /* MethodSignature */, + 174 /* MethodSignature */, /*useAccessors*/ false ); @@ -57787,14 +58435,28 @@ function createTypeChecker(host) { if (!suppressNewPrivateContext) { deferredPrivatesStack.push(/* @__PURE__ */ new Map()); } - symbolTable2.forEach((symbol) => { + let i = 0; + const symbols = Array.from(symbolTable2.values()); + for (const symbol of symbols) { + i++; + if (checkTruncationLengthIfExpanding(context) && i + 2 < symbolTable2.size - 1) { + context.out.truncated = true; + results.push(createTruncationStatement(`... (${symbolTable2.size - i} more ...)`)); + serializeSymbol( + symbols[symbols.length - 1], + /*isPrivate*/ + false, + !!propertyAsAlias + ); + break; + } serializeSymbol( symbol, /*isPrivate*/ false, !!propertyAsAlias ); - }); + } if (!suppressNewPrivateContext) { deferredPrivatesStack[deferredPrivatesStack.length - 1].forEach((symbol) => { serializeSymbol( @@ -57824,7 +58486,7 @@ function createTypeChecker(host) { } } function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) { - var _a2, _b, _c, _d, _e, _f; + var _a2, _b, _c, _d, _e, _f, _g; const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName); const isDefault = escapedSymbolName === "default" /* Default */; if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) { @@ -57874,6 +58536,7 @@ function createTypeChecker(host) { const propertyAccessRequire = (_e = symbol.declarations) == null ? void 0 : _e.find(isPropertyAccessExpression); if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) { const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right; + context.approximateLength += 12 + (((_g = alias == null ? void 0 : alias.escapedText) == null ? void 0 : _g.length) ?? 0); addResult( factory.createExportDeclaration( /*modifiers*/ @@ -57913,8 +58576,10 @@ function createTypeChecker(host) { ), textRange ); + context.approximateLength += 7 + name.length; addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags); if (name !== localName && !isPrivate) { + context.approximateLength += 16 + name.length + localName.length; addResult( factory.createExportDeclaration( /*modifiers*/ @@ -57964,27 +58629,33 @@ function createTypeChecker(host) { for (const node of symbol.declarations) { const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); if (!resolvedModule) continue; + const isTypeOnly = node.isTypeOnly; + const specifier = getSpecifierForModuleSymbol(resolvedModule, context); + context.approximateLength += 17 + specifier.length; addResult(factory.createExportDeclaration( /*modifiers*/ void 0, - /*isTypeOnly*/ - node.isTypeOnly, + isTypeOnly, /*exportClause*/ void 0, - factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context)) + factory.createStringLiteral(specifier) ), 0 /* None */); } } } if (needsPostExportDefault) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 16 + internalSymbolName.length; addResult(factory.createExportAssignment( /*modifiers*/ void 0, /*isExportEquals*/ false, - factory.createIdentifier(getInternalSymbolName(symbol, symbolName2)) + factory.createIdentifier(internalSymbolName) ), 0 /* None */); } else if (needsExportDeclaration) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 22 + symbolName2.length + internalSymbolName.length; addResult( factory.createExportDeclaration( /*modifiers*/ @@ -57994,7 +58665,7 @@ function createTypeChecker(host) { factory.createNamedExports([factory.createExportSpecifier( /*isTypeOnly*/ false, - getInternalSymbolName(symbol, symbolName2), + internalSymbolName, symbolName2 )]) ), @@ -58014,6 +58685,7 @@ function createTypeChecker(host) { } function addResult(node, additionalModifierFlags) { if (canHaveModifiers(node)) { + const oldModifierFlags = getEffectiveModifierFlags(node); let newModifierFlags = 0 /* None */; const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration); if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) { @@ -58026,8 +58698,9 @@ function createTypeChecker(host) { newModifierFlags |= 2048 /* Default */; } if (newModifierFlags) { - node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node)); + node = factory.replaceModifiers(node, newModifierFlags | oldModifierFlags); } + context.approximateLength += modifiersLength(newModifierFlags | oldModifierFlags); } results.push(node); } @@ -58043,12 +58716,14 @@ function createTypeChecker(host) { const oldEnclosingDecl = context.enclosingDeclaration; context.enclosingDeclaration = jsdocAliasDecl; const typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && syntacticNodeBuilder.tryReuseExistingTypeNode(context, jsdocAliasDecl.typeExpression.type) || typeToTypeNodeHelper(aliasType, context); + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 8 + ((commentText == null ? void 0 : commentText.length) ?? 0) + internalSymbolName.length; addResult( setSyntheticLeadingComments( factory.createTypeAliasDeclaration( /*modifiers*/ void 0, - getInternalSymbolName(symbol, symbolName2), + internalSymbolName, typeParamDecls, typeNode ), @@ -58060,21 +58735,28 @@ function createTypeChecker(host) { context.enclosingDeclaration = oldEnclosingDecl; } function serializeInterface(symbol, symbolName2, modifierFlags) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 14 + internalSymbolName.length; const interfaceType = getDeclaredTypeOfClassOrInterface(symbol); const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); const typeParamDecls = map(localParams, (p) => typeParameterToDeclaration(p, context)); const baseTypes = getBaseTypes(interfaceType); const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0; - const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType)); - const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */); - const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */); + const members = serializePropertySymbolsForClassOrInterface( + getPropertiesOfType(interfaceType), + /*isClass*/ + false, + baseType + ); + const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 180 /* CallSignature */); + const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 181 /* ConstructSignature */); const indexSignatures = serializeIndexSignatures(interfaceType, baseType); const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))]; addResult( factory.createInterfaceDeclaration( /*modifiers*/ void 0, - getInternalSymbolName(symbol, symbolName2), + internalSymbolName, typeParamDecls, heritageClauses, [...indexSignatures, ...constructSignatures, ...callSignatures, ...members] @@ -58082,6 +58764,57 @@ function createTypeChecker(host) { modifierFlags ); } + function serializePropertySymbolsForClassOrInterface(props, isClass, baseType, isStatic2) { + const elements = []; + let i = 0; + for (const prop of props) { + i++; + if (checkTruncationLengthIfExpanding(context) && i + 2 < props.length - 1) { + context.out.truncated = true; + const placeholder = createTruncationProperty(`... ${props.length - i} more ... `, isClass); + elements.push(placeholder); + const result2 = isClass ? serializePropertySymbolForClass(props[props.length - 1], isStatic2, baseType) : serializePropertySymbolForInterface(props[props.length - 1], baseType); + if (isArray(result2)) { + elements.push(...result2); + } else { + elements.push(result2); + } + break; + } + context.approximateLength += 1; + const result = isClass ? serializePropertySymbolForClass(prop, isStatic2, baseType) : serializePropertySymbolForInterface(prop, baseType); + if (isArray(result)) { + elements.push(...result); + } else { + elements.push(result); + } + } + return elements; + } + function createTruncationProperty(dotDotDotText, isClass) { + if (context.flags & 1 /* NoTruncation */) { + return addSyntheticLeadingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, dotDotDotText); + } + return isClass ? factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + dotDotDotText, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ) : factory.createPropertySignature( + /*modifiers*/ + void 0, + dotDotDotText, + /*questionToken*/ + void 0, + /*type*/ + void 0 + ); + } function getNamespaceMembersForSerialization(symbol) { let exports2 = arrayFrom(getExportsOfSymbol(symbol).values()); const merged = getMergedSymbol(symbol); @@ -58101,11 +58834,27 @@ function createTypeChecker(host) { } function serializeModule(symbol, symbolName2, modifierFlags) { const members = getNamespaceMembersForSerialization(symbol); - const locationMap = arrayToMultiMap(members, (m) => m.parent && m.parent === symbol ? "real" : "merged"); + const expanding = isExpanding(context); + const locationMap = arrayToMultiMap(members, (m) => m.parent && m.parent === symbol || expanding ? "real" : "merged"); const realMembers = locationMap.get("real") || emptyArray; const mergedMembers = locationMap.get("merged") || emptyArray; - if (length(realMembers)) { - const localName = getInternalSymbolName(symbol, symbolName2); + if (length(realMembers) || expanding) { + let localName; + if (expanding) { + const oldFlags = context.flags; + context.flags |= 512 /* WriteTypeParametersInQualifiedName */ | 2 /* UseOnlyExternalAliasing */; + localName = symbolToNode( + symbol, + context, + /*meaning*/ + -1 /* All */ + ); + context.flags = oldFlags; + } else { + const localText = getInternalSymbolName(symbol, symbolName2); + localName = factory.createIdentifier(localText); + context.approximateLength += localText.length; + } serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 /* Function */ | 67108864 /* Assignment */))); } if (length(mergedMembers)) { @@ -58153,17 +58902,51 @@ function createTypeChecker(host) { } } function serializeEnum(symbol, symbolName2, modifierFlags) { + const internalSymbolName = getInternalSymbolName(symbol, symbolName2); + context.approximateLength += 9 + internalSymbolName.length; + const members = []; + const memberProps = filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)); + let i = 0; + for (const p of memberProps) { + i++; + if (checkTruncationLengthIfExpanding(context) && i + 2 < memberProps.length - 1) { + context.out.truncated = true; + members.push(factory.createEnumMember(` ... ${memberProps.length - i} more ... `)); + const last2 = memberProps[memberProps.length - 1]; + const initializedValue = last2.declarations && last2.declarations[0] && isEnumMember(last2.declarations[0]) ? getConstantValue2(last2.declarations[0]) : void 0; + const initializer2 = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue); + const memberName2 = unescapeLeadingUnderscores(last2.escapedName); + const member2 = factory.createEnumMember( + memberName2, + initializer2 + ); + members.push(member2); + break; + } + const memberDecl = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? p.declarations[0] : void 0; + let initializer; + let initializerLength; + if (isExpanding(context) && memberDecl && memberDecl.initializer) { + initializer = getSynthesizedDeepClone(memberDecl.initializer); + initializerLength = memberDecl.initializer.end - memberDecl.initializer.pos; + } else { + const initializedValue = memberDecl && getConstantValue2(memberDecl); + initializer = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue); + initializerLength = (initializer == null ? void 0 : initializer.text.length) ?? 0; + } + const memberName = unescapeLeadingUnderscores(p.escapedName); + context.approximateLength += 4 + memberName.length + initializerLength; + const member = factory.createEnumMember( + memberName, + initializer + ); + members.push(member); + } addResult( factory.createEnumDeclaration( factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0), - getInternalSymbolName(symbol, symbolName2), - map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => { - const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0; - return factory.createEnumMember( - unescapeLeadingUnderscores(p.escapedName), - initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue) - ); - }) + internalSymbolName, + members ), modifierFlags ); @@ -58171,20 +58954,28 @@ function createTypeChecker(host) { function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) { const signatures = getSignaturesOfType(type, 0 /* Call */); for (const sig of signatures) { - const decl = signatureToSignatureDeclarationHelper(sig, 262 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName) }); + context.approximateLength += 1; + const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName) }); addResult(setTextRange2(context, decl, getSignatureTextRangeLocation(sig)), modifierFlags); } if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) { const props = filter(getPropertiesOfType(type), isNamespaceMember); + context.approximateLength += localName.length; serializeAsNamespaceDeclaration( props, - localName, + factory.createIdentifier(localName), modifierFlags, /*suppressNewPrivateContext*/ true ); } } + function createTruncationStatement(dotDotDotText) { + if (context.flags & 1 /* NoTruncation */) { + return addSyntheticLeadingComment(factory.createEmptyStatement(), 3 /* MultiLineCommentTrivia */, dotDotDotText); + } + return factory.createExpressionStatement(factory.createIdentifier(dotDotDotText)); + } function getSignatureTextRangeLocation(signature) { if (signature.declaration && signature.declaration.parent) { if (isBinaryExpression(signature.declaration.parent) && getAssignmentDeclarationKind(signature.declaration.parent) === 5 /* Property */) { @@ -58197,15 +58988,18 @@ function createTypeChecker(host) { return signature.declaration; } function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) { + const nodeFlags = isIdentifier(localName) ? 32 /* Namespace */ : 0 /* None */; + const expanding = isExpanding(context); if (length(props)) { - const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) ? "local" : "remote"); + context.approximateLength += 14; + const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) || expanding ? "local" : "remote"); const localProps = localVsRemoteMap.get("local") || emptyArray; let fakespace = parseNodeFactory.createModuleDeclaration( /*modifiers*/ void 0, - factory.createIdentifier(localName), + localName, factory.createModuleBlock([]), - 32 /* Namespace */ + nodeFlags ); setParent(fakespace, enclosingDeclaration); fakespace.locals = createSymbolTable(props); @@ -58247,6 +59041,18 @@ function createTypeChecker(host) { factory.createModuleBlock(exportModifierStripped) ); addResult(fakespace, modifierFlags); + } else if (expanding) { + context.approximateLength += 14; + addResult( + factory.createModuleDeclaration( + /*modifiers*/ + void 0, + localName, + factory.createModuleBlock([]), + nodeFlags + ), + modifierFlags + ); } } function isNamespaceMember(p) { @@ -58289,11 +59095,13 @@ function createTypeChecker(host) { } function serializeAsClass(symbol, localName, modifierFlags) { var _a2, _b; + context.approximateLength += 9 + localName.length; const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike); const oldEnclosing = context.enclosingDeclaration; context.enclosingDeclaration = originalDecl || oldEnclosing; const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); const typeParamDecls = map(localParams, (p) => typeParameterToDeclaration(p, context)); + forEach(localParams, (p) => context.approximateLength += symbolName(p.symbol).length); const classType = getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(symbol)); const baseTypes = getBaseTypes(classType); const originalImplements = originalDecl && getEffectiveImplementsTypeNodes(originalDecl); @@ -58301,20 +59109,22 @@ function createTypeChecker(host) { const staticType = getTypeOfSymbol(symbol); const isClass = !!((_b = staticType.symbol) == null ? void 0 : _b.valueDeclaration) && isClassLike(staticType.symbol.valueDeclaration); const staticBaseType = isClass ? getBaseConstructorTypeOfClass(staticType) : anyType; + context.approximateLength += (length(baseTypes) ? 8 : 0) + (length(implementsExpressions) ? 11 : 0); const heritageClauses = [ ...!length(baseTypes) ? [] : [factory.createHeritageClause(96 /* ExtendsKeyword */, map(baseTypes, (b) => serializeBaseType(b, staticBaseType, localName)))], ...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119 /* ImplementsKeyword */, implementsExpressions)] ]; const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType)); - const publicSymbolProps = filter(symbolProps, (s) => { - const valueDecl = s.valueDeclaration; - return !!valueDecl && !(isNamedDeclaration(valueDecl) && isPrivateIdentifier(valueDecl.name)); - }); - const hasPrivateIdentifier = some(symbolProps, (s) => { - const valueDecl = s.valueDeclaration; - return !!valueDecl && isNamedDeclaration(valueDecl) && isPrivateIdentifier(valueDecl.name); - }); - const privateProperties = hasPrivateIdentifier ? [factory.createPropertyDeclaration( + const publicSymbolProps = filter(symbolProps, (s) => !isHashPrivate(s)); + const hasPrivateIdentifier = some(symbolProps, isHashPrivate); + const privateProperties = hasPrivateIdentifier ? isExpanding(context) ? serializePropertySymbolsForClassOrInterface( + filter(symbolProps, isHashPrivate), + /*isClass*/ + true, + baseTypes[0], + /*isStatic*/ + false + ) : [factory.createPropertyDeclaration( /*modifiers*/ void 0, factory.createPrivateIdentifier("#private"), @@ -58325,28 +59135,33 @@ function createTypeChecker(host) { /*initializer*/ void 0 )] : emptyArray; - const publicProperties = flatMap(publicSymbolProps, (p) => serializePropertySymbolForClass( - p, + if (hasPrivateIdentifier && !isExpanding(context)) { + context.approximateLength += 9; + } + const publicProperties = serializePropertySymbolsForClassOrInterface( + publicSymbolProps, + /*isClass*/ + true, + baseTypes[0], /*isStatic*/ - false, - baseTypes[0] - )); - const staticMembers = flatMap( + false + ); + const staticMembers = serializePropertySymbolsForClassOrInterface( filter(getPropertiesOfType(staticType), (p) => !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype" && !isNamespaceMember(p)), - (p) => serializePropertySymbolForClass( - p, - /*isStatic*/ - true, - staticBaseType - ) + /*isClass*/ + true, + staticBaseType, + /*isStatic*/ + true ); const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */)); + if (isNonConstructableClassLikeInJsFile) context.approximateLength += 21; const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration( factory.createModifiersFromModifierFlags(2 /* Private */), [], /*body*/ void 0 - )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */); + )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 177 /* Constructor */); const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); context.enclosingDeclaration = oldEnclosing; addResult( @@ -58404,23 +59219,25 @@ function createTypeChecker(host) { const targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); switch (node.kind) { - case 208 /* BindingElement */: - if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) { + case 209 /* BindingElement */: + if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) { const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); const { propertyName } = node; + const propertyNameText = propertyName && isIdentifier(propertyName) ? idText(propertyName) : void 0; + context.approximateLength += 24 + localName.length + specifier2.length + ((propertyNameText == null ? void 0 : propertyNameText.length) ?? 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory.createNamedImports([factory.createImportSpecifier( /*isTypeOnly*/ false, - propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0, + propertyNameText ? factory.createIdentifier(propertyNameText) : void 0, factory.createIdentifier(localName) )]) ), @@ -58434,19 +59251,20 @@ function createTypeChecker(host) { } Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); break; - case 304 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 226 /* BinaryExpression */) { + case 305 /* ShorthandPropertyAssignment */: + if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) { serializeExportSpecifier( unescapeLeadingUnderscores(symbol.escapedName), targetName ); } break; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: if (isPropertyAccessExpression(node.initializer)) { const initializer = node.initializer; const uniqueName = factory.createUniqueName(localName); const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); + context.approximateLength += 22 + specifier2.length + idText(uniqueName).length; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58458,6 +59276,7 @@ function createTypeChecker(host) { ), 0 /* None */ ); + context.approximateLength += 12 + localName.length + idText(uniqueName).length + idText(initializer.name).length; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58472,12 +59291,13 @@ function createTypeChecker(host) { break; } // else fall through and treat commonjs require just like import= - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } const isLocalImport = !(target.flags & 512 /* ValueModule */) && !isVariableDeclaration(node); + context.approximateLength += 11 + localName.length + unescapeLeadingUnderscores(target.escapedName).length; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58496,20 +59316,22 @@ function createTypeChecker(host) { isLocalImport ? modifierFlags : 0 /* None */ ); break; - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */); break; - case 273 /* ImportClause */: { + case 274 /* ImportClause */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier; const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0; const isTypeOnly = isJSDocImportTag(node.parent); + context.approximateLength += 14 + localName.length + 3 + (isTypeOnly ? 4 : 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - isTypeOnly, + /* phaseModifier */ + isTypeOnly ? 156 /* TypeKeyword */ : void 0, factory.createIdentifier(localName), /*namedBindings*/ void 0 @@ -58521,16 +59343,18 @@ function createTypeChecker(host) { ); break; } - case 274 /* NamespaceImport */: { + case 275 /* NamespaceImport */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier; const isTypeOnly = isJSDocImportTag(node.parent.parent); + context.approximateLength += 19 + localName.length + 3 + (isTypeOnly ? 4 : 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - isTypeOnly, + /* phaseModifier */ + isTypeOnly ? 156 /* TypeKeyword */ : void 0, /*name*/ void 0, factory.createNamespaceImport(factory.createIdentifier(localName)) @@ -58542,7 +59366,8 @@ function createTypeChecker(host) { ); break; } - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: + context.approximateLength += 19 + localName.length + 3; addResult( factory.createExportDeclaration( /*modifiers*/ @@ -58555,16 +59380,18 @@ function createTypeChecker(host) { 0 /* None */ ); break; - case 276 /* ImportSpecifier */: { + case 277 /* ImportSpecifier */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = context.bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier; const isTypeOnly = isJSDocImportTag(node.parent.parent.parent); + context.approximateLength += 19 + localName.length + 3 + (isTypeOnly ? 4 : 0); addResult( factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - isTypeOnly, + /* phaseModifier */ + isTypeOnly ? 156 /* TypeKeyword */ : void 0, /*name*/ void 0, factory.createNamedImports([ @@ -58583,7 +59410,7 @@ function createTypeChecker(host) { ); break; } - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: const specifier = node.parent.parent.moduleSpecifier; if (specifier) { const propertyName = node.propertyName; @@ -58597,12 +59424,12 @@ function createTypeChecker(host) { specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0 ); break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 226 /* BinaryExpression */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 227 /* BinaryExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) { serializeMaybeAliasAssignment(symbol); } else { @@ -58614,6 +59441,7 @@ function createTypeChecker(host) { } } function serializeExportSpecifier(localName, targetName, specifier) { + context.approximateLength += 16 + localName.length + (localName !== targetName ? targetName.length : 0); addResult( factory.createExportDeclaration( /*modifiers*/ @@ -58664,6 +59492,7 @@ function createTypeChecker(host) { const prevDisableTrackSymbol = context.tracker.disableTrackSymbol; context.tracker.disableTrackSymbol = true; if (isExportAssignmentCompatibleSymbolName) { + context.approximateLength += 10; results.push(factory.createExportAssignment( /*modifiers*/ void 0, @@ -58677,6 +59506,7 @@ function createTypeChecker(host) { serializeExportSpecifier(name, getInternalSymbolName(target, symbolName(target))); } else { const varName = getUnusedName(name, symbol); + context.approximateLength += varName.length + 10; addResult( factory.createImportEqualsDeclaration( /*modifiers*/ @@ -58705,7 +59535,8 @@ function createTypeChecker(host) { if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */); } else { - const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */; + const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 268 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */; + context.approximateLength += varName.length + 5; const statement = factory.createVariableStatement( /*modifiers*/ void 0, @@ -58730,6 +59561,7 @@ function createTypeChecker(host) { ); } if (isExportAssignmentCompatibleSymbolName) { + context.approximateLength += varName.length + 10; results.push(factory.createExportAssignment( /*modifiers*/ void 0, @@ -58764,7 +59596,7 @@ function createTypeChecker(host) { return function serializePropertySymbol(p, isStatic2, baseType) { var _a2, _b, _c, _d, _e, _f; const modifierFlags = getDeclarationModifierFlagsFromSymbol(p); - const isPrivate = !!(modifierFlags & 2 /* Private */); + const omitType = !!(modifierFlags & 2 /* Private */) && !isExpanding(context); if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) { return []; } @@ -58778,7 +59610,7 @@ function createTypeChecker(host) { const result = []; if (p.flags & 65536 /* SetAccessor */) { const setter = p.declarations && forEach(p.declarations, (d) => { - if (d.kind === 178 /* SetAccessor */) { + if (d.kind === 179 /* SetAccessor */) { return d; } if (isCallExpression(d) && isBindableObjectDefinePropertyCall(d)) { @@ -58793,6 +59625,7 @@ function createTypeChecker(host) { Debug.assert(!!setter); const paramSymbol = isFunctionLikeDeclaration(setter) ? getSignatureFromDeclaration(setter).parameters[0] : void 0; const setterDeclaration = (_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor); + context.approximateLength += modifiersLength(flag) + 7 + (paramSymbol ? symbolName(paramSymbol).length : 5) + (omitType ? 0 : 2); result.push(setTextRange2( context, factory.createSetAccessorDeclaration( @@ -58806,7 +59639,7 @@ function createTypeChecker(host) { paramSymbol ? parameterToParameterDeclarationName(paramSymbol, getEffectiveParameterDeclaration(paramSymbol), context) : "value", /*questionToken*/ void 0, - isPrivate ? void 0 : serializeTypeForDeclaration(context, setterDeclaration, getWriteTypeOfSymbol(p), p) + omitType ? void 0 : serializeTypeForDeclaration(context, setterDeclaration, getWriteTypeOfSymbol(p), p) )], /*body*/ void 0 @@ -58815,15 +59648,15 @@ function createTypeChecker(host) { )); } if (p.flags & 32768 /* GetAccessor */) { - const isPrivate2 = modifierFlags & 2 /* Private */; const getterDeclaration = (_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor); + context.approximateLength += modifiersLength(flag) + 8 + (omitType ? 0 : 2); result.push(setTextRange2( context, factory.createGetAccessorDeclaration( factory.createModifiersFromModifierFlags(flag), name, [], - isPrivate2 ? void 0 : serializeTypeForDeclaration(context, getterDeclaration, getTypeOfSymbol(p), p), + omitType ? void 0 : serializeTypeForDeclaration(context, getterDeclaration, getTypeOfSymbol(p), p), /*body*/ void 0 ), @@ -58832,13 +59665,15 @@ function createTypeChecker(host) { } return result; } else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + const modifierFlags2 = (isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag; + context.approximateLength += 2 + (omitType ? 0 : 2) + modifiersLength(modifierFlags2); return setTextRange2( context, createProperty2( - factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag), + factory.createModifiersFromModifierFlags(modifierFlags2), name, p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - isPrivate ? void 0 : serializeTypeForDeclaration(context, (_d = p.declarations) == null ? void 0 : _d.find(isSetAccessorDeclaration), getWriteTypeOfSymbol(p), p), + omitType ? void 0 : serializeTypeForDeclaration(context, (_d = p.declarations) == null ? void 0 : _d.find(isSetAccessorDeclaration), getWriteTypeOfSymbol(p), p), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 // interface members can't have initializers, however class members _can_ /*initializer*/ @@ -58850,11 +59685,13 @@ function createTypeChecker(host) { if (p.flags & (8192 /* Method */ | 16 /* Function */)) { const type = getTypeOfSymbol(p); const signatures = getSignaturesOfType(type, 0 /* Call */); - if (flag & 2 /* Private */) { + if (omitType) { + const modifierFlags2 = (isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag; + context.approximateLength += 1 + modifiersLength(modifierFlags2); return setTextRange2( context, createProperty2( - factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag), + factory.createModifiersFromModifierFlags(modifierFlags2), name, p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, /*type*/ @@ -58867,6 +59704,7 @@ function createTypeChecker(host) { } const results2 = []; for (const sig of signatures) { + context.approximateLength += 1; const decl = signatureToSignatureDeclarationHelper( sig, methodKind, @@ -58885,6 +59723,25 @@ function createTypeChecker(host) { return Debug.fail(`Unhandled class member kind! ${p.__debugFlags || p.flags}`); }; } + function modifiersLength(flags) { + let result = 0; + if (flags & 32 /* Export */) result += 7; + if (flags & 128 /* Ambient */) result += 8; + if (flags & 2048 /* Default */) result += 8; + if (flags & 4096 /* Const */) result += 6; + if (flags & 1 /* Public */) result += 7; + if (flags & 2 /* Private */) result += 8; + if (flags & 4 /* Protected */) result += 10; + if (flags & 64 /* Abstract */) result += 9; + if (flags & 256 /* Static */) result += 7; + if (flags & 16 /* Override */) result += 9; + if (flags & 8 /* Readonly */) result += 9; + if (flags & 512 /* Accessor */) result += 9; + if (flags & 1024 /* Async */) result += 6; + if (flags & 8192 /* In */) result += 3; + if (flags & 16384 /* Out */) result += 4; + return result; + } function serializePropertySymbolForInterface(p, baseType) { return serializePropertySymbolForInterfaceWorker( p, @@ -58949,6 +59806,7 @@ function createTypeChecker(host) { } const results2 = []; for (const sig of signatures) { + context.approximateLength += 1; const decl = signatureToSignatureDeclarationHelper(sig, outputKind, context); results2.push(setTextRange2(context, decl, sig.declaration)); } @@ -59074,6 +59932,23 @@ function createTypeChecker(host) { return localName; } } + function isExpanding(context) { + return context.maxExpansionDepth !== -1; + } + function isHashPrivate(s) { + return !!s.valueDeclaration && isNamedDeclaration(s.valueDeclaration) && isPrivateIdentifier(s.valueDeclaration.name); + } + function getClonedHashPrivateName(s) { + if (s.valueDeclaration && isNamedDeclaration(s.valueDeclaration) && isPrivateIdentifier(s.valueDeclaration.name)) { + return factory.cloneNode(s.valueDeclaration.name); + } + return void 0; + } + } + function isLibType(type) { + var _a; + const symbol = (getObjectFlags(type) & 4 /* Reference */) !== 0 ? type.target.symbol : type.symbol; + return isTupleType(type) || !!((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.some((decl) => host.isSourceFileDefaultLibrary(getSourceFileOfNode(decl)))); } function typePredicateToString(typePredicate, enclosingDeclaration, flags = 16384 /* UseAliasDefinedOutsideCurrentScope */, writer) { return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker); @@ -59092,14 +59967,14 @@ function createTypeChecker(host) { return writer2; } } - function formatUnionTypes(types) { + function formatUnionTypes(types, expandingEnum) { const result = []; let flags = 0; for (let i = 0; i < types.length; i++) { const t = types[i]; flags |= t.flags; if (!(t.flags & 98304 /* Nullable */)) { - if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) { + if (t.flags & 512 /* BooleanLiteral */ || !expandingEnum && t.flags | 1056 /* EnumLike */) { const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t); if (baseType.flags & 1048576 /* Union */) { const count = baseType.types.length; @@ -59136,10 +60011,10 @@ function createTypeChecker(host) { return void 0; } function isTopLevelInExternalModuleAugmentation(node) { - return node && node.parent && node.parent.kind === 268 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); + return node && node.parent && node.parent.kind === 269 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 307 /* SourceFile */ || isAmbientModule(location); + return location.kind === 308 /* SourceFile */ || isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { const nameType = getSymbolLinks(symbol).nameType; @@ -59191,17 +60066,17 @@ function createTypeChecker(host) { if (!declaration) { declaration = symbol.declarations[0]; } - if (declaration.parent && declaration.parent.kind === 260 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) { return declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 231 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } const name = getNameOfSymbolFromNameType(symbol, context); @@ -59218,75 +60093,75 @@ function createTypeChecker(host) { return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: - case 340 /* JSDocEnumTag */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 341 /* JSDocEnumTag */: return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent)); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: if (isBindingPattern(node.name) && !node.name.elements.length) { return false; } // falls through - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 262 /* FunctionDeclaration */: - case 266 /* EnumDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 263 /* FunctionDeclaration */: + case 267 /* EnumDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (isExternalModuleAugmentation(node)) { return true; } const parent2 = getDeclarationContainer(node); - if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent2.kind !== 307 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) { + if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 272 /* ImportEqualsDeclaration */ && parent2.kind !== 308 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) { return isGlobalSourceFile(parent2); } return isDeclarationVisible(parent2); - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) { return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 176 /* Constructor */: - case 180 /* ConstructSignature */: - case 179 /* CallSignature */: - case 181 /* IndexSignature */: - case 169 /* Parameter */: - case 268 /* ModuleBlock */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 187 /* TypeLiteral */: - case 183 /* TypeReference */: - case 188 /* ArrayType */: - case 189 /* TupleType */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 196 /* ParenthesizedType */: - case 202 /* NamedTupleMember */: + case 177 /* Constructor */: + case 181 /* ConstructSignature */: + case 180 /* CallSignature */: + case 182 /* IndexSignature */: + case 170 /* Parameter */: + case 269 /* ModuleBlock */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 188 /* TypeLiteral */: + case 184 /* TypeReference */: + case 189 /* ArrayType */: + case 190 /* TupleType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 197 /* ParenthesizedType */: + case 203 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: - case 276 /* ImportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: + case 277 /* ImportSpecifier */: return false; // Type parameters are always visible - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 307 /* SourceFile */: - case 270 /* NamespaceExportDeclaration */: + case 308 /* SourceFile */: + case 271 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return false; default: return false; @@ -59295,7 +60170,7 @@ function createTypeChecker(host) { } function collectLinkedAliases(node, setVisibility) { let exportSymbol; - if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 277 /* ExportAssignment */) { + if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 278 /* ExportAssignment */) { exportSymbol = resolveName( node, node, @@ -59305,7 +60180,7 @@ function createTypeChecker(host) { /*isUse*/ false ); - } else if (node.parent.kind === 281 /* ExportSpecifier */) { + } else if (node.parent.kind === 282 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } let result; @@ -59405,12 +60280,12 @@ function createTypeChecker(host) { function getDeclarationContainer(node) { return findAncestor(getRootDeclaration(node), (node2) => { switch (node2.kind) { - case 260 /* VariableDeclaration */: - case 261 /* VariableDeclarationList */: - case 276 /* ImportSpecifier */: - case 275 /* NamedImports */: - case 274 /* NamespaceImport */: - case 273 /* ImportClause */: + case 261 /* VariableDeclaration */: + case 262 /* VariableDeclarationList */: + case 277 /* ImportSpecifier */: + case 276 /* NamedImports */: + case 275 /* NamespaceImport */: + case 274 /* ImportClause */: return false; default: return true; @@ -59535,23 +60410,23 @@ function createTypeChecker(host) { function getParentElementAccess(node) { const ancestor = node.parent.parent; switch (ancestor.kind) { - case 208 /* BindingElement */: - case 303 /* PropertyAssignment */: + case 209 /* BindingElement */: + case 304 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return ancestor.initializer; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { const parent2 = node.parent; - if (node.kind === 208 /* BindingElement */ && parent2.kind === 206 /* ObjectBindingPattern */) { + if (node.kind === 209 /* BindingElement */ && parent2.kind === 207 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 303 /* PropertyAssignment */ || node.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.kind === 304 /* PropertyAssignment */ || node.kind === 305 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent2.elements.indexOf(node); @@ -59582,7 +60457,7 @@ function createTypeChecker(host) { } const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* AllowMissing */ : 0); let type; - if (pattern.kind === 206 /* ObjectBindingPattern */) { + if (pattern.kind === 207 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -59645,13 +60520,13 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 210 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, isProperty = false, isOptional = true) { return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) { - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 249 /* ForInStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForInStatement */) { const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression( declaration.parent.parent.expression, /*checkMode*/ @@ -59659,7 +60534,7 @@ function createTypeChecker(host) { ))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForOfStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) { const forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement) || anyType; } @@ -59691,8 +60566,8 @@ function createTypeChecker(host) { return; } const func = declaration.parent; - if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) { - const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 177 /* GetAccessor */); + if (func.kind === 179 /* SetAccessor */ && hasBindableName(func)) { + const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 178 /* GetAccessor */); if (getter) { const getterSignature = getSignatureFromDeclaration(getter); const thisParameter = getAccessorThisParameter(func); @@ -59765,7 +60640,7 @@ function createTypeChecker(host) { const links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === void 0) { links.isConstructorDeclaredProperty = false; - links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( + links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 213 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( /*declaredType*/ void 0, declaration, @@ -59793,7 +60668,7 @@ function createTypeChecker(host) { /*includeClassComputedPropertyName*/ false ); - if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 177 /* Constructor */ || isJSConstructor(container))) { return container; } } @@ -60076,7 +60951,7 @@ function createTypeChecker(host) { /*includeClassComputedPropertyName*/ false ); - return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 262 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); + return thisContainer.kind === 177 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 219 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { Debug.assert(types.length === declarations.length); @@ -60149,7 +61024,7 @@ function createTypeChecker(host) { function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) { const elements = pattern.elements; const lastElement = lastOrUndefined(elements); - const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; + const restElement = lastElement && lastElement.kind === 209 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -60166,7 +61041,7 @@ function createTypeChecker(host) { } function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) { if (includePatternInType) contextualBindingPatterns.push(pattern); - const result = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); + const result = pattern.kind === 207 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); if (includePatternInType) contextualBindingPatterns.pop(); return result; } @@ -60212,7 +61087,7 @@ function createTypeChecker(host) { if (reportErrors2) { reportErrorsFromWidening(declaration, type); } - if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) { + if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !tryGetTypeFromEffectiveTypeNode(declaration)) && type.symbol !== getSymbolOfDeclaration(declaration)) { type = esSymbolType; } return getWidenedType(type); @@ -60227,7 +61102,7 @@ function createTypeChecker(host) { } function declarationBelongsToPrivateAmbientMember(declaration) { const root = getRootDeclaration(declaration); - const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root; + const memberDeclaration = root.kind === 170 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(node) { @@ -60298,7 +61173,7 @@ function createTypeChecker(host) { return reportCircularityError(symbol); } let type; - if (declaration.kind === 277 /* ExportAssignment */) { + if (declaration.kind === 278 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration); } else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) { type = getWidenedTypeForAssignmentDeclaration(symbol); @@ -60339,13 +61214,13 @@ function createTypeChecker(host) { function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { switch (accessor.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor); return setterTypeAnnotation; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: Debug.assert(hasAccessorModifier(accessor)); const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor); return accessorTypeAnnotation; @@ -60370,9 +61245,9 @@ function createTypeChecker(host) { if (!pushTypeResolution(symbol, 0 /* Type */)) { return errorType; } - const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */); - const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); + const getter = getDeclarationOfKind(symbol, 178 /* GetAccessor */); + const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */); + const accessor = tryCast(getDeclarationOfKind(symbol, 173 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && getWidenedTypeForVariableLikeDeclaration( accessor, /*reportErrors*/ @@ -60410,7 +61285,7 @@ function createTypeChecker(host) { if (!pushTypeResolution(symbol, 7 /* WriteType */)) { return errorType; } - const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); + const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 173 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); let writeType = getAnnotatedAccessorType(setter); if (!popTypeResolution()) { if (getAnnotatedAccessorTypeNode(setter)) { @@ -60450,7 +61325,7 @@ function createTypeChecker(host) { const declaration = symbol.valueDeclaration; if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) { return anyType; - } else if (declaration && (declaration.kind === 226 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 226 /* BinaryExpression */)) { + } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) { const resolvedModule = resolveExternalModuleSymbol(symbol); @@ -60518,7 +61393,7 @@ function createTypeChecker(host) { error2(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); return errorType; } - if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 170 /* Parameter */ || declaration.initializer)) { error2(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } } else if (symbol.flags & 2097152 /* Alias */) { @@ -60549,11 +61424,14 @@ function createTypeChecker(host) { } function getWriteTypeOfSymbol(symbol) { const checkFlags = getCheckFlags(symbol); - if (symbol.flags & 4 /* Property */) { - return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : ( + if (checkFlags & 2 /* SyntheticProperty */) { + return checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : ( // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty symbol.links.writeType || symbol.links.type - ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */)); + ); + } + if (symbol.flags & 4 /* Property */) { + return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */)); } if (symbol.flags & 98304 /* Accessor */) { return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol); @@ -60646,49 +61524,49 @@ function createTypeChecker(host) { } const kind = node.kind; switch (kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 317 /* JSDocFunctionType */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 265 /* TypeAliasDeclaration */: - case 345 /* JSDocTemplateTag */: - case 346 /* JSDocTypedefTag */: - case 340 /* JSDocEnumTag */: - case 338 /* JSDocCallbackTag */: - case 200 /* MappedType */: - case 194 /* ConditionalType */: { + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 318 /* JSDocFunctionType */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 266 /* TypeAliasDeclaration */: + case 346 /* JSDocTemplateTag */: + case 347 /* JSDocTypedefTag */: + case 341 /* JSDocEnumTag */: + case 339 /* JSDocCallbackTag */: + case 201 /* MappedType */: + case 195 /* ConditionalType */: { const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if ((kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || isObjectLiteralMethod(node)) && isContextSensitive(node)) { + if ((kind === 219 /* FunctionExpression */ || kind === 220 /* ArrowFunction */ || isObjectLiteralMethod(node)) && isContextSensitive(node)) { const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(node)), 0 /* Call */)); if (signature && signature.typeParameters) { return [...outerTypeParameters || emptyArray, ...signature.typeParameters]; } } - if (kind === 200 /* MappedType */) { + if (kind === 201 /* MappedType */) { return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))); - } else if (kind === 194 /* ConditionalType */) { + } else if (kind === 195 /* ConditionalType */) { return concatenate(outerTypeParameters, getInferTypeParameters(node)); } const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node)); - const thisType = includeThisTypes && (kind === 263 /* ClassDeclaration */ || kind === 231 /* ClassExpression */ || kind === 264 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; + const thisType = includeThisTypes && (kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 265 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: const paramSymbol = getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; } break; - case 320 /* JSDoc */: { + case 321 /* JSDoc */: { const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters; } @@ -60698,14 +61576,14 @@ function createTypeChecker(host) { function getOuterTypeParametersOfClassOrInterface(symbol) { var _a; const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a = symbol.declarations) == null ? void 0 : _a.find((decl) => { - if (decl.kind === 264 /* InterfaceDeclaration */) { + if (decl.kind === 265 /* InterfaceDeclaration */) { return true; } - if (decl.kind !== 260 /* VariableDeclaration */) { + if (decl.kind !== 261 /* VariableDeclaration */) { return false; } const initializer = decl.initializer; - return !!initializer && (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 219 /* ArrowFunction */); + return !!initializer && (initializer.kind === 219 /* FunctionExpression */ || initializer.kind === 220 /* ArrowFunction */); }); Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); @@ -60716,7 +61594,7 @@ function createTypeChecker(host) { } let result; for (const node of symbol.declarations) { - if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { + if (node.kind === 265 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { const declaration = node; result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration)); } @@ -60850,7 +61728,7 @@ function createTypeChecker(host) { } if (!popTypeResolution() && type.symbol.declarations) { for (const declaration of type.symbol.declarations) { - if (declaration.kind === 263 /* ClassDeclaration */ || declaration.kind === 264 /* InterfaceDeclaration */) { + if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 265 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -60935,7 +61813,7 @@ function createTypeChecker(host) { type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; if (type.symbol.declarations) { for (const declaration of type.symbol.declarations) { - if (declaration.kind === 264 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 265 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { for (const node of getInterfaceBaseTypeNodes(declaration)) { const baseType = getReducedType(getTypeFromTypeNode(node)); if (!isErrorType(baseType)) { @@ -60963,7 +61841,7 @@ function createTypeChecker(host) { return true; } for (const declaration of symbol.declarations) { - if (declaration.kind === 264 /* InterfaceDeclaration */) { + if (declaration.kind === 265 /* InterfaceDeclaration */) { if (declaration.flags & 256 /* ContainsThis */) { return false; } @@ -61038,7 +61916,7 @@ function createTypeChecker(host) { } } else { type = errorType; - if (declaration.kind === 340 /* JSDocEnumTag */) { + if (declaration.kind === 341 /* JSDocEnumTag */) { error2(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } else { error2(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); @@ -61057,7 +61935,7 @@ function createTypeChecker(host) { const memberTypeList = []; if (symbol.declarations) { for (const declaration of symbol.declarations) { - if (declaration.kind === 266 /* EnumDeclaration */) { + if (declaration.kind === 267 /* EnumDeclaration */) { for (const member of declaration.members) { if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); @@ -61151,11 +62029,11 @@ function createTypeChecker(host) { case 116 /* VoidKeyword */: case 157 /* UndefinedKeyword */: case 146 /* NeverKeyword */: - case 201 /* LiteralType */: + case 202 /* LiteralType */: return true; - case 188 /* ArrayType */: + case 189 /* ArrayType */: return isThislessType(node.elementType); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -61171,21 +62049,21 @@ function createTypeChecker(host) { function isThislessFunctionLikeDeclaration(node) { const returnType = getEffectiveReturnTypeNode(node); const typeParameters = getEffectiveTypeParameterDeclarations(node); - return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); + return (node.kind === 177 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } function isThisless(symbol) { if (symbol.declarations && symbol.declarations.length === 1) { const declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -61271,9 +62149,7 @@ function createTypeChecker(host) { symbol.declarations.push(member); } if (symbolFlags & 111551 /* Value */) { - if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) { - symbol.valueDeclaration = member; - } + setValueDeclaration(symbol, member); } } function lateBindMember(parent2, earlySymbols, lateSymbols, decl) { @@ -62237,7 +63113,7 @@ function createTypeChecker(host) { } function isMappedTypeWithKeyofConstraintDeclaration(type) { const constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; + return constraintDeclaration.kind === 199 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -62711,6 +63587,7 @@ function createTypeChecker(host) { } function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) { var _a, _b, _c; + let propFlags = 0 /* None */; let singleProp; let propSet; let indexTypes; @@ -62735,6 +63612,7 @@ function createTypeChecker(host) { } if (!singleProp) { singleProp = prop; + propFlags = prop.flags & 98304 /* Accessor */ || 4 /* Property */; } else if (prop !== singleProp) { const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp); if (isInstantiation && compareProperties2(singleProp, prop, (a, b) => a === b ? -1 /* True */ : 0 /* False */) === -1 /* True */) { @@ -62749,6 +63627,9 @@ function createTypeChecker(host) { propSet.set(id, prop); } } + if (propFlags & 98304 /* Accessor */ && (prop.flags & 98304 /* Accessor */) !== (propFlags & 98304 /* Accessor */)) { + propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */; + } } if (isUnion && isReadonlySymbol(prop)) { checkFlags |= 8 /* Readonly */; @@ -62762,6 +63643,7 @@ function createTypeChecker(host) { } else if (isUnion) { const indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name); if (indexInfo) { + propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */; checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0); indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type); } else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) { @@ -62825,7 +63707,7 @@ function createTypeChecker(host) { propTypes.push(type); } addRange(propTypes, indexTypes); - const result = createSymbol(4 /* Property */ | (optionalFlag ?? 0), name, syntheticFlag | checkFlags); + const result = createSymbol(propFlags | (optionalFlag ?? 0), name, syntheticFlag | checkFlags); result.links.containingType = containingType; if (!hasNonUniformValueDeclaration && firstValueDeclaration) { result.valueDeclaration = firstValueDeclaration; @@ -63182,7 +64064,7 @@ function createTypeChecker(host) { let hasThisParameter2 = false; const iife = getImmediatelyInvokedFunctionExpression(declaration); const isJSConstructSignature = isJSDocConstructSignature(declaration); - const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration); + const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !some(declaration.parameters, (p) => !!getJSDocType(p)) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration); if (isUntypedSignatureInJSFile) { flags |= 32 /* IsUntypedSignatureInJSFile */; } @@ -63212,7 +64094,7 @@ function createTypeChecker(host) { } else { parameters.push(paramSymbol); } - if (type && type.kind === 201 /* LiteralType */) { + if (type && type.kind === 202 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } const isOptionalParameter2 = hasEffectiveQuestionToken(param) || isParameter(param) && param.initializer || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type; @@ -63220,8 +64102,8 @@ function createTypeChecker(host) { minArgumentCount = parameters.length; } } - if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { - const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */; + if ((declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { + const otherKind = declaration.kind === 178 /* GetAccessor */ ? 179 /* SetAccessor */ : 178 /* GetAccessor */; const other = getDeclarationOfKind(getSymbolOfDeclaration(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); @@ -63306,15 +64188,15 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol; - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + return node.name.kind === 168 /* ComputedPropertyName */ && traverse(node.name); + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return traverse(node.expression); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return traverse(node.initializer); default: return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse); @@ -63400,7 +64282,7 @@ function createTypeChecker(host) { function createTypePredicateFromTypePredicateNode(node, signature) { const parameterName = node.parameterName; const type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 197 /* ThisType */ ? createTypePredicate( + return parameterName.kind === 198 /* ThisType */ ? createTypePredicate( node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ void 0, @@ -63445,7 +64327,7 @@ function createTypeChecker(host) { return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 176 /* Constructor */) { + if (declaration.kind === 177 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } const typeNode = getEffectiveReturnTypeNode(declaration); @@ -63461,12 +64343,12 @@ function createTypeChecker(host) { if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) { + if (declaration.kind === 178 /* GetAccessor */ && hasBindableName(declaration)) { const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 178 /* SetAccessor */); + const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 179 /* SetAccessor */); const setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -63495,8 +64377,10 @@ function createTypeChecker(host) { if (returnSignature) { const newReturnSignature = cloneSignature(returnSignature); newReturnSignature.typeParameters = inferredTypeParameters; + const newReturnType = getOrCreateTypeFromSignature(newReturnSignature); + newReturnType.mapper = instantiatedSignature.mapper; const newInstantiatedSignature = cloneSignature(instantiatedSignature); - newInstantiatedSignature.resolvedReturnType = getOrCreateTypeFromSignature(newReturnSignature); + newInstantiatedSignature.resolvedReturnType = newReturnType; return newInstantiatedSignature; } } @@ -63546,12 +64430,6 @@ function createTypeChecker(host) { isInJSFile(signature.declaration) ); } - function getImplementationSignature(signature) { - return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature; - } - function createImplementationSignature(signature) { - return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature; - } function getBaseSignature(signature) { const typeParameters = signature.typeParameters; if (typeParameters) { @@ -63574,22 +64452,12 @@ function createTypeChecker(host) { } return signature; } - function getOrCreateTypeFromSignature(signature, outerTypeParameters) { - var _a; + function getOrCreateTypeFromSignature(signature) { + var _a, _b; if (!signature.isolatedSignatureType) { const kind = (_a = signature.declaration) == null ? void 0 : _a.kind; - const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */; - const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */)); - if (signature.declaration && !nodeIsSynthesized(signature.declaration)) { - type.symbol.declarations = [signature.declaration]; - type.symbol.valueDeclaration = signature.declaration; - } - outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters( - signature.declaration, - /*includeThisTypes*/ - true - )); - type.outerTypeParameters = outerTypeParameters; + const isConstructor = kind === void 0 || kind === 177 /* Constructor */ || kind === 181 /* ConstructSignature */ || kind === 186 /* ConstructorType */; + const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, (_b = signature.declaration) == null ? void 0 : _b.symbol); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -63680,9 +64548,9 @@ function createTypeChecker(host) { let inferences; if ((_a = typeParameter.symbol) == null ? void 0 : _a.declarations) { for (const declaration of typeParameter.symbol.declarations) { - if (declaration.parent.kind === 195 /* InferType */) { + if (declaration.parent.kind === 196 /* InferType */) { const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); - if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) { + if (grandParent.kind === 184 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { @@ -63703,13 +64571,13 @@ function createTypeChecker(host) { } } } - } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + } else if (grandParent.kind === 170 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 192 /* RestType */ || grandParent.kind === 203 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = append(inferences, createArrayType(unknownType)); - } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) { + } else if (grandParent.kind === 205 /* TemplateLiteralTypeSpan */) { inferences = append(inferences, stringType); - } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) { + } else if (grandParent.kind === 169 /* TypeParameter */ && grandParent.parent.kind === 201 /* MappedType */) { inferences = append(inferences, stringNumberSymbolType); - } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) { + } else if (grandParent.kind === 201 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 195 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 201 /* MappedType */ && grandParent.parent.checkType.type) { const checkMappedType2 = grandParent.parent.checkType; const nodeType = getTypeFromTypeNode(checkMappedType2.type); inferences = append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : stringNumberSymbolType))); @@ -63731,7 +64599,7 @@ function createTypeChecker(host) { } else { let type = getTypeFromTypeNode(constraintDeclaration); if (type.flags & 1 /* Any */ && !isErrorType(type)) { - type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? stringNumberSymbolType : unknownType; + type = constraintDeclaration.parent.parent.kind === 201 /* MappedType */ ? stringNumberSymbolType : unknownType; } typeParameter.constraint = type; } @@ -63740,7 +64608,7 @@ function createTypeChecker(host) { return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */); + const tp = getDeclarationOfKind(typeParameter.symbol, 169 /* TypeParameter */); const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent; return host2 && getSymbolOfNode(host2); } @@ -63825,7 +64693,7 @@ function createTypeChecker(host) { return concatenate(type.target.outerTypeParameters, (_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray; } const node = type.node; - const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); + const typeArguments = !node ? emptyArray : node.kind === 184 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments); } else { @@ -63864,7 +64732,7 @@ function createTypeChecker(host) { return errorType; } } - if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 184 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference( type, node, @@ -63959,9 +64827,9 @@ function createTypeChecker(host) { } function getTypeReferenceName(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return node.typeName; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: const expr = node.expression; if (isEntityNameExpression(expr)) { return expr; @@ -63973,10 +64841,10 @@ function createTypeChecker(host) { return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName; } function getUnresolvedSymbolForEntityName(name) { - const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name; + const identifier = name.kind === 167 /* QualifiedName */ ? name.right : name.kind === 212 /* PropertyAccessExpression */ ? name.name : name; const text = identifier.escapedText; if (text) { - const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; + const parentSymbol = name.kind === 167 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 212 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; const path = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text; let result = unresolvedSymbols.get(path); if (!result) { @@ -64028,7 +64896,7 @@ function createTypeChecker(host) { const valueType = getTypeOfSymbol(symbol); let typeType = valueType; if (symbol.valueDeclaration) { - const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier; + const isImportTypeWithQualifier = node.kind === 206 /* ImportType */ && node.qualifier; if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { typeType = getTypeReferenceType(node, valueType.symbol); } @@ -64065,7 +64933,7 @@ function createTypeChecker(host) { return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]); } function isUnaryTupleTypeNode(node) { - return node.kind === 189 /* TupleType */ && node.elements.length === 1; + return node.kind === 190 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0; @@ -64073,17 +64941,17 @@ function createTypeChecker(host) { function getConditionalFlowTypeOfType(type, node) { let constraints; let covariant = true; - while (node && !isStatement(node) && node.kind !== 320 /* JSDoc */) { + while (node && !isStatement(node) && node.kind !== 321 /* JSDoc */) { const parent2 = node.parent; - if (parent2.kind === 169 /* Parameter */) { + if (parent2.kind === 170 /* Parameter */) { covariant = !covariant; } - if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 194 /* ConditionalType */ && node === parent2.trueType) { + if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 195 /* ConditionalType */ && node === parent2.trueType) { const constraint = getImpliedConstraint(type, parent2.checkType, parent2.extendsType); if (constraint) { constraints = append(constraints, constraint); } - } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && !parent2.nameType && node === parent2.type) { + } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 201 /* MappedType */ && !parent2.nameType && node === parent2.type) { const mappedType = getTypeFromTypeNode(parent2); if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) { const typeParameter = getHomomorphicTypeVariable(mappedType); @@ -64100,7 +64968,7 @@ function createTypeChecker(host) { return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 16777216 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */); + return !!(node.flags & 16777216 /* JSDoc */) && (node.kind === 184 /* TypeReference */ || node.kind === 206 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -64226,9 +65094,9 @@ function createTypeChecker(host) { if (declarations) { for (const declaration of declarations) { switch (declaration.kind) { - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: return declaration; } } @@ -64659,11 +65527,11 @@ function createTypeChecker(host) { } function getTupleElementFlags(node) { switch (node.kind) { - case 190 /* OptionalType */: + case 191 /* OptionalType */: return 2 /* Optional */; - case 191 /* RestType */: + case 192 /* RestType */: return getRestTypeElementFlags(node); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; default: return 1 /* Required */; @@ -64685,51 +65553,51 @@ function createTypeChecker(host) { return isNamedTupleMember(member) || isParameter(member) ? member : void 0; } function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 189 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 190 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); } function isResolvedByTypeAlias(node) { const parent2 = node.parent; switch (parent2.kind) { - case 196 /* ParenthesizedType */: - case 202 /* NamedTupleMember */: - case 183 /* TypeReference */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 199 /* IndexedAccessType */: - case 194 /* ConditionalType */: - case 198 /* TypeOperator */: - case 188 /* ArrayType */: - case 189 /* TupleType */: + case 197 /* ParenthesizedType */: + case 203 /* NamedTupleMember */: + case 184 /* TypeReference */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 200 /* IndexedAccessType */: + case 195 /* ConditionalType */: + case 199 /* TypeOperator */: + case 189 /* ArrayType */: + case 190 /* TupleType */: return isResolvedByTypeAlias(parent2); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return true; } return false; } function mayResolveTypeAlias(node) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return true; - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 196 /* ParenthesizedType */: - case 190 /* OptionalType */: - case 202 /* NamedTupleMember */: - case 316 /* JSDocOptionalType */: - case 314 /* JSDocNullableType */: - case 315 /* JSDocNonNullableType */: - case 309 /* JSDocTypeExpression */: + case 197 /* ParenthesizedType */: + case 191 /* OptionalType */: + case 203 /* NamedTupleMember */: + case 317 /* JSDocOptionalType */: + case 315 /* JSDocNullableType */: + case 316 /* JSDocNonNullableType */: + case 310 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 191 /* RestType */: - return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 192 /* RestType */: + return node.type.kind !== 189 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 193 /* UnionType */: + case 194 /* IntersectionType */: return some(node.types, mayResolveTypeAlias); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } return false; @@ -64740,15 +65608,15 @@ function createTypeChecker(host) { const target = getArrayOrTupleTargetType(node); if (target === emptyGenericType) { links.resolvedType = emptyObjectType; - } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( + } else if (!(node.kind === 190 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 190 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( target, node, /*mapper*/ void 0 ); } else { - const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); + const elementTypes = node.kind === 189 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } @@ -65835,7 +66703,7 @@ function createTypeChecker(host) { return true; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) { - const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0; + const accessExpression = accessNode && accessNode.kind === 213 /* ElementAccessExpression */ ? accessNode : void 0; const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode); if (propName !== void 0) { if (accessFlags & 256 /* Contextual */) { @@ -66032,7 +66900,7 @@ function createTypeChecker(host) { } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode; + return accessNode.kind === 213 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 200 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 168 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isPatternLiteralPlaceholderType(type) { if (type.flags & 2097152 /* Intersection */) { @@ -66193,7 +67061,7 @@ function createTypeChecker(host) { indexType = stringType; } if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */) accessFlags |= 1 /* IncludeUndefined */; - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) { + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 200 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -66759,7 +67627,7 @@ function createTypeChecker(host) { false ); const parent2 = container && container.parent; - if (parent2 && (isClassLike(parent2) || parent2.kind === 264 /* InterfaceDeclaration */)) { + if (parent2 && (isClassLike(parent2) || parent2.kind === 265 /* InterfaceDeclaration */)) { if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(parent2)).thisType; } @@ -66789,17 +67657,17 @@ function createTypeChecker(host) { } function getArrayElementTypeNode(node) { switch (node.kind) { - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 189 /* TupleType */: + case 190 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 192 /* RestType */ || node.kind === 203 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 188 /* ArrayType */: + case 189 /* ArrayType */: return node.elementType; } return void 0; @@ -66819,8 +67687,8 @@ function createTypeChecker(host) { function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 133 /* AnyKeyword */: - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: return anyType; case 159 /* UnknownKeyword */: return unknownType; @@ -66846,69 +67714,69 @@ function createTypeChecker(host) { return node.flags & 524288 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; case 141 /* IntrinsicKeyword */: return intrinsicMarkerType; - case 197 /* ThisType */: + case 198 /* ThisType */: case 110 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 201 /* LiteralType */: + case 202 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return getTypeFromTypeReference(node); - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 188 /* ArrayType */: - case 189 /* TupleType */: + case 189 /* ArrayType */: + case 190 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 190 /* OptionalType */: + case 191 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 192 /* UnionType */: + case 193 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 314 /* JSDocNullableType */: + case 315 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 316 /* JSDocOptionalType */: + case 317 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 196 /* ParenthesizedType */: - case 315 /* JSDocNonNullableType */: - case 309 /* JSDocTypeExpression */: + case 197 /* ParenthesizedType */: + case 316 /* JSDocNonNullableType */: + case 310 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 191 /* RestType */: + case 192 /* RestType */: return getTypeFromRestTypeNode(node); - case 318 /* JSDocVariadicType */: + case 319 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 187 /* TypeLiteral */: - case 322 /* JSDocTypeLiteral */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 188 /* TypeLiteral */: + case 323 /* JSDocTypeLiteral */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 200 /* MappedType */: + case 201 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 195 /* InferType */: + case 196 /* InferType */: return getTypeFromInferTypeNode(node); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: return getTypeFromTemplateTypeNode(node); - case 205 /* ImportType */: + case 206 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 80 /* Identifier */: - case 166 /* QualifiedName */: - case 211 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: const symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -67002,6 +67870,9 @@ function createTypeChecker(host) { const forwardInferences = context.inferences.slice(index); return createTypeMapper(map(forwardInferences, (i) => i.typeParameter), map(forwardInferences, () => unknownType)); } + function createOuterReturnMapper(context) { + return context.outerReturnMapper ?? (context.outerReturnMapper = mergeTypeMappers(context.returnMapper, cloneInferenceContext(context).mapper)); + } function combineTypeMappers(mapper1, mapper2) { return mapper1 ? makeCompositeTypeMapper(4 /* Composite */, mapper1, mapper2) : mapper2; } @@ -67081,7 +67952,7 @@ function createTypeChecker(host) { const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0]; const links = getNodeLinks(declaration); const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type; - let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters; + let typeParameters = links.outerTypeParameters; if (!typeParameters) { let outerTypeParameters = getOuterTypeParameters( declaration, @@ -67102,19 +67973,17 @@ function createTypeChecker(host) { const typeArguments = map(typeParameters, (t) => getMappedType(t, combinedMapper)); const newAliasSymbol = aliasSymbol || type.aliasSymbol; const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper); - const id = (type.objectFlags & 134217728 /* SingleSignatureType */ ? "S" : "") + getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); + const id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); if (!target.instantiations) { target.instantiations = /* @__PURE__ */ new Map(); target.instantiations.set(getTypeListId(typeParameters) + getAliasId(target.aliasSymbol, target.aliasTypeArguments), target); } let result = target.instantiations.get(id); if (!result) { - if (type.objectFlags & 134217728 /* SingleSignatureType */) { - result = instantiateAnonymousType(type, mapper); - target.instantiations.set(id, result); - return result; + let newMapper = createTypeMapper(typeParameters, typeArguments); + if (target.objectFlags & 134217728 /* SingleSignatureType */ && mapper) { + newMapper = combineTypeMappers(newMapper, mapper); } - const newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments); target.instantiations.set(id, result); const resultObjectFlags = getObjectFlags(result); @@ -67134,13 +68003,13 @@ function createTypeChecker(host) { return type; } function maybeTypeParameterReference(node) { - return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.parent.kind === 184 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 206 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { const container = tp.symbol.declarations[0].parent; for (let n = node; n !== container; n = n.parent) { - if (!n || n.kind === 241 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 242 /* Block */ || n.kind === 195 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { return true; } } @@ -67149,18 +68018,18 @@ function createTypeChecker(host) { return true; function containsReference(node2) { switch (node2.kind) { - case 197 /* ThisType */: + case 198 /* ThisType */: return !!tp.isThisType; case 80 /* Identifier */: return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp; // use worker because we're looking for === equality - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: const entityName = node2.exprName; const firstIdentifier = getFirstIdentifier(entityName); if (!isThisIdentifier(firstIdentifier)) { const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier); const tpDeclaration = tp.symbol.declarations[0]; - const tpScope = tpDeclaration.kind === 168 /* TypeParameter */ ? tpDeclaration.parent : ( + const tpScope = tpDeclaration.kind === 169 /* TypeParameter */ ? tpDeclaration.parent : ( // Type parameter is a regular type parameter, e.g. foo tp.isThisType ? tpDeclaration : ( // Type parameter is the this type, and its declaration is the class declaration. @@ -67172,8 +68041,8 @@ function createTypeChecker(host) { } } return true; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type); } return !!forEachChild(node2, containsReference); @@ -67267,9 +68136,6 @@ function createTypeChecker(host) { if (type.objectFlags & 8388608 /* InstantiationExpressionType */) { result.node = type.node; } - if (type.objectFlags & 134217728 /* SingleSignatureType */) { - result.outerTypeParameters = type.outerTypeParameters; - } result.target = type; result.mapper = mapper; result.aliasSymbol = aliasSymbol || type.aliasSymbol; @@ -67314,10 +68180,25 @@ function createTypeChecker(host) { error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } + const index = findActiveMapper(mapper); + if (index === -1) { + pushActiveMapper(mapper); + } + const key = type.id + getAliasId(aliasSymbol, aliasTypeArguments); + const mapperCache = activeTypeMappersCaches[index !== -1 ? index : activeTypeMappersCount - 1]; + const cached = mapperCache.get(key); + if (cached) { + return cached; + } totalInstantiationCount++; instantiationCount++; instantiationDepth++; const result = instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments); + if (index === -1) { + popActiveMapper(); + } else { + mapperCache.set(key, result); + } instantiationDepth--; return result; } @@ -67437,32 +68318,32 @@ function createTypeChecker(host) { return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components); } function isContextSensitive(node) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); switch (node.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return some(node.properties, isContextSensitive); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return some(node.elements, isContextSensitive); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return (node.operatorToken.kind === 57 /* BarBarToken */ || node.operatorToken.kind === 61 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive); - case 291 /* JsxAttribute */: { + case 292 /* JsxAttribute */: { const { initializer } = node; return !!initializer && isContextSensitive(initializer); } - case 294 /* JsxExpression */: { + case 295 /* JsxExpression */: { const { expression } = node; return !!expression && isContextSensitive(expression); } @@ -67476,7 +68357,7 @@ function createTypeChecker(host) { if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) { return false; } - if (node.body.kind !== 241 /* Block */) { + if (node.body.kind !== 242 /* Block */) { return isContextSensitive(node.body); } return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression)); @@ -67569,28 +68450,28 @@ function createTypeChecker(host) { return true; } switch (node.kind) { - case 234 /* AsExpression */: + case 235 /* AsExpression */: if (!isConstAssertion(node)) { break; } // fallthrough - case 294 /* JsxExpression */: - case 217 /* ParenthesizedExpression */: + case 295 /* JsxExpression */: + case 218 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 28 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -67895,16 +68776,16 @@ function createTypeChecker(host) { } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return { errorNode: child, innerExpression: child.expression, nameType }; case 12 /* JsxText */: if (child.containsOnlyTriviaWhiteSpaces) { break; } return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() }; - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 288 /* JsxFragment */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 289 /* JsxFragment */: return { errorNode: child, innerExpression: child, nameType }; default: return Debug.assertNever(child, "Found invalid jsx child"); @@ -68042,13 +68923,13 @@ function createTypeChecker(host) { continue; } switch (prop.kind) { - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: - case 174 /* MethodDeclaration */: - case 304 /* ShorthandPropertyAssignment */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: + case 175 /* MethodDeclaration */: + case 305 /* ShorthandPropertyAssignment */: yield { errorNode: prop.name, innerExpression: void 0, nameType: type }; break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 }; break; default: @@ -68122,7 +69003,7 @@ function createTypeChecker(host) { void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers); } const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */; + const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 175 /* MethodDeclaration */ && kind !== 174 /* MethodSignature */ && kind !== 177 /* Constructor */; let result = -1 /* True */; const sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -68303,8 +69184,8 @@ function createTypeChecker(host) { enumRelation.set(id, 2 /* Failed */); return false; } - const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */)).value; - const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */)).value; + const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 307 /* EnumMember */)).value; + const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 307 /* EnumMember */)).value; if (sourceValue !== targetValue) { const sourceIsString = typeof sourceValue === "string"; const targetIsString = typeof targetValue === "string"; @@ -69635,6 +70516,36 @@ function createTypeChecker(host) { } } } + if (sourceFlags & 134217728 /* TemplateLiteral */) { + if (arrayIsEqualTo(source2.texts, target2.texts)) { + const sourceTypes = source2.types; + const targetTypes = target2.types; + result2 = -1 /* True */; + for (let i = 0; i < sourceTypes.length; i++) { + if (!(result2 &= isRelatedTo( + sourceTypes[i], + targetTypes[i], + 3 /* Both */, + /*reportErrors*/ + false + ))) { + break; + } + } + return result2; + } + } + if (sourceFlags & 268435456 /* StringMapping */) { + if (source2.symbol === target2.symbol) { + return isRelatedTo( + source2.type, + target2.type, + 3 /* Both */, + /*reportErrors*/ + false + ); + } + } if (!(sourceFlags & 524288 /* Object */)) { return 0 /* False */; } @@ -70214,6 +71125,9 @@ function createTypeChecker(host) { false, targetIsOptional ); + if (effectiveTarget.flags & (relation === strictSubtypeRelation ? 1 /* Any */ : 3 /* AnyOrUnknown */)) { + return -1 /* True */; + } const effectiveSource = getTypeOfSourceProperty(sourceProp); return isRelatedTo( effectiveSource, @@ -70556,7 +71470,7 @@ function createTypeChecker(host) { const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); - if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) { + if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 177 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 177 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, /*enclosingDeclaration*/ @@ -70829,10 +71743,12 @@ function createTypeChecker(host) { for (let i = 0; i < types.length; i++) { if (include[i]) { const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName); - if (targetType && someType(getDiscriminatingType(), (t) => !!related(t, targetType))) { - matched = true; - } else { - include[i] = 3 /* Maybe */; + if (targetType) { + if (someType(getDiscriminatingType(), (t) => !!related(t, targetType))) { + matched = true; + } else { + include[i] = 3 /* Maybe */; + } } } } @@ -71215,9 +72131,13 @@ function createTypeChecker(host) { return types[0]; } const primaryTypes = strictNullChecks ? sameMap(types, (t) => filterType(t, (u) => !(u.flags & 98304 /* Nullable */))) : types; - const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : reduceLeft(primaryTypes, (s, t) => isTypeSubtypeOf(s, t) ? t : s); + const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : getSingleCommonSupertype(primaryTypes); return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & 98304 /* Nullable */); } + function getSingleCommonSupertype(types) { + const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s); + return every(types, (t) => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ? candidate : reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s); + } function getCommonSubtype(types) { return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s); } @@ -71253,7 +72173,7 @@ function createTypeChecker(host) { const target = type.target; if (getObjectFlags(target) & 1 /* Class */) { const baseTypeNode = getBaseTypeNodeOfClass(target); - if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) { + if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 212 /* PropertyAccessExpression */) { return void 0; } } @@ -71652,12 +72572,12 @@ function createTypeChecker(host) { } let diagnostic; switch (declaration.kind) { - case 226 /* BinaryExpression */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 227 /* BinaryExpression */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 169 /* Parameter */: + case 170 /* Parameter */: const param = declaration; if (isIdentifier(param.name)) { const originalKeywordKind = identifierToKeywordKind(param.name); @@ -71678,27 +72598,27 @@ function createTypeChecker(host) { } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { return; } break; - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: error2(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 323 /* JSDocSignature */: + case 324 /* JSDocSignature */: if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { error2(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); } return; - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error2(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation, typeAsString); @@ -71709,7 +72629,7 @@ function createTypeChecker(host) { } diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 200 /* MappedType */: + case 201 /* MappedType */: if (noImplicitAny) { error2(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -71848,7 +72768,7 @@ function createTypeChecker(host) { function inferFromIntraExpressionSites(context) { if (context.intraExpressionInferenceSites) { for (const { node, type } of context.intraExpressionInferenceSites) { - const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); + const contextualType = node.kind === 175 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); if (contextualType) { inferTypes(context.inferences, type, contextualType); } @@ -71892,7 +72812,7 @@ function createTypeChecker(host) { if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 1048576 /* CouldContainTypeVariables */); } - const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables)); + const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables)); if (type.flags & 3899393 /* ObjectFlagsType */) { type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0); } @@ -71900,8 +72820,8 @@ function createTypeChecker(host) { } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - const declaration = getDeclarationOfKind(type.aliasSymbol, 265 /* TypeAliasDeclaration */); - return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 307 /* SourceFile */ ? true : n.kind === 267 /* ModuleDeclaration */ ? false : "quit")); + const declaration = getDeclarationOfKind(type.aliasSymbol, 266 /* TypeAliasDeclaration */); + return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 308 /* SourceFile */ ? true : n.kind === 268 /* ModuleDeclaration */ ? false : "quit")); } return false; } @@ -72123,7 +73043,7 @@ function createTypeChecker(host) { value, /*roundTripOnly*/ false - ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target)); + ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target)); } if (source.flags & 134217728 /* TemplateLiteral */) { const texts = source.texts; @@ -72193,9 +73113,6 @@ function createTypeChecker(host) { pos = p; } } - function isTupleOfSelf(typeParameter, type) { - return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1"); - } function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) { let bivariant = false; let propagationType; @@ -72281,9 +73198,6 @@ function createTypeChecker(host) { inference.priority = priority; } if (priority === inference.priority) { - if (isTupleOfSelf(inference.typeParameter, candidate)) { - return; - } if (contravariant && !bivariant) { if (!contains(inference.contraCandidates, candidate)) { inference.contraCandidates = append(inference.contraCandidates, candidate); @@ -72760,7 +73674,7 @@ function createTypeChecker(host) { if (!(source.flags & 64 /* IsNonInferrable */)) { const saveBivariant = bivariant; const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */; + bivariant = bivariant || kind === 175 /* MethodDeclaration */ || kind === 174 /* MethodSignature */ || kind === 177 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes); bivariant = saveBivariant; } @@ -72864,6 +73778,7 @@ function createTypeChecker(host) { inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint; } } + clearActiveMapperCaches(); } return inference.inferredType; } @@ -72921,7 +73836,7 @@ function createTypeChecker(host) { } // falls through default: - if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { return Diagnostics.Cannot_find_name_0; @@ -72956,14 +73871,14 @@ function createTypeChecker(host) { // falls through case 110 /* ThisKeyword */: return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`; - case 235 /* NonNullExpression */: - case 217 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer); return left && `${left}.${node.right.escapedText}`; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const propName = getAccessedPropertyName(node); if (propName !== void 0) { const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -72977,27 +73892,27 @@ function createTypeChecker(host) { } } break; - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: return `${getNodeId(node)}#${getTypeId(declaredType)}`; } return void 0; } function isMatchingReference(source, target) { switch (target.kind) { - case 217 /* ParenthesizedExpression */: - case 235 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source, target.right); } switch (source.kind) { - case 236 /* MetaProperty */: - return target.kind === 236 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; + case 237 /* MetaProperty */: + return target.kind === 237 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; case 80 /* Identifier */: case 81 /* PrivateIdentifier */: return isThisInTypeQuery(source) ? target.kind === 110 /* ThisKeyword */ : target.kind === 80 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (isVariableDeclaration(target) || isBindingElement(target)) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfDeclaration(target); @@ -73005,12 +73920,12 @@ function createTypeChecker(host) { return target.kind === 110 /* ThisKeyword */; case 108 /* SuperKeyword */: return target.kind === 108 /* SuperKeyword */; - case 235 /* NonNullExpression */: - case 217 /* ParenthesizedExpression */: - case 238 /* SatisfiesExpression */: + case 236 /* NonNullExpression */: + case 218 /* ParenthesizedExpression */: + case 239 /* SatisfiesExpression */: return isMatchingReference(source.expression, target); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const sourcePropertyName = getAccessedPropertyName(source); if (sourcePropertyName !== void 0) { const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0; @@ -73025,9 +73940,9 @@ function createTypeChecker(host) { } } break; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isBinaryExpression(source) && source.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source.right, target); } return false; @@ -73178,7 +74093,7 @@ function createTypeChecker(host) { } function getMatchingUnionConstituentForObjectLiteral(unionType, node) { const keyPropertyName = getKeyPropertyName(unionType); - const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 303 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); + const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 304 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer); return propType && getConstituentTypeForKeyType(unionType, propType); } @@ -73193,7 +74108,7 @@ function createTypeChecker(host) { } } } - if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { + if (expression.expression.kind === 212 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { return true; } return false; @@ -73384,11 +74299,11 @@ function createTypeChecker(host) { ) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 303 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + const isDestructuringDefaultAssignment = node.parent.kind === 210 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 304 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent2) { - return parent2.parent.kind === 226 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 250 /* ForOfStatement */ && parent2.parent.initializer === parent2; + return parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 251 /* ForOfStatement */ && parent2.parent.initializer === parent2; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -73405,21 +74320,21 @@ function createTypeChecker(host) { function getAssignedType(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return stringType; - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return checkRightHandSideOfForOf(parent2) || errorType; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent2); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return undefinedType; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent2, node); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent2); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent2); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent2); } return errorType; @@ -73427,7 +74342,7 @@ function createTypeChecker(host) { function getInitialTypeOfBindingElement(node) { const pattern = node.parent; const parentType = getInitialType(pattern.parent); - const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); + const type = pattern.kind === 207 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } function getTypeOfInitializer(node) { @@ -73438,25 +74353,25 @@ function createTypeChecker(host) { if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 249 /* ForInStatement */) { + if (node.parent.parent.kind === 250 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 250 /* ForOfStatement */) { + if (node.parent.parent.kind === 251 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 260 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); + return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 260 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 226 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); + return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 209 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 76 /* BarBarEqualsToken */: @@ -73471,10 +74386,10 @@ function createTypeChecker(host) { } function getReferenceRoot(node) { const { parent: parent2 } = node; - return parent2.kind === 217 /* ParenthesizedExpression */ || parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; + return parent2.kind === 218 /* ParenthesizedExpression */ || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -73490,12 +74405,12 @@ function createTypeChecker(host) { return links.switchTypes; } function getSwitchClauseTypeOfWitnesses(switchStatement) { - if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 296 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { + if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { return void 0; } const witnesses = []; for (const clause of switchStatement.caseBlock.clauses) { - const text = clause.kind === 296 /* CaseClause */ ? clause.expression.text : void 0; + const text = clause.kind === 297 /* CaseClause */ ? clause.expression.text : void 0; witnesses.push(text && !contains(witnesses, text) ? text : void 0); } return witnesses; @@ -73655,8 +74570,8 @@ function createTypeChecker(host) { function isEvolvingArrayOperationTarget(node) { const root = getReferenceRoot(node); const parent2 = root.parent; - const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 213 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); - const isElementAssignment = parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 226 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 64 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */); + const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 214 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); + const isElementAssignment = parent2.kind === 213 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 64 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */); return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(node) { @@ -73679,7 +74594,7 @@ function createTypeChecker(host) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForOfStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) { const statement = declaration.parent.parent; const expressionType = getTypeOfDottedName( statement.expression, @@ -73713,7 +74628,7 @@ function createTypeChecker(host) { return getExplicitThisType(node); case 108 /* SuperKeyword */: return checkSuperExpression(node); - case 211 /* PropertyAccessExpression */: { + case 212 /* PropertyAccessExpression */: { const type = getTypeOfDottedName(node.expression, diagnostic); if (type) { const name = node.name; @@ -73730,7 +74645,7 @@ function createTypeChecker(host) { } return void 0; } - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -73743,7 +74658,7 @@ function createTypeChecker(host) { if (isBinaryExpression(node)) { const rightType = checkNonNullExpression(node.right); funcType = getSymbolHasInstanceMethodOfObjectType(rightType); - } else if (node.parent.kind === 244 /* ExpressionStatement */) { + } else if (node.parent.kind === 245 /* ExpressionStatement */) { funcType = getTypeOfDottedName( node.expression, /*diagnostic*/ @@ -73797,7 +74712,7 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - return node.kind === 97 /* FalseKeyword */ || node.kind === 226 /* BinaryExpression */ && (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); + return node.kind === 97 /* FalseKeyword */ || node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { while (true) { @@ -73925,11 +74840,11 @@ function createTypeChecker(host) { return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol) || !!symbol.valueDeclaration && isFunctionExpression(symbol.valueDeclaration); } break; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: const rootDeclaration = getRootDeclaration(node.parent); return isParameter(rootDeclaration) || isCatchClauseVariableDeclaration(rootDeclaration) ? !isSomeSymbolAssigned(rootDeclaration) : isVariableDeclaration(rootDeclaration) && isVarConstLike2(rootDeclaration); } @@ -73950,7 +74865,7 @@ function createTypeChecker(host) { const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode)); sharedFlowCount = sharedFlowStart; const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -74019,7 +74934,7 @@ function createTypeChecker(host) { target.antecedent = saveAntecedents; } else if (flags & 2 /* Start */) { const container = flow.node; - if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 219 /* ArrowFunction */)) { + if (container && container !== flowContainer && reference.kind !== 212 /* PropertyAccessExpression */ && reference.kind !== 213 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 220 /* ArrowFunction */)) { flow = container.flowNode; continue; } @@ -74039,7 +74954,7 @@ function createTypeChecker(host) { function getInitialOrAssignedType(flow) { const node = flow.node; return getNarrowableTypeForReference( - node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), + node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference ); } @@ -74072,13 +74987,13 @@ function createTypeChecker(host) { } if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConstLike2(node))) { const init = getDeclaredExpandoInitializer(node); - if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) { + if (init && (init.kind === 219 /* FunctionExpression */ || init.kind === 220 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 249 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -74092,7 +75007,7 @@ function createTypeChecker(host) { if (node.kind === 97 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { if (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -74132,13 +75047,13 @@ function createTypeChecker(host) { function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { const node = flow.node; - const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression; + const expr = node.kind === 214 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { const flowType = getTypeAtFlowNode(flow.antecedent); const type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256 /* EvolvingArray */) { let evolvedType2 = type; - if (node.kind === 213 /* CallExpression */) { + if (node.kind === 214 /* CallExpression */) { for (const arg of node.arguments) { evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg); } @@ -74175,7 +75090,7 @@ function createTypeChecker(host) { let type = getTypeFromFlowType(flowType); if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.node); - } else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowTypeBySwitchOnTypeOf(type, flow.node); } else if (expr.kind === 112 /* TrueKeyword */) { type = narrowTypeBySwitchOnTrue(type, flow.node); @@ -74183,7 +75098,7 @@ function createTypeChecker(host) { if (strictNullChecks) { if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.node, (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))); - } else if (expr.kind === 221 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.node, (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined")); } } @@ -74311,7 +75226,7 @@ function createTypeChecker(host) { if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) { if (isIdentifier(expr)) { const symbol = getResolvedSymbol(expr); - const declaration = symbol.valueDeclaration; + const declaration = getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) { return declaration; } @@ -74446,10 +75361,10 @@ function createTypeChecker(host) { const operator = expr.operatorToken.kind; const left = getReferenceCandidate(expr.left); const right = getReferenceCandidate(expr.right); - if (left.kind === 221 /* TypeOfExpression */ && isStringLiteralLike(right)) { + if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) { return narrowTypeByTypeof(type, left, operator, right, assumeTrue); } - if (right.kind === 221 /* TypeOfExpression */ && isStringLiteralLike(left)) { + if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) { return narrowTypeByTypeof(type, right, operator, left, assumeTrue); } if (isMatchingReference(reference, left)) { @@ -74720,7 +75635,7 @@ function createTypeChecker(host) { if (!witnesses) { return type; } - const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */); + const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* DefaultClause */); const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; if (hasDefaultClause) { const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses); @@ -74730,11 +75645,11 @@ function createTypeChecker(host) { return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType)); } function narrowTypeBySwitchOnTrue(type, { switchStatement, clauseStart, clauseEnd }) { - const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */); + const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* DefaultClause */); const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; for (let i = 0; i < clauseStart; i++) { const clause = switchStatement.caseBlock.clauses[i]; - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { type = narrowType( type, clause.expression, @@ -74746,7 +75661,7 @@ function createTypeChecker(host) { if (hasDefaultClause) { for (let i = clauseEnd; i < switchStatement.caseBlock.clauses.length; i++) { const clause = switchStatement.caseBlock.clauses[i]; - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { type = narrowType( type, clause.expression, @@ -74758,7 +75673,7 @@ function createTypeChecker(host) { return type; } const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd); - return getUnionType(map(clauses, (clause) => clause.kind === 296 /* CaseClause */ ? narrowType( + return getUnionType(map(clauses, (clause) => clause.kind === 297 /* CaseClause */ ? narrowType( type, clause.expression, /*assumeTrue*/ @@ -74958,18 +75873,18 @@ function createTypeChecker(host) { // falls through case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 217 /* ParenthesizedExpression */: - case 235 /* NonNullExpression */: - case 238 /* SatisfiesExpression */: + case 218 /* ParenthesizedExpression */: + case 236 /* NonNullExpression */: + case 239 /* SatisfiesExpression */: return narrowType(type, expr.expression, assumeTrue); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: if (expr.operator === 54 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -74996,7 +75911,7 @@ function createTypeChecker(host) { } if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) { const type = removeOptionalTypeMarker( - isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression( + isWriteAccess(location) && location.kind === 212 /* PropertyAccessExpression */ ? checkPropertyAccessExpression( location, /*checkMode*/ void 0, @@ -75015,7 +75930,7 @@ function createTypeChecker(host) { return isRightSideOfAccessExpression(location) && isWriteAccess(location.parent) ? getWriteTypeOfSymbol(symbol) : getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 307 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */); + return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 269 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 173 /* PropertyDeclaration */); } function isSymbolAssignedDefinitely(symbol) { if (symbol.lastAssignmentPos !== void 0) { @@ -75052,7 +75967,7 @@ function createTypeChecker(host) { if (node.kind === 80 /* Identifier */) { return isSymbolAssigned(getSymbolOfDeclaration(node.parent)); } - return some(node.elements, (e) => e.kind !== 232 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name)); + return some(node.elements, (e) => e.kind !== 233 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name)); } function hasParentWithAssignmentsMarked(node) { return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */)); @@ -75079,7 +75994,7 @@ function createTypeChecker(host) { } } return; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: const exportDeclaration = node.parent.parent; const name = node.propertyName || node.name; if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier && name.kind !== 11 /* StringLiteral */) { @@ -75097,9 +76012,9 @@ function createTypeChecker(host) { } } return; - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: return; } if (isTypeNode(node)) { @@ -75111,18 +76026,18 @@ function createTypeChecker(host) { let pos = node.pos; while (node && node.pos > declaration.pos) { switch (node.kind) { - case 243 /* VariableStatement */: - case 244 /* ExpressionStatement */: - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 254 /* WithStatement */: - case 255 /* SwitchStatement */: - case 258 /* TryStatement */: - case 263 /* ClassDeclaration */: + case 244 /* VariableStatement */: + case 245 /* ExpressionStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 255 /* WithStatement */: + case 256 /* SwitchStatement */: + case 259 /* TryStatement */: + case 264 /* ClassDeclaration */: pos = node.end; } node = node.parent; @@ -75137,7 +76052,7 @@ function createTypeChecker(host) { return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration))); } function isMutableLocalVariableDeclaration(declaration) { - return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 243 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent)); + return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 244 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent)); } function parameterInitializerContainsUndefined(declaration) { const links = getNodeLinks(declaration); @@ -75156,12 +76071,12 @@ function createTypeChecker(host) { return links.parameterInitializerContainsUndefined; } function removeOptionalityFromDeclaredType(declaredType, declaration) { - const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration); + const removeUndefined = strictNullChecks && declaration.kind === 170 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration); return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent2 = node.parent; - return parent2.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 166 /* QualifiedName */ || parent2.kind === 213 /* CallExpression */ && parent2.expression === node || parent2.kind === 214 /* NewExpression */ && parent2.expression === node || parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); + return parent2.kind === 212 /* PropertyAccessExpression */ || parent2.kind === 167 /* QualifiedName */ || parent2.kind === 214 /* CallExpression */ && parent2.expression === node || parent2.kind === 215 /* NewExpression */ && parent2.expression === node || parent2.kind === 213 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); } function isGenericTypeWithUnionConstraint(type) { return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */)); @@ -75302,7 +76217,7 @@ function createTypeChecker(host) { const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(location) ? getWidenedType(leftType) : leftType); prop = isPrivateIdentifier(right) ? lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(apparentType, lexicallyScopedSymbol) || void 0 : getPropertyOfType(apparentType, right.escapedText); } - if (!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && location.parent.kind === 306 /* EnumMember */))) { + if (!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && location.parent.kind === 307 /* EnumMember */))) { markAliasReferenced(parentSymbol, location); } return; @@ -75412,7 +76327,7 @@ function createTypeChecker(host) { } checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const constructor = getFirstConstructorWithBody(node); if (constructor) { for (const parameter of constructor.parameters) { @@ -75420,22 +76335,22 @@ function createTypeChecker(host) { } } break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */; + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + const otherKind = node.kind === 178 /* GetAccessor */ ? 179 /* SetAccessor */ : 178 /* GetAccessor */; const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: for (const parameter of node.parameters) { markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node)); break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node)); break; - case 169 /* Parameter */: + case 170 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); const containingSignature = node.parent; for (const parameter of containingSignature.parameters) { @@ -75546,14 +76461,14 @@ function createTypeChecker(host) { if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) { const parent2 = declaration.parent.parent; const rootDeclaration = getRootDeclaration(parent2); - if (rootDeclaration.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 169 /* Parameter */) { + if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) { const links = getNodeLinks(parent2); if (!(links.flags & 4194304 /* InCheckIdentifier */)) { links.flags |= 4194304 /* InCheckIdentifier */; const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */); const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType); links.flags &= ~4194304 /* InCheckIdentifier */; - if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) { + if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) { const pattern = declaration.parent; const narrowedType = getFlowTypeOfReference( pattern, @@ -75603,14 +76518,18 @@ function createTypeChecker(host) { function checkIdentifierCalculateNodeCheckFlags(node, symbol) { if (isThisInTypeQuery(node)) return; if (symbol === argumentsSymbol) { - if (isInPropertyInitializerOrClassStaticBlock(node)) { - error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers); + if (isInPropertyInitializerOrClassStaticBlock( + node, + /*ignoreArrowFunctions*/ + true + )) { + error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks); return; } let container = getContainingFunction(node); if (container) { if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 219 /* ArrowFunction */) { + if (container.kind === 220 /* ArrowFunction */) { error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression); } else if (hasSyntacticModifier(container, 1024 /* Async */)) { error2(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method); @@ -75641,7 +76560,7 @@ function createTypeChecker(host) { /*includeClassComputedPropertyName*/ false ); - while (container.kind !== 307 /* SourceFile */ && container.parent !== declaration) { + while (container.kind !== 308 /* SourceFile */ && container.parent !== declaration) { container = getThisContainer( container, /*includeArrowFunctions*/ @@ -75650,7 +76569,7 @@ function createTypeChecker(host) { false ); } - if (container.kind !== 307 /* SourceFile */) { + if (container.kind !== 308 /* SourceFile */) { getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */; getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */; getNodeLinks(node).flags |= 536870912 /* ConstructorReference */; @@ -75680,7 +76599,7 @@ function createTypeChecker(host) { const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); let declaration = localOrExportSymbol.valueDeclaration; const immediateDeclaration = declaration; - if (declaration && declaration.kind === 208 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) { + if (declaration && declaration.kind === 209 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) { return nonInferrableAnyType; } let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node); @@ -75714,19 +76633,19 @@ function createTypeChecker(host) { return type; } type = getNarrowableTypeForReference(type, node, checkMode); - const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */; + const isParameter2 = getRootDeclaration(declaration).kind === 170 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; const typeIsAutomatic = type === autoType || type === autoArrayType; - const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */; - while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) { + const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 236 /* NonNullExpression */; + while (flowContainer !== declarationContainer && (flowContainer.kind === 219 /* FunctionExpression */ || flowContainer.kind === 220 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) { flowContainer = getControlFlowContainer(flowContainer); } const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol); - const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */; + const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 282 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */; const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type); const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { @@ -75780,7 +76699,7 @@ function createTypeChecker(host) { )); } function checkNestedBlockScopedBinding(node, symbol) { - if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 299 /* CatchClause */) { + if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 300 /* CatchClause */) { return; } const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -75790,7 +76709,7 @@ function createTypeChecker(host) { if (isCaptured) { let capturesBlockScopeBindingInLoopBody = true; if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */); + const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { const part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -75809,7 +76728,7 @@ function createTypeChecker(host) { } } if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */); + const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */; } @@ -75826,13 +76745,13 @@ function createTypeChecker(host) { } function isAssignedInBodyOfForStatement(node, container) { let current = node; - while (current.parent.kind === 217 /* ParenthesizedExpression */) { + while (current.parent.kind === 218 /* ParenthesizedExpression */) { current = current.parent; } let isAssigned = false; if (isAssignmentTarget(current)) { isAssigned = true; - } else if (current.parent.kind === 224 /* PrefixUnaryExpression */ || current.parent.kind === 225 /* PostfixUnaryExpression */) { + } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) { const expr = current.parent; isAssigned = expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; } @@ -75843,7 +76762,7 @@ function createTypeChecker(host) { } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) { + if (container.kind === 173 /* PropertyDeclaration */ || container.kind === 177 /* Constructor */) { const classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -75888,11 +76807,11 @@ function createTypeChecker(host) { ); let capturedByArrowFunction = false; let thisInComputedPropertyName = false; - if (container.kind === 176 /* Constructor */) { + if (container.kind === 177 /* Constructor */) { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } while (true) { - if (container.kind === 219 /* ArrowFunction */) { + if (container.kind === 220 /* ArrowFunction */) { container = getThisContainer( container, /*includeArrowFunctions*/ @@ -75901,7 +76820,7 @@ function createTypeChecker(host) { ); capturedByArrowFunction = true; } - if (container.kind === 167 /* ComputedPropertyName */) { + if (container.kind === 168 /* ComputedPropertyName */) { container = getThisContainer( container, !capturedByArrowFunction, @@ -75918,10 +76837,10 @@ function createTypeChecker(host) { error2(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); } else { switch (container.kind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: error2(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: error2(node, Diagnostics.this_cannot_be_referenced_in_current_location); break; } @@ -76013,13 +76932,13 @@ function createTypeChecker(host) { } } function getClassNameFromPrototypeMethod(container) { - if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { + if (container.kind === 219 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { return container.parent.left.expression.expression; - } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { + } else if (container.kind === 175 /* MethodDeclaration */ && container.parent.kind === 211 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; - } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 303 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { + } else if (container.kind === 219 /* FunctionExpression */ && container.parent.kind === 304 /* PropertyAssignment */ && container.parent.parent.kind === 211 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; - } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { + } else if (container.kind === 219 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { return container.parent.parent.parent.arguments[0].expression; } else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { return container.parent.parent.arguments[0].expression; @@ -76036,10 +76955,10 @@ function createTypeChecker(host) { } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl); + return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 170 /* Parameter */ && n.parent === constructorDecl); } function checkSuperExpression(node) { - const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node; + const isCallExpression2 = node.parent.kind === 214 /* CallExpression */ && node.parent.expression === node; const immediateContainer = getSuperContainer( node, /*stopOnFunctions*/ @@ -76049,7 +76968,7 @@ function createTypeChecker(host) { let needToCaptureLexicalThis = false; let inAsyncFunction = false; if (!isCallExpression2) { - while (container && container.kind === 219 /* ArrowFunction */) { + while (container && container.kind === 220 /* ArrowFunction */) { if (hasSyntacticModifier(container, 1024 /* Async */)) inAsyncFunction = true; container = getSuperContainer( container, @@ -76062,19 +76981,19 @@ function createTypeChecker(host) { } let nodeCheckFlag = 0; if (!container || !isLegalUsageOfSuperExpression(container)) { - const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */); - if (current && current.kind === 167 /* ComputedPropertyName */) { + const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 168 /* ComputedPropertyName */); + if (current && current.kind === 168 /* ComputedPropertyName */) { error2(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression2) { error2(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); - } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) { + } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 211 /* ObjectLiteralExpression */)) { error2(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { error2(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return errorType; } - if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) { + if (!isCallExpression2 && immediateContainer.kind === 177 /* Constructor */) { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (isStatic(container) || isCallExpression2) { @@ -76090,7 +77009,7 @@ function createTypeChecker(host) { nodeCheckFlag = 16 /* SuperInstance */; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) { + if (container.kind === 175 /* MethodDeclaration */ && inAsyncFunction) { if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */; } else { @@ -76100,7 +77019,7 @@ function createTypeChecker(host) { if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 210 /* ObjectLiteralExpression */) { + if (container.parent.kind === 211 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error2(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -76121,20 +77040,20 @@ function createTypeChecker(host) { if (!baseClassType) { return errorType; } - if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 177 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error2(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; } return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType); function isLegalUsageOfSuperExpression(container2) { if (isCallExpression2) { - return container2.kind === 176 /* Constructor */; + return container2.kind === 177 /* Constructor */; } else { - if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) { + if (isClassLike(container2.parent) || container2.parent.kind === 211 /* ObjectLiteralExpression */) { if (isStatic(container2)) { - return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */; + return container2.kind === 175 /* MethodDeclaration */ || container2.kind === 174 /* MethodSignature */ || container2.kind === 178 /* GetAccessor */ || container2.kind === 179 /* SetAccessor */ || container2.kind === 173 /* PropertyDeclaration */ || container2.kind === 176 /* ClassStaticBlockDeclaration */; } else { - return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 176 /* Constructor */; + return container2.kind === 175 /* MethodDeclaration */ || container2.kind === 174 /* MethodSignature */ || container2.kind === 178 /* GetAccessor */ || container2.kind === 179 /* SetAccessor */ || container2.kind === 173 /* PropertyDeclaration */ || container2.kind === 172 /* PropertySignature */ || container2.kind === 177 /* Constructor */; } } } @@ -76142,7 +77061,7 @@ function createTypeChecker(host) { } } function getContainingObjectLiteral(func) { - return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 303 /* PropertyAssignment */ ? func.parent.parent : void 0; + return (func.kind === 175 /* MethodDeclaration */ || func.kind === 178 /* GetAccessor */ || func.kind === 179 /* SetAccessor */) && func.parent.kind === 211 /* ObjectLiteralExpression */ ? func.parent : func.kind === 219 /* FunctionExpression */ && func.parent.kind === 304 /* PropertyAssignment */ ? func.parent.parent : void 0; } function getThisTypeArgument(type) { return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0; @@ -76160,7 +77079,7 @@ function createTypeChecker(host) { if (thisType) { return thisType; } - if (literal.parent.kind !== 303 /* PropertyAssignment */) { + if (literal.parent.kind !== 304 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -76172,7 +77091,7 @@ function createTypeChecker(host) { } } function getContextualThisParameterType(func) { - if (func.kind === 219 /* ArrowFunction */) { + if (func.kind === 220 /* ArrowFunction */) { return void 0; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -76255,11 +77174,11 @@ function createTypeChecker(host) { return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 169 /* Parameter */: + case 170 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getContextualTypeForBindingElement(declaration, contextFlags); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (isStatic(declaration)) { return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags); } @@ -76268,9 +77187,9 @@ function createTypeChecker(host) { function getContextualTypeForBindingElement(declaration, contextFlags) { const parent2 = declaration.parent.parent; const name = declaration.propertyName || declaration.name; - const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */); + const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 209 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */); if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name)) return void 0; - if (parent2.name.kind === 207 /* ArrayBindingPattern */) { + if (parent2.name.kind === 208 /* ArrayBindingPattern */) { const index = indexOfNode(declaration.parent.elements, declaration); if (index < 0) return void 0; return getContextualTypeForElementExpression(parentType, index); @@ -76459,7 +77378,7 @@ function createTypeChecker(host) { return signature ? getOrCreateTypeFromSignature(signature) : void 0; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 215 /* TaggedTemplateExpression */) { + if (template.parent.kind === 216 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return void 0; @@ -76871,17 +77790,17 @@ function createTypeChecker(host) { case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 80 /* Identifier */: case 157 /* UndefinedKeyword */: return true; - case 211 /* PropertyAccessExpression */: - case 217 /* ParenthesizedExpression */: + case 212 /* PropertyAccessExpression */: + case 218 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; @@ -76898,15 +77817,15 @@ function createTypeChecker(host) { if (!p.symbol) { return false; } - if (p.kind === 303 /* PropertyAssignment */) { + if (p.kind === 304 /* PropertyAssignment */) { return isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); } - if (p.kind === 304 /* ShorthandPropertyAssignment */) { + if (p.kind === 305 /* ShorthandPropertyAssignment */) { return isDiscriminantProperty(contextualType, p.symbol.escapedName); } return false; }), - (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 303 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName] + (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 304 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName] ), map( filter(getPropertiesOfType(contextualType), (s) => { @@ -76931,7 +77850,7 @@ function createTypeChecker(host) { contextualType, concatenate( map( - filter(node.properties, (p) => !!p.symbol && p.kind === 291 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), + filter(node.properties, (p) => !!p.symbol && p.kind === 292 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), (prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName] ), map( @@ -77010,47 +77929,47 @@ function createTypeChecker(host) { } const { parent: parent2 } = node; switch (parent2.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 208 /* BindingElement */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 209 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 219 /* ArrowFunction */: - case 253 /* ReturnStatement */: + case 220 /* ArrowFunction */: + case 254 /* ReturnStatement */: return getContextualTypeForReturnExpression(node, contextFlags); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return getContextualTypeForYieldOperand(parent2, contextFlags); - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent2, contextFlags); - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: return getContextualTypeForArgument(parent2, node); - case 170 /* Decorator */: + case 171 /* Decorator */: return getContextualTypeForDecorator(parent2); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent2, contextFlags); - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return getContextualType2(parent2.parent, contextFlags); - case 209 /* ArrayLiteralExpression */: { + case 210 /* ArrayLiteralExpression */: { const arrayLiteral = parent2; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); const elementIndex = indexOfNode(arrayLiteral.elements, node); const spreadIndices = (_a = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a.spreadIndices = getSpreadIndices(arrayLiteral.elements)); return getContextualTypeForElementExpression(type, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last); } - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 239 /* TemplateSpan */: - Debug.assert(parent2.parent.kind === 228 /* TemplateExpression */); + case 240 /* TemplateSpan */: + Debug.assert(parent2.parent.kind === 229 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent2.parent, node); - case 217 /* ParenthesizedExpression */: { + case 218 /* ParenthesizedExpression */: { if (isInJSFile(parent2)) { if (isJSDocSatisfiesExpression(parent2)) { return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); @@ -77062,21 +77981,21 @@ function createTypeChecker(host) { } return getContextualType2(parent2, contextFlags); } - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return getContextualType2(parent2, contextFlags); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return getTypeFromTypeNode(parent2.type); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return tryGetTypeFromEffectiveTypeNode(parent2); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return getContextualTypeForJsxExpression(parent2, contextFlags); - case 291 /* JsxAttribute */: - case 293 /* JsxSpreadAttribute */: + case 292 /* JsxAttribute */: + case 294 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent2, contextFlags); - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent2, contextFlags); - case 301 /* ImportAttribute */: + case 302 /* ImportAttribute */: return getContextualImportAttributeType(parent2); } return void 0; @@ -77101,6 +78020,9 @@ function createTypeChecker(host) { } function popContextualType() { contextualTypeCount--; + contextualTypeNodes[contextualTypeCount] = void 0; + contextualTypes[contextualTypeCount] = void 0; + contextualIsCache[contextualTypeCount] = void 0; } function findContextualNode(node, includeCaches) { for (let i = contextualTypeCount - 1; i >= 0; i--) { @@ -77117,6 +78039,8 @@ function createTypeChecker(host) { } function popInferenceContext() { inferenceContextCount--; + inferenceContextNodes[inferenceContextCount] = void 0; + inferenceContexts[inferenceContextCount] = void 0; } function getInferenceContext(node) { for (let i = inferenceContextCount - 1; i >= 0; i--) { @@ -77125,6 +78049,29 @@ function createTypeChecker(host) { } } } + function pushActiveMapper(mapper) { + activeTypeMappers[activeTypeMappersCount] = mapper; + activeTypeMappersCaches[activeTypeMappersCount] ?? (activeTypeMappersCaches[activeTypeMappersCount] = /* @__PURE__ */ new Map()); + activeTypeMappersCount++; + } + function popActiveMapper() { + activeTypeMappersCount--; + activeTypeMappers[activeTypeMappersCount] = void 0; + activeTypeMappersCaches[activeTypeMappersCount].clear(); + } + function findActiveMapper(mapper) { + for (let i = activeTypeMappersCount - 1; i >= 0; i--) { + if (mapper === activeTypeMappers[i]) { + return i; + } + } + return -1; + } + function clearActiveMapperCaches() { + for (let i = activeTypeMappersCount - 1; i >= 0; i--) { + activeTypeMappersCaches[i].clear(); + } + } function getContextualImportAttributeType(node) { return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType( /*reportErrors*/ @@ -77348,7 +78295,7 @@ function createTypeChecker(host) { return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0; } function getContextualSignature(node) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); const typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -77446,7 +78393,7 @@ function createTypeChecker(host) { return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 303 /* PropertyAssignment */ && hasDefaultValue(node.initializer) || node.kind === 304 /* ShorthandPropertyAssignment */ && !!node.objectAssignmentInitializer || node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */; + return node.kind === 209 /* BindingElement */ && !!node.initializer || node.kind === 304 /* PropertyAssignment */ && hasDefaultValue(node.initializer) || node.kind === 305 /* ShorthandPropertyAssignment */ && !!node.objectAssignmentInitializer || node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */; } function isSpreadIntoCallOrNew(node) { const parent2 = walkUpParenthesizedExpressions(node.parent); @@ -77469,7 +78416,7 @@ function createTypeChecker(host) { let hasOmittedExpression = false; for (let i = 0; i < elementCount; i++) { const e = elements[i]; - if (e.kind === 230 /* SpreadElement */) { + if (e.kind === 231 /* SpreadElement */) { if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */); } @@ -77493,7 +78440,7 @@ function createTypeChecker(host) { elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression)); elementFlags.push(4 /* Rest */); } - } else if (exactOptionalPropertyTypes && e.kind === 232 /* OmittedExpression */) { + } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) { hasOmittedExpression = true; elementTypes.push(undefinedOrMissingType); elementFlags.push(2 /* Optional */); @@ -77543,7 +78490,7 @@ function createTypeChecker(host) { } function isNumericName(name) { switch (name.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return isNumericComputedName(name); case 80 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -77560,7 +78507,7 @@ function createTypeChecker(host) { function checkComputedPropertyName(node) { const links = getNodeLinks(node.expression); if (!links.resolvedType) { - if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) { + if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 /* InKeyword */ && node.parent.kind !== 178 /* GetAccessor */ && node.parent.kind !== 179 /* SetAccessor */) { return links.resolvedType = errorType; } links.resolvedType = checkExpression(node.expression); @@ -77644,7 +78591,7 @@ function createTypeChecker(host) { /*contextFlags*/ void 0 ); - const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */); + const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 207 /* ObjectBindingPattern */ || contextualType.pattern.kind === 211 /* ObjectLiteralExpression */); const inConstContext = isConstContext(node); const checkFlags = inConstContext ? 8 /* Readonly */ : 0; const isInJavascript = isInJSFile(node) && !isInJsonFile(node); @@ -77663,13 +78610,13 @@ function createTypeChecker(host) { let offset = 0; for (const memberDecl of node.properties) { let member = getSymbolOfDeclaration(memberDecl); - const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; - if (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 304 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { - let type = memberDecl.kind === 303 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : ( + const computedNameType = memberDecl.name && memberDecl.name.kind === 168 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; + if (memberDecl.kind === 304 /* PropertyAssignment */ || memberDecl.kind === 305 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { + let type = memberDecl.kind === 304 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : ( // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 304 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) + memberDecl.kind === 305 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) ); if (isInJavascript) { const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -77705,13 +78652,13 @@ function createTypeChecker(host) { prop.links.target = member; member = prop; allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop); - if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { + if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 304 /* PropertyAssignment */ || memberDecl.kind === 175 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { const inferenceContext = getInferenceContext(node); Debug.assert(inferenceContext); - const inferenceNode = memberDecl.kind === 303 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; + const inferenceNode = memberDecl.kind === 304 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type); } - } else if (memberDecl.kind === 305 /* SpreadAssignment */) { + } else if (memberDecl.kind === 306 /* SpreadAssignment */) { if (languageVersion < LanguageFeatureMinimumTarget.ObjectAssign) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -77740,7 +78687,7 @@ function createTypeChecker(host) { } continue; } else { - Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */); + Debug.assert(memberDecl.kind === 178 /* GetAccessor */ || memberDecl.kind === 179 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -77890,7 +78837,7 @@ function createTypeChecker(host) { addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType); } } else { - Debug.assert(attributeDecl.kind === 293 /* JsxSpreadAttribute */); + Debug.assert(attributeDecl.kind === 294 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType( spread, @@ -77999,7 +78946,7 @@ function createTypeChecker(host) { if (!child.containsOnlyTriviaWhiteSpaces) { childrenTypes.push(stringType); } - } else if (child.kind === 294 /* JsxExpression */ && !child.expression) { + } else if (child.kind === 295 /* JsxExpression */ && !child.expression) { continue; } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); @@ -78368,7 +79315,7 @@ function createTypeChecker(host) { } } function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) { - const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name; + const errorNode = !reportError ? void 0 : node.kind === 167 /* QualifiedName */ ? node.right : node.kind === 206 /* ImportType */ ? node : node.kind === 209 /* BindingElement */ && node.propertyName ? node.propertyName : node.name; return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode); } function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) { @@ -78578,7 +79525,7 @@ function createTypeChecker(host) { return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode); } function isMethodAccessForCall(node) { - while (node.parent.kind === 217 /* ParenthesizedExpression */) { + while (node.parent.kind === 218 /* ParenthesizedExpression */) { node = node.parent; } return isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -78759,7 +79706,7 @@ function createTypeChecker(host) { /*skipObjectFunctionPropertyAugment*/ isConstEnumObjectType(apparentType), /*includeTypeOnlyMembers*/ - node.kind === 166 /* QualifiedName */ + node.kind === 167 /* QualifiedName */ ); } markLinkedReferences(node, 2 /* Property */, prop, leftType); @@ -78853,7 +79800,7 @@ function createTypeChecker(host) { if (declaration && isPropertyWithoutInitializer(declaration)) { if (!isStatic(declaration)) { const flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432 /* Ambient */)) { + if (flowContainer.kind === 177 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432 /* Ambient */)) { assumeUninitialized = true; } } @@ -78877,38 +79824,28 @@ function createTypeChecker(host) { const declarationName = idText(right); if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) { diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName); - } else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { + } else if (valueDeclaration.kind === 264 /* ClassDeclaration */ && node.parent.kind !== 184 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName); } if (diagnosticMessage) { addRelatedInfo(diagnosticMessage, createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName)); } } - function isInPropertyInitializerOrClassStaticBlock(node) { + function isInPropertyInitializerOrClassStaticBlock(node, ignoreArrowFunctions) { return !!findAncestor(node, (node2) => { switch (node2.kind) { - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return true; - case 303 /* PropertyAssignment */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 305 /* SpreadAssignment */: - case 167 /* ComputedPropertyName */: - case 239 /* TemplateSpan */: - case 294 /* JsxExpression */: - case 291 /* JsxAttribute */: - case 292 /* JsxAttributes */: - case 293 /* JsxSpreadAttribute */: - case 286 /* JsxOpeningElement */: - case 233 /* ExpressionWithTypeArguments */: - case 298 /* HeritageClause */: - return false; - case 219 /* ArrowFunction */: - case 244 /* ExpressionStatement */: - return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit"; + case 187 /* TypeQuery */: + case 288 /* JsxClosingElement */: + return "quit"; + case 220 /* ArrowFunction */: + return ignoreArrowFunctions ? false : "quit"; + case 242 /* Block */: + return isFunctionLikeDeclaration(node2.parent) && node2.parent.kind !== 220 /* ArrowFunction */ ? "quit" : false; default: - return isExpressionNode(node2) ? false : "quit"; + return false; } }); } @@ -78989,7 +79926,7 @@ function createTypeChecker(host) { addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic); } function containerSeemsToBeEmptyDomElement(containingType) { - return compilerOptions.lib && !compilerOptions.lib.includes("dom") && everyContainedType(containingType, (type) => type.symbol && /^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(unescapeLeadingUnderscores(type.symbol.escapedName))) && isEmptyObjectType(containingType); + return compilerOptions.lib && !compilerOptions.lib.includes("lib.dom.d.ts") && everyContainedType(containingType, (type) => type.symbol && /^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(unescapeLeadingUnderscores(type.symbol.escapedName))) && isEmptyObjectType(containingType); } function typeHasStaticProperty(propName, containingType) { const prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); @@ -79144,9 +80081,9 @@ function createTypeChecker(host) { } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 108 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return isValidPropertyAccessWithType( node, /*isSuper*/ @@ -79154,7 +80091,7 @@ function createTypeChecker(host) { propertyName, getWidenedType(checkExpression(node.left)) ); - case 205 /* ImportType */: + case 206 /* ImportType */: return isValidPropertyAccessWithType( node, /*isSuper*/ @@ -79167,7 +80104,7 @@ function createTypeChecker(host) { function isValidPropertyAccessForCompletions(node, type, property) { return isPropertyAccessible( node, - node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, + node.kind === 212 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, /*isWrite*/ false, type, @@ -79200,7 +80137,7 @@ function createTypeChecker(host) { } function getForInVariableSymbol(node) { const initializer = node.initializer; - if (initializer.kind === 261 /* VariableDeclarationList */) { + if (initializer.kind === 262 /* VariableDeclarationList */) { const variable = initializer.declarations[0]; if (variable && !isBindingPattern(variable.name)) { return getSymbolOfDeclaration(variable); @@ -79221,7 +80158,7 @@ function createTypeChecker(host) { let child = expr; let node = expr.parent; while (node) { - if (node.kind === 249 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { + if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { return true; } child = node; @@ -79271,7 +80208,7 @@ function createTypeChecker(host) { if (callLikeExpressionMayHaveTypeArguments(node)) { forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 215 /* TaggedTemplateExpression */) { + if (node.kind === 216 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); @@ -79322,7 +80259,7 @@ function createTypeChecker(host) { } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 230 /* SpreadElement */ || arg.kind === 237 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return findIndex(args, isSpreadArgument); @@ -79339,9 +80276,9 @@ function createTypeChecker(host) { let callIsIncomplete = false; let effectiveParameterCount = getParameterCount(signature); let effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 215 /* TaggedTemplateExpression */) { + if (node.kind === 216 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 228 /* TemplateExpression */) { + if (node.template.kind === 229 /* TemplateExpression */) { const lastSpan = last(node.template.templateSpans); callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { @@ -79349,9 +80286,9 @@ function createTypeChecker(host) { Debug.assert(templateLiteral.kind === 15 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } - } else if (node.kind === 170 /* Decorator */) { + } else if (node.kind === 171 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); - } else if (node.kind === 226 /* BinaryExpression */) { + } else if (node.kind === 227 /* BinaryExpression */) { argCount = 1; } else if (isJsxOpeningLikeElement(node)) { callIsIncomplete = node.attributes.end === node.end; @@ -79362,7 +80299,7 @@ function createTypeChecker(host) { effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); } else if (!node.arguments) { - Debug.assert(node.kind === 214 /* NewExpression */); + Debug.assert(node.kind === 215 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -79462,7 +80399,7 @@ function createTypeChecker(host) { if (isJsxOpeningLikeElement(node)) { return inferJsxTypeArguments(node, signature, checkMode, context); } - if (node.kind !== 170 /* Decorator */ && node.kind !== 226 /* BinaryExpression */) { + if (node.kind !== 171 /* Decorator */ && node.kind !== 227 /* BinaryExpression */) { const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p)); const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { @@ -79478,7 +80415,7 @@ function createTypeChecker(host) { inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */); } const returnContext = createInferenceContext(signature.typeParameters, signature, context.flags); - const returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper); + const returnSourceType = instantiateType(contextualType, outerContext && createOuterReturnMapper(outerContext)); inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType); context.returnMapper = some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : void 0; } @@ -79499,7 +80436,7 @@ function createTypeChecker(host) { } for (let i = 0; i < argCount; i++) { const arg = args[i]; - if (arg.kind !== 232 /* OmittedExpression */) { + if (arg.kind !== 233 /* OmittedExpression */) { const paramType = getTypeAtPosition(signature, i); if (couldContainTypeVariables(paramType)) { const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); @@ -79527,11 +80464,11 @@ function createTypeChecker(host) { if (index >= argCount - 1) { const arg = args[argCount - 1]; if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 237 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); + const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); if (isArrayLikeType(spreadType)) { return getMutableArrayOrTupleType(spreadType); } - return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 230 /* SpreadElement */ ? arg.expression : arg), inConstContext); + return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg), inConstContext); } } const types = []; @@ -79540,12 +80477,12 @@ function createTypeChecker(host) { for (let i = index; i < argCount; i++) { const arg = args[i]; if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 237 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 230 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { @@ -79555,7 +80492,7 @@ function createTypeChecker(host) { types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } else { names.push(void 0); @@ -79714,7 +80651,7 @@ function createTypeChecker(host) { const flags = isInJSFile(argument) ? 1 /* Parentheses */ | 32 /* Satisfies */ | -2147483648 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */ | 32 /* Satisfies */; return skipOuterExpressions(argument, flags); } - function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) { + function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) { const errorOutputContainer = { errors: void 0, skipLogging: true }; if (isJsxCallLike(node)) { if (!checkApplicableSignatureForJsxCallLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) { @@ -79739,7 +80676,7 @@ function createTypeChecker(host) { const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (let i = 0; i < argCount; i++) { const arg = args[i]; - if (arg.kind !== 232 /* OmittedExpression */) { + if (arg.kind !== 233 /* OmittedExpression */) { const paramType = getTypeAtPosition(signature, i); const argType = checkExpressionWithContextualType( arg, @@ -79748,8 +80685,7 @@ function createTypeChecker(host) { void 0, checkMode ); - const regularArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType; - const checkArgType = inferenceContext ? instantiateType(regularArgType, inferenceContext.nonFixingMapper) : regularArgType; + const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType; const effectiveCheckArgumentNode = getEffectiveCheckNode(arg); if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); @@ -79799,10 +80735,10 @@ function createTypeChecker(host) { } } function getThisArgumentOfCall(node) { - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { return node.right; } - const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0; + const expression = node.kind === 214 /* CallExpression */ ? node.expression : node.kind === 216 /* TaggedTemplateExpression */ ? node.tag : node.kind === 171 /* Decorator */ && !legacyDecorators ? node.expression : void 0; if (expression) { const callee = skipOuterExpressions(expression); if (isAccessExpression(callee)) { @@ -79820,20 +80756,20 @@ function createTypeChecker(host) { if (isJsxOpeningFragment(node)) { return [createSyntheticExpression(node, emptyFreshJsxObjectType)]; } - if (node.kind === 215 /* TaggedTemplateExpression */) { + if (node.kind === 216 /* TaggedTemplateExpression */) { const template = node.template; const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 228 /* TemplateExpression */) { + if (template.kind === 229 /* TemplateExpression */) { forEach(template.templateSpans, (span) => { args2.push(span.expression); }); } return args2; } - if (node.kind === 170 /* Decorator */) { + if (node.kind === 171 /* Decorator */) { return getEffectiveDecoratorArguments(node); } - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { return [node.left]; } if (isJsxOpeningLikeElement(node)) { @@ -79845,7 +80781,7 @@ function createTypeChecker(host) { const effectiveArgs = args.slice(0, spreadIndex); for (let i = spreadIndex; i < args.length; i++) { const arg = args[i]; - const spreadType = arg.kind === 230 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + const spreadType = arg.kind === 231 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { forEach(getElementTypes(spreadType), (t, i2) => { var _a; @@ -79882,16 +80818,16 @@ function createTypeChecker(host) { } function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return 1; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return hasAccessorModifier(node.parent) ? 3 : 2; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return signature.parameters.length <= 2 ? 2 : 3; - case 169 /* Parameter */: + case 170 /* Parameter */: return 3; default: return Debug.fail(); @@ -80101,11 +81037,11 @@ function createTypeChecker(host) { return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { - const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */; - const isDecorator2 = node.kind === 170 /* Decorator */; + const isTaggedTemplate = node.kind === 216 /* TaggedTemplateExpression */; + const isDecorator2 = node.kind === 171 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); const isJsxOpenFragment = isJsxOpeningFragment(node); - const isInstanceof = node.kind === 226 /* BinaryExpression */; + const isInstanceof = node.kind === 227 /* BinaryExpression */; const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let candidatesForArgumentError; let candidateForArgumentArityError; @@ -80123,14 +81059,19 @@ function createTypeChecker(host) { candidates = candidatesOutArray || []; reorderCandidates(signatures, candidates, callChainFlags); if (!isJsxOpenFragment) { - Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this"); + if (!candidates.length) { + if (reportErrors2) { + diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures)); + } + return resolveErrorCall(node); + } } const args = getEffectiveCallArguments(node); const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; if (!isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive)) { argCheckMode = 4 /* SkipContextSensitive */; } - const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma; + const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 214 /* CallExpression */ && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); } @@ -80170,9 +81111,7 @@ function createTypeChecker(host) { 0 /* Normal */, /*reportErrors*/ true, - () => chain, - /*inferenceContext*/ - void 0 + () => chain ); if (diags) { for (const d of diags) { @@ -80208,9 +81147,7 @@ function createTypeChecker(host) { 0 /* Normal */, /*reportErrors*/ true, - chain2, - /*inferenceContext*/ - void 0 + chain2 ); if (diags2) { if (diags2.length <= min2) { @@ -80284,7 +81221,6 @@ function createTypeChecker(host) { candidateForTypeArgumentError = oldCandidateForTypeArgumentError; } function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) { - var _a, _b; candidatesForArgumentError = void 0; candidateForArgumentArityError = void 0; candidateForTypeArgumentError = void 0; @@ -80302,8 +81238,6 @@ function createTypeChecker(host) { /*reportErrors*/ false, /*containingMessageChain*/ - void 0, - /*inferenceContext*/ void 0 )) { candidatesForArgumentError = [candidate]; @@ -80312,18 +81246,13 @@ function createTypeChecker(host) { return candidate; } for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) { - let candidate = candidates2[candidateIndex]; + const candidate = candidates2[candidateIndex]; if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { continue; } let checkCandidate; let inferenceContext; if (candidate.typeParameters) { - const paramLocation = (_b = (_a = candidate.typeParameters[0].symbol.declarations) == null ? void 0 : _a[0]) == null ? void 0 : _b.parent; - const candidateParameterContext = paramLocation || (candidate.declaration && isConstructorDeclaration(candidate.declaration) ? candidate.declaration.parent : candidate.declaration); - if (candidateParameterContext && findAncestor(node, (a) => a === candidateParameterContext)) { - candidate = getImplementationSignature(candidate); - } let typeArgumentTypes; if (some(typeArguments)) { typeArgumentTypes = checkTypeArguments( @@ -80343,7 +81272,7 @@ function createTypeChecker(host) { /*flags*/ isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */ ); - typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper); + typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext); argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */; } checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters); @@ -80363,8 +81292,7 @@ function createTypeChecker(host) { /*reportErrors*/ false, /*containingMessageChain*/ - void 0, - inferenceContext + void 0 )) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; @@ -80372,7 +81300,7 @@ function createTypeChecker(host) { if (argCheckMode) { argCheckMode = 0 /* Normal */; if (inferenceContext) { - const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper); + const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters); if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { candidateForArgumentArityError = checkCandidate; @@ -80388,8 +81316,7 @@ function createTypeChecker(host) { /*reportErrors*/ false, /*containingMessageChain*/ - void 0, - inferenceContext + void 0 )) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; @@ -80674,7 +81601,7 @@ function createTypeChecker(host) { } const declaration = signature.declaration; const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */); - if (!modifiers || declaration.kind !== 176 /* Constructor */) { + if (!modifiers || declaration.kind !== 177 /* Constructor */) { return true; } const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -80704,11 +81631,11 @@ function createTypeChecker(host) { const maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; if (apparentType.flags & 1048576 /* Union */) { const types = apparentType.types; - let hasSignatures = false; + let hasSignatures2 = false; for (const constituent of types) { const signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { - hasSignatures = true; + hasSignatures2 = true; if (errorInfo) { break; } @@ -80725,12 +81652,12 @@ function createTypeChecker(host) { typeToString(apparentType) ); } - if (hasSignatures) { + if (hasSignatures2) { break; } } } - if (!hasSignatures) { + if (!hasSignatures2) { errorInfo = chainDiagnosticMessages( /*details*/ void 0, @@ -80813,16 +81740,16 @@ function createTypeChecker(host) { } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 169 /* Parameter */: + case 170 /* Parameter */: return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return Debug.fail(); @@ -81004,19 +81931,19 @@ function createTypeChecker(host) { } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 170 /* Decorator */: + case 171 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 289 /* JsxOpeningFragment */: - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 290 /* JsxOpeningFragment */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return resolveInstanceofExpression(node, candidatesOutArray, checkMode); } Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -81129,7 +82056,7 @@ function createTypeChecker(host) { return false; } let parent2 = node.parent; - while (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) { + while (parent2 && parent2.kind === 212 /* PropertyAccessExpression */) { parent2 = parent2.parent; } if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 64 /* EqualsToken */) { @@ -81153,9 +82080,9 @@ function createTypeChecker(host) { if (node.expression.kind === 108 /* SuperKeyword */) { return voidType; } - if (node.kind === 214 /* NewExpression */) { + if (node.kind === 215 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 176 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 177 /* Constructor */ && declaration.kind !== 181 /* ConstructSignature */ && declaration.kind !== 186 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 177 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { error2(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -81169,7 +82096,7 @@ function createTypeChecker(host) { if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 244 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { + if (node.kind === 214 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!isDottedName(node.expression)) { error2(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); } else if (!getEffectsSignature(node)) { @@ -81202,20 +82129,20 @@ function createTypeChecker(host) { function getDeprecatedSuggestionNode(node) { node = skipParentheses(node); switch (node.kind) { - case 213 /* CallExpression */: - case 170 /* Decorator */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 171 /* Decorator */: + case 215 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return node.argumentExpression; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return node.name; - case 183 /* TypeReference */: + case 184 /* TypeReference */: const typeReference = node; return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -81369,7 +82296,7 @@ function createTypeChecker(host) { if (resolvedRequire.flags & 2097152 /* Alias */) { return false; } - const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 262 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 260 /* VariableDeclaration */ : 0 /* Unknown */; + const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind); return !!decl && !!(decl.flags & 33554432 /* Ambient */); @@ -81386,11 +82313,16 @@ function createTypeChecker(host) { return getReturnTypeOfSignature(signature); } function checkAssertion(node, checkMode) { - if (node.kind === 216 /* TypeAssertionExpression */) { + if (node.kind === 217 /* TypeAssertionExpression */) { const file = getSourceFileOfNode(node); if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) { grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead); } + if (compilerOptions.erasableSyntaxOnly) { + const start = skipTrivia(file.text, node.pos); + const end = node.expression.pos; + diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)); + } } return checkAssertionWorker(node, checkMode); } @@ -81402,18 +82334,18 @@ function createTypeChecker(host) { case 10 /* BigIntLiteral */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 228 /* TemplateExpression */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 229 /* TemplateExpression */: return true; - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const op = node.operator; const arg = node.operand; return op === 41 /* MinusToken */ && (arg.kind === 9 /* NumericLiteral */ || arg.kind === 10 /* BigIntLiteral */) || op === 40 /* PlusToken */ && arg.kind === 9 /* NumericLiteral */; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: const expr = skipParentheses(node.expression); const symbol = isEntityNameExpression(expr) ? resolveEntityName( expr, @@ -81444,12 +82376,12 @@ function createTypeChecker(host) { let type; let expression; switch (node.kind) { - case 234 /* AsExpression */: - case 216 /* TypeAssertionExpression */: + case 235 /* AsExpression */: + case 217 /* TypeAssertionExpression */: type = node.type; expression = node.expression; break; - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: type = getJSDocTypeAssertionType(node); expression = node.expression; break; @@ -81483,13 +82415,13 @@ function createTypeChecker(host) { function checkExpressionWithTypeArguments(node) { checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); - if (node.kind === 233 /* ExpressionWithTypeArguments */) { + if (node.kind === 234 /* ExpressionWithTypeArguments */) { const parent2 = walkUpParenthesizedExpressions(node.parent); - if (parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 104 /* InstanceOfKeyword */ && isNodeDescendantOf(node, parent2.right)) { + if (parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 104 /* InstanceOfKeyword */ && isNodeDescendantOf(node, parent2.right)) { error2(node, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression); } } - const exprType = node.kind === 233 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + const exprType = node.kind === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); return getInstantiationExpressionType(exprType, node); } function getInstantiationExpressionType(exprType, node) { @@ -81514,11 +82446,11 @@ function createTypeChecker(host) { } return result; function getInstantiatedType(type) { - let hasSignatures = false; + let hasSignatures2 = false; let hasApplicableSignature = false; const result2 = getInstantiatedTypePart(type); hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature); - if (hasSignatures && !hasApplicableSignature) { + if (hasSignatures2 && !hasApplicableSignature) { nonApplicableType ?? (nonApplicableType = type); } return result2; @@ -81527,7 +82459,7 @@ function createTypeChecker(host) { const resolved = resolveStructuredTypeMembers(type2); const callSignatures = getInstantiatedSignatures(resolved.callSignatures); const constructSignatures = getInstantiatedSignatures(resolved.constructSignatures); - hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); + hasSignatures2 || (hasSignatures2 = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0); if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) { const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos); @@ -81574,7 +82506,7 @@ function createTypeChecker(host) { if (isErrorType(targetType)) { return targetType; } - const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 350 /* JSDocSatisfiesTag */); + const errorNode = findAncestor(target.parent, (n) => n.kind === 239 /* SatisfiesExpression */ || n.kind === 351 /* JSDocSatisfiesTag */); checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } @@ -81584,6 +82516,10 @@ function createTypeChecker(host) { return checkNewTargetMetaProperty(node); } if (node.keywordToken === 102 /* ImportKeyword */) { + if (node.name.escapedText === "defer") { + Debug.assert(!isCallExpression(node.parent) || node.parent.expression !== node, "Trying to get the type of `import.defer` in `import.defer(...)`"); + return errorType; + } return checkImportMetaProperty(node); } return Debug.assertNever(node.keywordToken); @@ -81604,7 +82540,7 @@ function createTypeChecker(host) { if (!container) { error2(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; - } else if (container.kind === 176 /* Constructor */) { + } else if (container.kind === 177 /* Constructor */) { const symbol = getSymbolOfDeclaration(container.parent); return getTypeOfSymbol(symbol); } else { @@ -81618,7 +82554,7 @@ function createTypeChecker(host) { error2(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); } } else if (moduleKind < 6 /* ES2020 */ && moduleKind !== 4 /* System */) { - error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext); + error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext); } const file = getSourceFileOfNode(node); Debug.assert(!!(file.flags & 8388608 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -81644,7 +82580,7 @@ function createTypeChecker(host) { return elementFlags & 3 /* Fixed */ ? name : `${name}_n`; } } - case 207 /* ArrayBindingPattern */: { + case 208 /* ArrayBindingPattern */: { if (node.dotDotDotToken) { const elements = node.name.elements; const lastElement = tryCast(lastOrUndefined(elements), isBindingElement); @@ -81690,7 +82626,7 @@ function createTypeChecker(host) { } function getParameterIdentifierInfoAtPosition(signature, pos) { var _a; - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 317 /* JSDocFunctionType */) { + if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 318 /* JSDocFunctionType */) { return void 0; } const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -81729,7 +82665,7 @@ function createTypeChecker(host) { return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name) && symbol.valueDeclaration.name; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); + return d.kind === 203 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); } function getNameableDeclarationAtPosition(signature, pos) { const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -81864,14 +82800,14 @@ function createTypeChecker(host) { function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) { return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType; } - function inferFromAnnotatedParameters(signature, context, inferenceContext) { + function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) { const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); for (let i = 0; i < len; i++) { const declaration = signature.parameters[i].valueDeclaration; - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { + const typeNode2 = getEffectiveTypeAnnotationNode(declaration); + if (typeNode2) { const source = addOptionality( - getTypeFromTypeNode(typeNode), + getTypeFromTypeNode(typeNode2), /*isProperty*/ false, isOptionalDeclaration(declaration) @@ -81880,6 +82816,12 @@ function createTypeChecker(host) { inferTypes(inferenceContext.inferences, source, target); } } + const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); + if (typeNode) { + const source = getTypeFromTypeNode(typeNode); + const target = getReturnTypeOfSignature(context); + inferTypes(inferenceContext.inferences, source, target); + } } function assignContextualParameterTypes(signature, context) { if (context.typeParameters) { @@ -82084,17 +83026,17 @@ function createTypeChecker(host) { if (!links.decoratorSignature) { links.decoratorSignature = anySignature; switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: { + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: { const node = parent2; const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); const contextType = createClassDecoratorContextType(targetType); links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); break; } - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: { + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: { const node = parent2; if (!isClassLike(node.parent)) break; const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); @@ -82105,7 +83047,7 @@ function createTypeChecker(host) { links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); break; } - case 172 /* PropertyDeclaration */: { + case 173 /* PropertyDeclaration */: { const node = parent2; if (!isClassLike(node.parent)) break; const valueType = getTypeOfNode(node); @@ -82126,8 +83068,8 @@ function createTypeChecker(host) { if (!links.decoratorSignature) { links.decoratorSignature = anySignature; switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: { + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: { const node = parent2; const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); const targetParam = createParameter2("target", targetType); @@ -82141,7 +83083,7 @@ function createTypeChecker(host) { ); break; } - case 169 /* Parameter */: { + case 170 /* Parameter */: { const node = parent2; if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { break; @@ -82167,10 +83109,10 @@ function createTypeChecker(host) { ); break; } - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 172 /* PropertyDeclaration */: { + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 173 /* PropertyDeclaration */: { const node = parent2; if (!isClassLike(node.parent)) break; const targetType = getParentTypeOfClassElement(node); @@ -82270,7 +83212,7 @@ function createTypeChecker(host) { let yieldType; let nextType; let fallbackReturnType = voidType; - if (func.body.kind !== 241 /* Block */) { + if (func.body.kind !== 242 /* Block */) { returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { returnType = unwrapAwaitedType(checkAwaitedType( @@ -82405,6 +83347,9 @@ function createTypeChecker(host) { return { yieldTypes, nextTypes }; } function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) { + if (expressionType === silentNeverType) { + return silentNeverType; + } const errorNode = node.expression || node; const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType; return !isAsync ? yieldedType : getAwaitedType( @@ -82435,7 +83380,7 @@ function createTypeChecker(host) { return links.isExhaustive; } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 221 /* TypeOfExpression */) { + if (node.expression.kind === 222 /* TypeOfExpression */) { const witnesses = getSwitchClauseTypeOfWitnesses(node); if (!witnesses) { return false; @@ -82473,14 +83418,14 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - if (functionFlags & 2 /* Async */ && expr.kind === 223 /* AwaitExpression */) { + if (functionFlags & 2 /* Async */ && expr.kind === 224 /* AwaitExpression */) { expr = skipParentheses( expr.expression, /*excludeJSDocTypeAssertions*/ true ); } - if (expr.kind === 213 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === getMergedSymbol(func.symbol) && (!isFunctionExpressionOrArrowFunction(func.symbol.valueDeclaration) || isConstantReference(expr.expression))) { + if (expr.kind === 214 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === getMergedSymbol(func.symbol) && (!isFunctionExpressionOrArrowFunction(func.symbol.valueDeclaration) || isConstantReference(expr.expression))) { hasReturnOfTypeNever = true; return; } @@ -82512,26 +83457,26 @@ function createTypeChecker(host) { } function mayReturnNever(func) { switch (func.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; - case 174 /* MethodDeclaration */: - return func.parent.kind === 210 /* ObjectLiteralExpression */; + case 175 /* MethodDeclaration */: + return func.parent.kind === 211 /* ObjectLiteralExpression */; default: return false; } } function getTypePredicateFromBody(func) { switch (func.kind) { - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return void 0; } const functionFlags = getFunctionFlags(func); if (functionFlags !== 0 /* Normal */) return void 0; let singleReturn; - if (func.body && func.body.kind !== 241 /* Block */) { + if (func.body && func.body.kind !== 242 /* Block */) { singleReturn = func.body; } else { const bailedEarly = forEachReturnStatement(func.body, (returnStatement) => { @@ -82562,7 +83507,7 @@ function createTypeChecker(host) { }); } function checkIfExpressionRefinesParameter(func, expr, param, initType) { - const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 253 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode( + const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 254 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode( 2 /* Start */, /*node*/ void 0, @@ -82573,7 +83518,7 @@ function createTypeChecker(host) { const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition); if (trueType2 === initType) return void 0; const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent); - const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition); + const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition)); return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0; } function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { @@ -82585,7 +83530,7 @@ function createTypeChecker(host) { if (type && (maybeTypeOfKind(type, 16384 /* Void */) || type.flags & (1 /* Any */ | 32768 /* Undefined */))) { return; } - if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 241 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 174 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) { return; } const hasExplicitReturn = func.flags & 1024 /* HasExplicitReturn */; @@ -82611,7 +83556,7 @@ function createTypeChecker(host) { } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); checkNodeDeferred(node); if (isFunctionExpression(node)) { checkCollisionsForDeclarationName(node, node.name); @@ -82647,7 +83592,7 @@ function createTypeChecker(host) { return anyFunctionType; } const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 219 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -82668,7 +83613,7 @@ function createTypeChecker(host) { const inferenceContext = getInferenceContext(node); let instantiatedContextualSignature; if (checkMode && checkMode & 2 /* Inferential */) { - inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext); const restType = getEffectiveRestType(contextualSignature); if (restType && restType.flags & 262144 /* TypeParameter */) { instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper); @@ -82682,7 +83627,7 @@ function createTypeChecker(host) { } else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) { const inferenceContext = getInferenceContext(node); if (checkMode && checkMode & 2 /* Inferential */) { - inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext); } } if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) { @@ -82696,7 +83641,7 @@ function createTypeChecker(host) { } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 175 /* MethodDeclaration */ || isObjectLiteralMethod(node)); const functionFlags = getFunctionFlags(node); const returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -82704,7 +83649,7 @@ function createTypeChecker(host) { if (!getEffectiveReturnTypeNode(node)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 241 /* Block */) { + if (node.body.kind === 242 /* Block */) { checkSourceElement(node.body); } else { const exprType = checkExpression(node.body); @@ -82765,7 +83710,7 @@ function createTypeChecker(host) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 110 /* ThisKeyword */) { const ctor = getControlFlowContainer(expr); - if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 177 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -82786,7 +83731,7 @@ function createTypeChecker(host) { const symbol2 = getNodeLinks(node).resolvedSymbol; if (symbol2.flags & 2097152 /* Alias */) { const declaration = getDeclarationOfAliasSymbol(symbol2); - return !!declaration && declaration.kind === 274 /* NamespaceImport */; + return !!declaration && declaration.kind === 275 /* NamespaceImport */; } } } @@ -82861,6 +83806,7 @@ function createTypeChecker(host) { switch (moduleKind) { case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) { span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); @@ -82881,7 +83827,7 @@ function createTypeChecker(host) { // fallthrough default: span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); - const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; + const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message)); hasError = true; break; @@ -82893,7 +83839,7 @@ function createTypeChecker(host) { const span = getSpanOfTokenAtPosition(sourceFile, node.pos); const message = isAwaitExpression(node) ? Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules : Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules; const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, message); - if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) { + if (container && container.kind !== 177 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) { const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async); addRelatedInfo(diagnostic, relatedInfo); } @@ -83122,7 +84068,7 @@ function createTypeChecker(host) { function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) { const properties = node.properties; const property = properties[propertyIndex]; - if (property.kind === 303 /* PropertyAssignment */ || property.kind === 304 /* ShorthandPropertyAssignment */) { + if (property.kind === 304 /* PropertyAssignment */ || property.kind === 305 /* ShorthandPropertyAssignment */) { const name = property.name; const exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -83143,8 +84089,8 @@ function createTypeChecker(host) { } const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */ | (hasDefaultValue(property) ? 16 /* AllowMissing */ : 0), name); const type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 304 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); - } else if (property.kind === 305 /* SpreadAssignment */) { + return checkDestructuringAssignment(property.kind === 305 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + } else if (property.kind === 306 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error2(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { @@ -83176,7 +84122,7 @@ function createTypeChecker(host) { let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType; for (let i = 0; i < elements.length; i++) { let type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 230 /* SpreadElement */) { + if (node.elements[i].kind === 231 /* SpreadElement */) { type = inBoundsType = inBoundsType ?? (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); } checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); @@ -83186,8 +84132,8 @@ function createTypeChecker(host) { function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { const elements = node.elements; const element = elements[elementIndex]; - if (element.kind !== 232 /* OmittedExpression */) { - if (element.kind !== 230 /* SpreadElement */) { + if (element.kind !== 233 /* OmittedExpression */) { + if (element.kind !== 231 /* SpreadElement */) { const indexType = getNumberLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* AllowMissing */ : 0); @@ -83202,7 +84148,7 @@ function createTypeChecker(host) { error2(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { const restExpression = element.expression; - if (restExpression.kind === 226 /* BinaryExpression */ && restExpression.operatorToken.kind === 64 /* EqualsToken */) { + if (restExpression.kind === 227 /* BinaryExpression */ && restExpression.operatorToken.kind === 64 /* EqualsToken */) { error2(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); } else { checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); @@ -83215,7 +84161,7 @@ function createTypeChecker(host) { } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { let target; - if (exprOrAssignment.kind === 304 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 305 /* ShorthandPropertyAssignment */) { const prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && !hasTypeFacts(checkExpression(prop.objectAssignmentInitializer), 16777216 /* IsUndefined */)) { @@ -83227,25 +84173,25 @@ function createTypeChecker(host) { } else { target = exprOrAssignment; } - if (target.kind === 226 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { + if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; if (strictNullChecks) { sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */); } } - if (target.kind === 210 /* ObjectLiteralExpression */) { + if (target.kind === 211 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 209 /* ArrayLiteralExpression */) { + if (target.kind === 210 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { const targetType = checkExpression(target, checkMode); - const error3 = target.parent.kind === 305 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - const optionalError = target.parent.kind === 305 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; + const error3 = target.parent.kind === 306 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; + const optionalError = target.parent.kind === 306 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error3, optionalError)) { checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target); } @@ -83260,8 +84206,8 @@ function createTypeChecker(host) { case 80 /* Identifier */: case 11 /* StringLiteral */: case 14 /* RegularExpressionLiteral */: - case 215 /* TaggedTemplateExpression */: - case 228 /* TemplateExpression */: + case 216 /* TaggedTemplateExpression */: + case 229 /* TemplateExpression */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: @@ -83269,25 +84215,25 @@ function createTypeChecker(host) { case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 157 /* UndefinedKeyword */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: - case 219 /* ArrowFunction */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 221 /* TypeOfExpression */: - case 235 /* NonNullExpression */: - case 285 /* JsxSelfClosingElement */: - case 284 /* JsxElement */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 222 /* TypeOfExpression */: + case 236 /* NonNullExpression */: + case 286 /* JsxSelfClosingElement */: + case 285 /* JsxElement */: return true; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: switch (node.operator) { case 54 /* ExclamationToken */: case 40 /* PlusToken */: @@ -83297,11 +84243,11 @@ function createTypeChecker(host) { } return false; // Some forms listed here for clarity - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: // Explicit opt-out - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 234 /* AsExpression */: + case 235 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; @@ -83346,7 +84292,7 @@ function createTypeChecker(host) { } checkNullishCoalesceOperands(node); const operator = node.operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) { + if (operator === 64 /* EqualsToken */ && (node.left.kind === 211 /* ObjectLiteralExpression */ || node.left.kind === 210 /* ArrayLiteralExpression */)) { state.skip = true; setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 110 /* ThisKeyword */)); return state; @@ -83371,7 +84317,7 @@ function createTypeChecker(host) { const operator = operatorToken.kind; if (isLogicalOrCoalescingBinaryOperator(operator)) { let parent2 = node.parent; - while (parent2.kind === 217 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { + while (parent2.kind === 218 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { parent2 = parent2.parent; } if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { @@ -83437,43 +84383,68 @@ function createTypeChecker(host) { } } function checkNullishCoalesceOperands(node) { - const { left, operatorToken, right } = node; - if (operatorToken.kind === 61 /* QuestionQuestionToken */) { - if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) { - grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(left.operatorToken.kind), tokenToString(operatorToken.kind)); - } - if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) { - grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind)); - } - const leftTarget = skipOuterExpressions(left, 63 /* All */); - const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget); - if (nullishSemantics !== 3 /* Sometimes */) { - if (node.parent.kind === 226 /* BinaryExpression */) { - error2(leftTarget, Diagnostics.This_binary_expression_is_never_nullish_Are_you_missing_parentheses); - } else { - if (nullishSemantics === 1 /* Always */) { - error2(leftTarget, Diagnostics.This_expression_is_always_nullish); - } else { - error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish); - } - } + if (node.operatorToken.kind !== 61 /* QuestionQuestionToken */) { + return; + } + if (isBinaryExpression(node.parent)) { + const { left, operatorToken } = node.parent; + if (isBinaryExpression(left) && operatorToken.kind === 57 /* BarBarToken */) { + grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind)); + } + } else if (isBinaryExpression(node.left)) { + const { operatorToken } = node.left; + if (operatorToken.kind === 57 /* BarBarToken */ || operatorToken.kind === 56 /* AmpersandAmpersandToken */) { + grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(61 /* QuestionQuestionToken */)); + } + } else if (isBinaryExpression(node.right)) { + const { operatorToken } = node.right; + if (operatorToken.kind === 56 /* AmpersandAmpersandToken */) { + grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind)); + } + } + checkNullishCoalesceOperandLeft(node); + checkNullishCoalesceOperandRight(node); + } + function checkNullishCoalesceOperandLeft(node) { + const leftTarget = skipOuterExpressions(node.left, 63 /* All */); + const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget); + if (nullishSemantics !== 3 /* Sometimes */) { + if (nullishSemantics === 1 /* Always */) { + error2(leftTarget, Diagnostics.This_expression_is_always_nullish); + } else { + error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish); } } } + function checkNullishCoalesceOperandRight(node) { + const rightTarget = skipOuterExpressions(node.right, 63 /* All */); + const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget); + if (isNotWithinNullishCoalesceExpression(node)) { + return; + } + if (nullishSemantics === 1 /* Always */) { + error2(rightTarget, Diagnostics.This_expression_is_always_nullish); + } else if (nullishSemantics === 2 /* Never */) { + error2(rightTarget, Diagnostics.This_expression_is_never_nullish); + } + } + function isNotWithinNullishCoalesceExpression(node) { + return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */; + } function getSyntacticNullishnessSemantics(node) { node = skipOuterExpressions(node); switch (node.kind) { - case 223 /* AwaitExpression */: - case 213 /* CallExpression */: - case 215 /* TaggedTemplateExpression */: - case 212 /* ElementAccessExpression */: - case 236 /* MetaProperty */: - case 214 /* NewExpression */: - case 211 /* PropertyAccessExpression */: - case 229 /* YieldExpression */: + case 224 /* AwaitExpression */: + case 214 /* CallExpression */: + case 216 /* TaggedTemplateExpression */: + case 213 /* ElementAccessExpression */: + case 237 /* MetaProperty */: + case 215 /* NewExpression */: + case 212 /* PropertyAccessExpression */: + case 230 /* YieldExpression */: case 110 /* ThisKeyword */: return 3 /* Sometimes */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 61 /* QuestionQuestionToken */: @@ -83487,7 +84458,7 @@ function createTypeChecker(host) { return getSyntacticNullishnessSemantics(node.right); } return 2 /* Never */; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse); case 106 /* NullKeyword */: return 1 /* Always */; @@ -83501,7 +84472,7 @@ function createTypeChecker(host) { } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { const operator = operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) { + if (operator === 64 /* EqualsToken */ && (left.kind === 211 /* ObjectLiteralExpression */ || left.kind === 210 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */); } let leftType; @@ -83787,7 +84758,7 @@ function createTypeChecker(host) { } } function isIndirectCall(node) { - return node.parent.kind === 217 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 215 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. + return node.parent.kind === 218 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 216 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval"); } function checkForDisallowedESSymbolOperand(operator2) { @@ -83819,7 +84790,7 @@ function createTypeChecker(host) { } function checkAssignmentOperatorWorker() { let assigneeType = leftType; - if (isCompoundAssignment(operatorToken.kind) && left.kind === 211 /* PropertyAccessExpression */) { + if (isCompoundAssignment(operatorToken.kind) && left.kind === 212 /* PropertyAccessExpression */) { assigneeType = checkPropertyAccessExpression( left, /*checkMode*/ @@ -84025,7 +84996,7 @@ function createTypeChecker(host) { texts.push(span.literal.text); types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); } - const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ && evaluate(node).value; + const evaluated = node.parent.kind !== 216 /* TaggedTemplateExpression */ && evaluate(node).value; if (evaluated) { return getFreshTypeOfLiteralType(getStringLiteralType(evaluated)); } @@ -84092,7 +85063,7 @@ function createTypeChecker(host) { /*excludeJSDocTypeAssertions*/ true ); - return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 234 /* AsExpression */ || isJSDocTypeAssertion(node); + return node.kind === 217 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node); } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); @@ -84110,10 +85081,10 @@ function createTypeChecker(host) { checkMode || 0 /* Normal */ ) : checkExpressionCached(initializer, checkMode)); if (isParameter(isBindingElement(declaration) ? walkUpBindingElementsAndPatterns(declaration) : declaration)) { - if (declaration.name.kind === 206 /* ObjectBindingPattern */ && isObjectLiteralType2(type)) { + if (declaration.name.kind === 207 /* ObjectBindingPattern */ && isObjectLiteralType2(type)) { return padObjectLiteralType(type, declaration.name); } - if (declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type)) { + if (declaration.name.kind === 208 /* ArrayBindingPattern */ && isTupleType(type)) { return padTupleType(type, declaration.name); } } @@ -84164,7 +85135,7 @@ function createTypeChecker(host) { const elementFlags = type.target.elementFlags.slice(); for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) { const e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 209 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement( e, /*includePatternInType*/ @@ -84228,14 +85199,14 @@ function createTypeChecker(host) { )); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -84299,7 +85270,7 @@ function createTypeChecker(host) { } } } - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice()); + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context)); } } } @@ -84426,7 +85397,7 @@ function createTypeChecker(host) { expr, /*requireStringLiteralLikeArgument*/ true - ) && !isSymbolOrSymbolForCall(expr)) { + ) && !isSymbolOrSymbolForCall(expr) && !isImportCall(expr)) { return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { return getTypeFromTypeNode(expr.type); @@ -84466,7 +85437,8 @@ function createTypeChecker(host) { return type; } function checkConstEnumAccess(node, type) { - const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 281 /* ExportSpecifier */; + var _a; + const ok = node.parent.kind === 212 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 213 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 167 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 187 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 282 /* ExportSpecifier */; if (!ok) { error2(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -84483,7 +85455,7 @@ function createTypeChecker(host) { )) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; - const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath); + const redirect = (_a = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _a.resolvedRef; if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) { error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } @@ -84504,9 +85476,9 @@ function createTypeChecker(host) { const kind = node.kind; if (cancellationToken) { switch (kind) { - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -84537,82 +85509,82 @@ function createTypeChecker(host) { return trueType; case 97 /* FalseKeyword */: return falseType; - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return checkTemplateExpression(node); case 14 /* RegularExpressionLiteral */: return checkRegularExpressionLiteral(node); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node, checkMode); - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return checkQualifiedName(node, checkMode); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return checkIndexedAccess(node, checkMode); - case 213 /* CallExpression */: - if (node.expression.kind === 102 /* ImportKeyword */) { + case 214 /* CallExpression */: + if (isImportCall(node)) { return checkImportCallExpression(node); } // falls through - case 214 /* NewExpression */: + case 215 /* NewExpression */: return checkCallExpression(node, checkMode); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return checkClassExpression(node); - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 221 /* TypeOfExpression */: + case 222 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return checkAssertion(node, checkMode); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return checkNonNullAssertion(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return checkExpressionWithTypeArguments(node); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return checkSatisfiesExpression(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return checkMetaProperty(node); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return checkDeleteExpression(node); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return checkVoidExpression(node); - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return checkAwaitExpression(node); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 232 /* OmittedExpression */: + case 233 /* OmittedExpression */: return undefinedWideningType; - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return checkYieldExpression(node); - case 237 /* SyntheticExpression */: + case 238 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 284 /* JsxElement */: + case 285 /* JsxElement */: return checkJsxElement(node, checkMode); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return checkJsxFragment(node); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 286 /* JsxOpeningElement */: + case 287 /* JsxOpeningElement */: Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -84667,10 +85639,10 @@ function createTypeChecker(host) { if (compilerOptions.erasableSyntaxOnly) { error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); } - if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) { + if (!(func.kind === 177 /* Constructor */ && nodeIsPresent(func.body))) { error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 177 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") { error2(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -84681,13 +85653,13 @@ function createTypeChecker(host) { if (func.parameters.indexOf(node) !== 0) { error2(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) { + if (func.kind === 177 /* Constructor */ || func.kind === 181 /* ConstructSignature */ || func.kind === 186 /* ConstructorType */) { error2(node, Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 219 /* ArrowFunction */) { + if (func.kind === 220 /* ArrowFunction */) { error2(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) { + if (func.kind === 178 /* GetAccessor */ || func.kind === 179 /* SetAccessor */) { error2(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -84745,13 +85717,13 @@ function createTypeChecker(host) { } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 219 /* ArrowFunction */: - case 179 /* CallSignature */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 184 /* FunctionType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 220 /* ArrowFunction */: + case 180 /* CallSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 185 /* FunctionType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: const parent2 = node.parent; if (node === parent2.type) { return parent2; @@ -84767,7 +85739,7 @@ function createTypeChecker(host) { if (name.kind === 80 /* Identifier */ && name.escapedText === predicateVariableName) { error2(predicateVariableNode, Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; - } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) { + } else if (name.kind === 208 /* ArrayBindingPattern */ || name.kind === 207 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern( name, predicateVariableNode, @@ -84779,9 +85751,9 @@ function createTypeChecker(host) { } } function checkSignatureDeclaration(node) { - if (node.kind === 181 /* IndexSignature */) { + if (node.kind === 182 /* IndexSignature */) { checkGrammarIndexSignature(node); - } else if (node.kind === 184 /* FunctionType */ || node.kind === 262 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) { + } else if (node.kind === 185 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 186 /* ConstructorType */ || node.kind === 180 /* CallSignature */ || node.kind === 177 /* Constructor */ || node.kind === 181 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } const functionFlags = getFunctionFlags(node); @@ -84819,10 +85791,10 @@ function createTypeChecker(host) { } if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: error2(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: error2(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -84840,7 +85812,7 @@ function createTypeChecker(host) { checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation); } } - if (node.kind !== 181 /* IndexSignature */ && node.kind !== 317 /* JSDocFunctionType */) { + if (node.kind !== 182 /* IndexSignature */ && node.kind !== 318 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -84857,7 +85829,7 @@ function createTypeChecker(host) { const staticNames = /* @__PURE__ */ new Map(); const privateIdentifiers = /* @__PURE__ */ new Map(); for (const member of node.members) { - if (member.kind === 176 /* Constructor */) { + if (member.kind === 177 /* Constructor */) { for (const param of member.parameters) { if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) { addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */); @@ -84875,16 +85847,16 @@ function createTypeChecker(host) { const memberName = name && getEffectivePropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags); break; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags); break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags); break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */ | privateStaticFlags); break; } @@ -84941,7 +85913,7 @@ function createTypeChecker(host) { function checkObjectTypeForDuplicateDeclarations(node) { const names = /* @__PURE__ */ new Map(); for (const member of node.members) { - if (member.kind === 171 /* PropertySignature */) { + if (member.kind === 172 /* PropertySignature */) { let memberName; const name = member.name; switch (name.kind) { @@ -84965,7 +85937,7 @@ function createTypeChecker(host) { } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 264 /* InterfaceDeclaration */) { + if (node.kind === 265 /* InterfaceDeclaration */) { const nodeSymbol = getSymbolOfDeclaration(node); if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -85001,7 +85973,7 @@ function createTypeChecker(host) { if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); - if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) { + if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 173 /* PropertyDeclaration */ && node.initializer) { error2(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name)); } } @@ -85017,7 +85989,7 @@ function createTypeChecker(host) { error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator); } checkFunctionOrMethodDeclaration(node); - if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) { + if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 175 /* MethodDeclaration */ && node.body) { error2(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); } if (isPrivateIdentifier(node.name) && !getContainingClass(node)) { @@ -85063,7 +86035,7 @@ function createTypeChecker(host) { if (isPrivateIdentifierClassElementDeclaration(n)) { return true; } - return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; + return n.kind === 173 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; } function checkConstructorDeclarationDiagnostics() { const containingClassDecl = node.parent; @@ -85125,20 +86097,20 @@ function createTypeChecker(host) { if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node)) checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { if (!(node.flags & 33554432 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 512 /* HasImplicitReturn */) { if (!(node.flags & 1024 /* HasExplicitReturn */)) { error2(node.name, Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (hasBindableName(node)) { const symbol = getSymbolOfDeclaration(node); - const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */); + const getter = getDeclarationOfKind(symbol, 178 /* GetAccessor */); + const setter = getDeclarationOfKind(symbol, 179 /* SetAccessor */); if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) { getNodeLinks(getter).flags |= 1 /* TypeChecked */; const getterFlags = getEffectiveModifierFlags(getter); @@ -85154,7 +86126,7 @@ function createTypeChecker(host) { } } const returnType = getTypeOfAccessors(getSymbolOfDeclaration(node)); - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -85210,7 +86182,7 @@ function createTypeChecker(host) { } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 183 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + if (node.kind === 184 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { const sourceFile = getSourceFileOfNode(node); if (scanTokenAtPosition(sourceFile, node.typeName.end) === 25 /* DotToken */) { grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); @@ -85314,7 +86286,7 @@ function createTypeChecker(host) { const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */); const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType); if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) { - if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { + if (accessNode.kind === 213 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error2(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -85371,7 +86343,7 @@ function createTypeChecker(host) { forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) { + if (!findAncestor(node, (n) => n.parent && n.parent.kind === 195 /* ConditionalType */ && n.parent.extendsType === n)) { grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -85381,7 +86353,7 @@ function createTypeChecker(host) { if (!links.typeParametersChecked) { links.typeParametersChecked = true; const typeParameter = getDeclaredTypeOfTypeParameter(symbol); - const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */); + const declarations = getDeclarationsOfKind(symbol, 169 /* TypeParameter */); if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) { const name = symbolToString(symbol); for (const declaration of declarations) { @@ -85411,10 +86383,10 @@ function createTypeChecker(host) { if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 190 /* OptionalType */) { + if (node.type.kind === 191 /* OptionalType */) { grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 191 /* RestType */) { + if (node.type.kind === 192 /* RestType */) { grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -85425,7 +86397,7 @@ function createTypeChecker(host) { } function getEffectiveDeclarationFlags(n, flagsToCheck) { let flags = getCombinedModifierFlagsCached(n); - if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) { + if (n.parent.kind !== 265 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) { const container = getEnclosingContainer(n); if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) { flags |= 32 /* Export */; @@ -85506,7 +86478,7 @@ function createTypeChecker(host) { (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || // Both are computed property names isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) && isTypeIdenticalTo(checkComputedPropertyName(node.name), checkComputedPropertyName(subsequentName)) || // Both are literal property names that are the same. isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); + const reportError = (node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); if (reportError) { const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; error2(errorNode2, diagnostic); @@ -85538,14 +86510,14 @@ function createTypeChecker(host) { for (const current of declarations) { const node = current; const inAmbientContext = node.flags & 33554432 /* Ambient */; - const inAmbientContextOrInterface = node.parent && (node.parent.kind === 264 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext; + const inAmbientContextOrInterface = node.parent && (node.parent.kind === 265 /* InterfaceDeclaration */ || node.parent.kind === 188 /* TypeLiteral */) || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = void 0; } - if ((node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 262 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) { + if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */ || node.kind === 177 /* Constructor */) { functionDeclarations.push(node); const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -85590,9 +86562,9 @@ function createTypeChecker(host) { }); } if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) { - const relatedDiagnostics = filter(declarations, (d) => d.kind === 263 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); + const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); forEach(declarations, (declaration) => { - const diagnostic = declaration.kind === 263 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 262 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; + const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; if (diagnostic) { addRelatedInfo( error2(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)), @@ -85672,24 +86644,24 @@ function createTypeChecker(host) { function getDeclarationSpaces(decl) { let d = decl; switch (d.kind) { - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return 2 /* ExportType */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 307 /* SourceFile */: + case 308 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 277 /* ExportAssignment */: - case 226 /* BinaryExpression */: + case 278 /* ExportAssignment */: + case 227 /* BinaryExpression */: const node2 = d; const expression = isExportAssignment(node2) ? node2.expression : node2.right; if (!isEntityNameExpression(expression)) { @@ -85698,24 +86670,24 @@ function createTypeChecker(host) { d = expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 271 /* ImportEqualsDeclaration */: - case 274 /* NamespaceImport */: - case 273 /* ImportClause */: + case 272 /* ImportEqualsDeclaration */: + case 275 /* NamespaceImport */: + case 274 /* ImportClause */: let result = 0 /* None */; const target = resolveAlias(getSymbolOfDeclaration(d)); forEach(target.declarations, (d2) => { result |= getDeclarationSpaces(d2); }); return result; - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: - case 262 /* FunctionDeclaration */: - case 276 /* ImportSpecifier */: + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 263 /* FunctionDeclaration */: + case 277 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 80 /* Identifier */: return 1 /* ExportValue */; - case 173 /* MethodSignature */: - case 171 /* PropertySignature */: + case 174 /* MethodSignature */: + case 172 /* PropertySignature */: return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); @@ -86051,22 +87023,22 @@ function createTypeChecker(host) { let headMessage; const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (!legacyDecorators) { headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; } // falls through - case 169 /* Parameter */: + case 170 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; break; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; default: @@ -86111,15 +87083,15 @@ function createTypeChecker(host) { function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 193 /* IntersectionType */: - case 192 /* UnionType */: + case 194 /* IntersectionType */: + case 193 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 196 /* ParenthesizedType */: - case 202 /* NamedTupleMember */: + case 197 /* ParenthesizedType */: + case 203 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return node.typeName; } } @@ -86127,13 +87099,13 @@ function createTypeChecker(host) { function getEntityNameForDecoratorMetadataFromTypeList(types) { let commonEntityName; for (let typeNode of types) { - while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) { + while (typeNode.kind === 197 /* ParenthesizedType */ || typeNode.kind === 203 /* NamedTupleMember */) { typeNode = typeNode.type; } if (typeNode.kind === 146 /* NeverKeyword */) { continue; } - if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 202 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { continue; } const individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -86164,7 +87136,7 @@ function createTypeChecker(host) { } if (legacyDecorators) { checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 169 /* Parameter */) { + if (node.kind === 170 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } } else if (languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators) { @@ -86303,7 +87275,7 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: return node; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return node.name; default: return void 0; @@ -86314,7 +87286,7 @@ function createTypeChecker(host) { checkDecorators(node); checkSignatureDeclaration(node); const functionFlags = getFunctionFlags(node); - if (node.name && node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (hasBindableName(node)) { @@ -86331,7 +87303,7 @@ function createTypeChecker(host) { checkFunctionOrConstructorSymbol(symbol); } } - const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body; + const body = node.kind === 174 /* MethodSignature */ ? void 0 : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics); @@ -86367,42 +87339,42 @@ function createTypeChecker(host) { function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) { for (const node of potentiallyUnusedIdentifiers) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 307 /* SourceFile */: - case 267 /* ModuleDeclaration */: - case 241 /* Block */: - case 269 /* CaseBlock */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 308 /* SourceFile */: + case 268 /* ModuleDeclaration */: + case 242 /* Block */: + case 270 /* CaseBlock */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 176 /* Constructor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 195 /* InferType */: + case 196 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -86421,11 +87393,11 @@ function createTypeChecker(host) { function checkUnusedClassMembers(node, addDiagnostic) { for (const member of node.members) { switch (member.kind) { - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + if (member.kind === 179 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { break; } const symbol = getSymbolOfDeclaration(member); @@ -86433,16 +87405,16 @@ function createTypeChecker(host) { addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 176 /* Constructor */: + case 177 /* Constructor */: for (const parameter of member.parameters) { if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) { addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol))); } } break; - case 181 /* IndexSignature */: - case 240 /* SemicolonClassElement */: - case 175 /* ClassStaticBlockDeclaration */: + case 182 /* IndexSignature */: + case 241 /* SemicolonClassElement */: + case 176 /* ClassStaticBlockDeclaration */: break; default: Debug.fail("Unexpected class member"); @@ -86464,7 +87436,7 @@ function createTypeChecker(host) { if (!isTypeParameterUnused(typeParameter)) continue; const name = idText(typeParameter.name); const { parent: parent2 } = typeParameter; - if (parent2.kind !== 195 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { + if (parent2.kind !== 196 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { if (tryAddToSet(seenParentsWithEveryUnused, parent2)) { const sourceFile = getSourceFileOfNode(parent2); const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters); @@ -86547,7 +87519,7 @@ function createTypeChecker(host) { }); unusedImports.forEach(([importClause, unuseds]) => { const importDecl = importClause.parent; - const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 274 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0); + const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 275 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0); if (nDeclarations === unuseds.length) { addDiagnostic( importDecl, @@ -86561,7 +87533,7 @@ function createTypeChecker(host) { unusedDestructures.forEach(([bindingPattern, bindingElements]) => { const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 260 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 261 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { addDiagnostic( @@ -86581,7 +87553,7 @@ function createTypeChecker(host) { addDiagnostic( declarationList, 0 /* Local */, - declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 243 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused) + declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 244 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused) ); } else { for (const decl of declarations) { @@ -86611,21 +87583,21 @@ function createTypeChecker(host) { switch (name.kind) { case 80 /* Identifier */: return idText(name); - case 207 /* ArrayBindingPattern */: - case 206 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: return bindingNameText(cast(first(name.elements), isBindingElement).name); default: return Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 273 /* ImportClause */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 274 /* NamespaceImport */; + return node.kind === 274 /* ImportClause */ || node.kind === 277 /* ImportSpecifier */ || node.kind === 275 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 273 /* ImportClause */ ? decl : decl.kind === 274 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 274 /* ImportClause */ ? decl : decl.kind === 275 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { - if (node.kind === 241 /* Block */) { + if (node.kind === 242 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (isFunctionOrModuleBlock(node)) { @@ -86653,7 +87625,7 @@ function createTypeChecker(host) { if ((identifier == null ? void 0 : identifier.escapedText) !== name) { return false; } - if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 303 /* PropertyAssignment */) { + if (node.kind === 173 /* PropertyDeclaration */ || node.kind === 172 /* PropertySignature */ || node.kind === 175 /* MethodDeclaration */ || node.kind === 174 /* MethodSignature */ || node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */ || node.kind === 304 /* PropertyAssignment */) { return false; } if (node.flags & 33554432 /* Ambient */) { @@ -86709,7 +87681,7 @@ function createTypeChecker(host) { return; } const parent2 = getDeclarationContainer(node); - if (parent2.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) { + if (parent2.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) { errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name)); } } @@ -86721,7 +87693,7 @@ function createTypeChecker(host) { return; } const parent2 = getDeclarationContainer(node); - if (parent2.kind === 307 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 4096 /* HasAsyncFunctions */) { + if (parent2.kind === 308 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 4096 /* HasAsyncFunctions */) { errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name), declarationNameToString(name)); } } @@ -86799,9 +87771,9 @@ function createTypeChecker(host) { ); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 7 /* BlockScoped */) { - const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 261 /* VariableDeclarationList */); - const container = varDeclList.parent.kind === 243 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; - const namesShareScope = container && (container.kind === 241 /* Block */ && isFunctionLike(container.parent) || container.kind === 268 /* ModuleBlock */ || container.kind === 267 /* ModuleDeclaration */ || container.kind === 307 /* SourceFile */); + const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */); + const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; + const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 269 /* ModuleBlock */ || container.kind === 268 /* ModuleDeclaration */ || container.kind === 308 /* SourceFile */); if (!namesShareScope) { const name = symbolToString(localDeclarationSymbol); error2(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -86822,7 +87794,7 @@ function createTypeChecker(host) { if (!node.name) { return; } - if (node.name.kind === 167 /* ComputedPropertyName */) { + if (node.name.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (hasOnlyExpressionInitializer(node) && node.initializer) { checkExpressionCached(node.initializer); @@ -86836,7 +87808,7 @@ function createTypeChecker(host) { if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) { checkExternalEmitHelpers(node, 4 /* Rest */); } - if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 168 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } const parent2 = node.parent.parent; @@ -86869,7 +87841,7 @@ function createTypeChecker(host) { } } if (isBindingPattern(node.name)) { - if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) { + if (node.name.kind === 208 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } forEach(node.name.elements, checkSourceElement); @@ -86882,7 +87854,7 @@ function createTypeChecker(host) { if (isInAmbientOrTypeNode(node)) { return; } - const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */; + const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */; const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression)); if (needCheckInitializer || needCheckWidenedType) { const widenedType = getWidenedTypeForVariableLikeDeclaration(node); @@ -86917,7 +87889,7 @@ function createTypeChecker(host) { const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node); if (initializer) { const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a = symbol.exports) == null ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 250 /* ForInStatement */) { const initializerType = checkExpressionCached(initializer); checkTypeAssignableToAndOptionallyElaborate( initializerType, @@ -86977,9 +87949,9 @@ function createTypeChecker(host) { error2(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); } } - if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */) { + if (node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 172 /* PropertySignature */) { checkExportsOnMergedDeclarations(node); - if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { + if (node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionsForDeclarationName(node, node.name); @@ -86987,7 +87959,7 @@ function createTypeChecker(host) { } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { const nextDeclarationName = getNameOfDeclaration(nextDeclaration); - const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; + const message = nextDeclaration.kind === 173 /* PropertyDeclaration */ || nextDeclaration.kind === 172 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; const declName = declarationNameToString(nextDeclarationName); const err = error2( nextDeclarationName, @@ -87001,7 +87973,7 @@ function createTypeChecker(host) { } } function areDeclarationFlagsIdentical(left, right) { - if (left.kind === 169 /* Parameter */ && right.kind === 260 /* VariableDeclaration */ || left.kind === 260 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) { + if (left.kind === 170 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 170 /* Parameter */) { return true; } if (hasQuestionToken(left) !== hasQuestionToken(right)) { @@ -87041,7 +88013,7 @@ function createTypeChecker(host) { const type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(node.expression, type, node.thenStatement); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 242 /* EmptyStatement */) { + if (node.thenStatement.kind === 243 /* EmptyStatement */) { error2(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -87180,23 +88152,23 @@ function createTypeChecker(host) { return 3 /* Sometimes */; } return 1 /* Always */; - case 209 /* ArrayLiteralExpression */: - case 219 /* ArrowFunction */: + case 210 /* ArrayLiteralExpression */: + case 220 /* ArrowFunction */: case 10 /* BigIntLiteral */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 284 /* JsxElement */: - case 285 /* JsxSelfClosingElement */: - case 210 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 285 /* JsxElement */: + case 286 /* JsxSelfClosingElement */: + case 211 /* ObjectLiteralExpression */: case 14 /* RegularExpressionLiteral */: return 1 /* Always */; - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: case 106 /* NullKeyword */: return 2 /* Never */; case 15 /* NoSubstitutionTemplateLiteral */: case 11 /* StringLiteral */: return !!node.text ? 1 /* Always */ : 2 /* Never */; - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse); case 80 /* Identifier */: if (getResolvedSymbol(node) === undefinedSymbol) { @@ -87211,12 +88183,12 @@ function createTypeChecker(host) { } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer.kind === 262 /* VariableDeclarationList */) { checkVariableDeclarationList(node.initializer); } else { checkExpression(node.initializer); @@ -87244,12 +88216,12 @@ function createTypeChecker(host) { } else if (compilerOptions.downlevelIteration && languageVersion < LanguageFeatureMinimumTarget.ForOf) { checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); } - if (node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer.kind === 262 /* VariableDeclarationList */) { checkVariableDeclarationList(node.initializer); } else { const varExpr = node.initializer; const iteratedType = checkRightHandSideOfForOf(node); - if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) { + if (varExpr.kind === 210 /* ArrayLiteralExpression */ || varExpr.kind === 211 /* ObjectLiteralExpression */) { checkDestructuringAssignment(varExpr, iteratedType || errorType); } else { const leftType = checkExpression(varExpr); @@ -87271,7 +88243,7 @@ function createTypeChecker(host) { function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 261 /* VariableDeclarationList */) { + if (node.initializer.kind === 262 /* VariableDeclarationList */) { const variable = node.initializer.declarations[0]; if (variable && isBindingPattern(variable.name)) { error2(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -87280,7 +88252,7 @@ function createTypeChecker(host) { } else { const varExpr = node.initializer; const leftType = checkExpression(varExpr); - if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) { + if (varExpr.kind === 210 /* ArrayLiteralExpression */ || varExpr.kind === 211 /* ObjectLiteralExpression */) { error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); @@ -87470,6 +88442,9 @@ function createTypeChecker(host) { } function getIterationTypesOfIterable(type, use, errorNode) { var _a, _b; + if (type === silentNeverType) { + return silentNeverIterationTypes; + } if (isTypeAny(type)) { return anyIterationTypes; } @@ -87942,11 +88917,11 @@ function createTypeChecker(host) { const returnType = getReturnTypeOfSignature(signature); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (container.kind === 178 /* SetAccessor */) { + if (container.kind === 179 /* SetAccessor */) { if (node.expression) { error2(node, Diagnostics.Setters_cannot_return_a_value); } - } else if (container.kind === 176 /* Constructor */) { + } else if (container.kind === 177 /* Constructor */) { const exprType2 = node.expression ? checkExpressionCached(node.expression) : undefinedType; if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType2, returnType, node, node.expression)) { error2(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); @@ -87955,7 +88930,7 @@ function createTypeChecker(host) { const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(container)) ?? returnType; checkReturnExpression(container, unwrappedReturnType, node, node.expression, exprType); } - } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { + } else if (container.kind !== 177 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { error2(node, Diagnostics.Not_all_code_paths_return_a_value); } } @@ -87986,7 +88961,7 @@ function createTypeChecker(host) { return; } } - const inReturnStatement = node.kind === 253 /* ReturnStatement */; + const inReturnStatement = node.kind === 254 /* ReturnStatement */; const unwrappedExprType = functionFlags & 2 /* Async */ ? checkAwaitedType( exprType, /*withAlias*/ @@ -88018,7 +88993,7 @@ function createTypeChecker(host) { let hasDuplicateDefaultClause = false; const expressionType = checkExpression(node.expression); forEach(node.caseBlock.clauses, (clause) => { - if (clause.kind === 297 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 298 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === void 0) { firstDefaultClause = clause; } else { @@ -88026,7 +89001,7 @@ function createTypeChecker(host) { hasDuplicateDefaultClause = true; } } - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause)); } forEach(clause.statements, checkSourceElement); @@ -88058,7 +89033,7 @@ function createTypeChecker(host) { if (isFunctionLike(current)) { return "quit"; } - if (current.kind === 256 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label)); return true; } @@ -88148,8 +89123,8 @@ function createTypeChecker(host) { return; } const indexInfos = getApplicableIndexInfos(type, propNameType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 264 /* InterfaceDeclaration */) : void 0; - const propDeclaration = declaration && declaration.kind === 226 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0; + const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 265 /* InterfaceDeclaration */) : void 0; + const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 168 /* ComputedPropertyName */ ? declaration : void 0; const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0; for (const info of indexInfos) { const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfDeclaration(info.declaration)) === type.symbol ? info.declaration : void 0; @@ -88166,7 +89141,7 @@ function createTypeChecker(host) { function checkIndexConstraintForIndexSignature(type, checkInfo) { const declaration = checkInfo.declaration; const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 264 /* InterfaceDeclaration */) : void 0; + const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 265 /* InterfaceDeclaration */) : void 0; const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfDeclaration(declaration)) === type.symbol ? declaration : void 0; for (const info of indexInfos) { if (info === checkInfo) continue; @@ -88195,7 +89170,7 @@ function createTypeChecker(host) { } function checkClassNameCollisionWithObject(name) { if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < 5 /* ES2015 */) { - error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); + error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]); } } function checkUnmatchedJSDocParameters(node) { @@ -88264,7 +89239,7 @@ function createTypeChecker(host) { function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 183 /* TypeReference */) { + if (node.kind === 184 /* TypeReference */) { const type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (let i = index; i < typeParameters.length; i++) { @@ -88719,7 +89694,7 @@ function createTypeChecker(host) { return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { - return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */); + return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 265 /* InterfaceDeclaration */); } function checkKindsOfPropertyMemberOverrides(type, baseType) { var _a, _b, _c, _d, _e; @@ -88772,7 +89747,7 @@ function createTypeChecker(host) { const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor; error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (useDefineForClassFields) { - const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer); + const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 173 /* PropertyDeclaration */ && !d.initializer); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_e = derived.declarations) == null ? void 0 : _e.some((d) => !!(d.flags & 33554432 /* Ambient */)))) { const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol)); const propName = uninitialized.name; @@ -88906,7 +89881,7 @@ function createTypeChecker(host) { } } function isPropertyWithoutInitializer(node) { - return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; + return node.kind === 173 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; } function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) { for (const staticBlock of staticBlocks) { @@ -88942,7 +89917,7 @@ function createTypeChecker(host) { checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); checkTypeParameterListsIdentical(symbol); - const firstInterfaceDecl = getDeclarationOfKind(symbol, 264 /* InterfaceDeclaration */); + const firstInterfaceDecl = getDeclarationOfKind(symbol, 265 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { const type = getDeclaredTypeOfSymbol(symbol); const typeWithThis = getTypeWithThisArgument(type); @@ -89003,6 +89978,8 @@ function createTypeChecker(host) { function computeEnumMemberValue(member, autoValue, previous) { if (isComputedNonLiteralName(member.name)) { error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); + } else if (isBigIntLiteral(member.name)) { + error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } else { const text = getTextOfPropertyName(member.name); if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { @@ -89178,7 +90155,7 @@ function createTypeChecker(host) { checkGrammarModifiers(node); checkCollisionsForDeclarationName(node, node.name); checkExportsOnMergedDeclarations(node); - node.members.forEach(checkEnumMember); + node.members.forEach(checkSourceElement); if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) { error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); } @@ -89196,7 +90173,7 @@ function createTypeChecker(host) { } let seenEnumMissingInitialInitializer = false; forEach(enumSymbol.declarations, (declaration) => { - if (declaration.kind !== 266 /* EnumDeclaration */) { + if (declaration.kind !== 267 /* EnumDeclaration */) { return false; } const enumDeclaration = declaration; @@ -89226,7 +90203,7 @@ function createTypeChecker(host) { const declarations = symbol.declarations; if (declarations) { for (const declaration of declarations) { - if ((declaration.kind === 263 /* ClassDeclaration */ || declaration.kind === 262 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432 /* Ambient */)) { + if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432 /* Ambient */)) { return declaration; } } @@ -89298,12 +90275,12 @@ function createTypeChecker(host) { error2(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - const mergedClass = getDeclarationOfKind(symbol, 263 /* ClassDeclaration */); + const mergedClass = getDeclarationOfKind(symbol, 264 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 307 /* SourceFile */ && host.getEmitModuleFormatOfFile(node.parent) === 1 /* CommonJS */) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 /* SourceFile */ && host.getEmitModuleFormatOfFile(node.parent) === 1 /* CommonJS */) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 95 /* ExportKeyword */); if (exportModifier) { error2(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); @@ -89336,23 +90313,23 @@ function createTypeChecker(host) { } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: for (const decl of node.declarationList.declarations) { checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: if (isInternalModuleImportEqualsDeclaration(node)) break; // falls through - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 208 /* BindingElement */: - case 260 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 261 /* VariableDeclaration */: const name = node.name; if (isBindingPattern(name)) { for (const el of name.elements) { @@ -89361,12 +90338,12 @@ function createTypeChecker(host) { break; } // falls through - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 262 /* FunctionDeclaration */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 263 /* FunctionDeclaration */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 266 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -89377,12 +90354,12 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: return node; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: do { node = node.left; } while (node.kind !== 80 /* Identifier */); return node; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: do { if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) { return node.name; @@ -89401,11 +90378,11 @@ function createTypeChecker(host) { error2(moduleName, Diagnostics.String_literal_expected); return false; } - const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - if (node.parent.kind !== 307 /* SourceFile */ && !inAmbientExternalModule) { + const inAmbientExternalModule = node.parent.kind === 269 /* ModuleBlock */ && isAmbientModule(node.parent.parent); + if (node.parent.kind !== 308 /* SourceFile */ && !inAmbientExternalModule) { error2( moduleName, - node.kind === 278 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module + node.kind === 279 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module ); return false; } @@ -89439,15 +90416,15 @@ function createTypeChecker(host) { } } function checkAliasSymbol(node) { - var _a, _b, _c, _d; + var _a, _b, _c, _d, _e; let symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target !== unknownSymbol) { symbol = getMergedSymbol(symbol.exportSymbol || symbol); if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) { const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node; - Debug.assert(node.kind !== 280 /* NamespaceExport */); - if (node.kind === 281 /* ExportSpecifier */) { + Debug.assert(node.kind !== 281 /* NamespaceExport */); + if (node.kind === 282 /* ExportSpecifier */) { const diag2 = error2(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files); const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get(moduleExportNameTextEscaped(node.propertyName || node.name)); if (alreadyExportedSymbol === target) { @@ -89464,7 +90441,7 @@ function createTypeChecker(host) { } } } else { - Debug.assert(node.kind !== 260 /* VariableDeclaration */); + Debug.assert(node.kind !== 261 /* VariableDeclaration */); const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)); const moduleSpecifier = (importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) ?? "..."; const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName); @@ -89480,9 +90457,9 @@ function createTypeChecker(host) { const targetFlags = getSymbolFlags(target); const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (targetFlags & excludedMeanings) { - const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + const message = node.kind === 282 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error2(node, message, symbolToString(symbol)); - } else if (node.kind !== 281 /* ExportSpecifier */) { + } else if (node.kind !== 282 /* ExportSpecifier */) { const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration); if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) { error2( @@ -89498,25 +90475,25 @@ function createTypeChecker(host) { const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { switch (node.kind) { - case 273 /* ImportClause */: - case 276 /* ImportSpecifier */: - case 271 /* ImportEqualsDeclaration */: { + case 274 /* ImportClause */: + case 277 /* ImportSpecifier */: + case 272 /* ImportEqualsDeclaration */: { if (compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled; - const name = moduleExportNameTextUnescaped(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); + const name = moduleExportNameTextUnescaped(node.kind === 277 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( error2(node, message, name), isType ? void 0 : typeOnlyAlias, name ); } - if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) { + if (isType && node.kind === 272 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) { error2(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } - case 281 /* ExportSpecifier */: { + case 282 /* ExportSpecifier */: { if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = moduleExportNameTextUnescaped(node.propertyName || node.name); const diagnostic = isType ? error2(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error2(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); @@ -89526,14 +90503,14 @@ function createTypeChecker(host) { } } } - if (compilerOptions.verbatimModuleSyntax && node.kind !== 271 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { - error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); - } else if (moduleKind === 200 /* Preserve */ && node.kind !== 271 /* ImportEqualsDeclaration */ && node.kind !== 260 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { - error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve); + if (compilerOptions.verbatimModuleSyntax && node.kind !== 272 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { + error2(node, getVerbatimModuleSyntaxErrorMessage(node)); + } else if (moduleKind === 200 /* Preserve */ && node.kind !== 272 /* ImportEqualsDeclaration */ && node.kind !== 261 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { + error2(node, Diagnostics.ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve); } if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) { const constEnumDeclaration = target.valueDeclaration; - const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath); + const redirect = (_e = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _e.resolvedRef; if (constEnumDeclaration.flags & 33554432 /* Ambient */ && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) { error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } @@ -89575,7 +90552,7 @@ function createTypeChecker(host) { function checkImportBinding(node) { checkCollisionsForDeclarationName(node, node.name); checkAliasSymbol(node); - if (node.kind === 276 /* ImportSpecifier */) { + if (node.kind === 277 /* ImportSpecifier */) { checkModuleExportName(node.propertyName); if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) { checkExternalEmitHelpers(node, 131072 /* ImportDefault */); @@ -89602,10 +90579,10 @@ function createTypeChecker(host) { if (!moduleSupportsImportAttributes(moduleKind)) { return grammarErrorOnNode( node, - isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve + isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve ); } - if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) { + if (102 /* Node20 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ && !isImportAttributes2) { return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert); } if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) { @@ -89641,7 +90618,7 @@ function createTypeChecker(host) { checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && getESModuleInterop(compilerOptions)) { checkExternalEmitHelpers(node, 65536 /* ImportStar */); @@ -89679,7 +90656,7 @@ function createTypeChecker(host) { if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); markLinkedReferences(node, 6 /* ExportImportEquals */); - if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 284 /* ExternalModuleReference */) { const target = resolveAlias(getSymbolOfDeclaration(node)); if (target !== unknownSymbol) { const targetFlags = getSymbolFlags(target); @@ -89714,9 +90691,9 @@ function createTypeChecker(host) { if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause && !isNamespaceExport(node.exportClause)) { forEach(node.exportClause.elements, checkExportSpecifier); - const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 268 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 33554432 /* Ambient */; - if (node.parent.kind !== 307 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + const inAmbientExternalModule = node.parent.kind === 269 /* ModuleBlock */ && isAmbientModule(node.parent.parent); + const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 269 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 33554432 /* Ambient */; + if (node.parent.kind !== 308 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error2(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { @@ -89742,13 +90719,13 @@ function createTypeChecker(host) { } function checkGrammarExportDeclaration(node) { var _a; - if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 279 /* NamedExports */) { + if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 280 /* NamedExports */) { return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } function checkGrammarModuleElementContext(node, errorMessage) { - const isInAppropriateContext = node.parent.kind === 307 /* SourceFile */ || node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 267 /* ModuleDeclaration */; + const isInAppropriateContext = node.parent.kind === 308 /* SourceFile */ || node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 268 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -89799,8 +90776,8 @@ function createTypeChecker(host) { if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) { error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); } - const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) { + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 268 /* ModuleDeclaration */ && !isAmbientModule(container)) { if (node.isExportEquals) { error2(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } else { @@ -89888,7 +90865,7 @@ function createTypeChecker(host) { checkExpressionCached(node.expression); } if (isIllegalExportDefaultInCJS) { - error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + error2(node, getVerbatimModuleSyntaxErrorMessage(node)); } checkExternalModuleExports(container); if (node.flags & 33554432 /* Ambient */ && !isEntityNameExpression(node.expression)) { @@ -89973,187 +90950,189 @@ function createTypeChecker(host) { const kind = node.kind; if (cancellationToken) { switch (kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 243 /* FirstStatement */ && kind <= 259 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected); } switch (kind) { - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return checkTypeParameter(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return checkParameter(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return checkPropertySignature(node); - case 185 /* ConstructorType */: - case 184 /* FunctionType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 181 /* IndexSignature */: + case 186 /* ConstructorType */: + case 185 /* FunctionType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 182 /* IndexSignature */: return checkSignatureDeclaration(node); - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return checkMethodDeclaration(node); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return checkClassStaticBlockDeclaration(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return checkConstructorDeclaration(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return checkAccessorDeclaration(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return checkTypeReferenceNode(node); - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return checkTypePredicate(node); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return checkTypeQuery(node); - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return checkTypeLiteral(node); - case 188 /* ArrayType */: + case 189 /* ArrayType */: return checkArrayType(node); - case 189 /* TupleType */: + case 190 /* TupleType */: return checkTupleType(node); - case 192 /* UnionType */: - case 193 /* IntersectionType */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 196 /* ParenthesizedType */: - case 190 /* OptionalType */: - case 191 /* RestType */: + case 197 /* ParenthesizedType */: + case 191 /* OptionalType */: + case 192 /* RestType */: return checkSourceElement(node.type); - case 197 /* ThisType */: + case 198 /* ThisType */: return checkThisType(node); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return checkTypeOperator(node); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return checkConditionalType(node); - case 195 /* InferType */: + case 196 /* InferType */: return checkInferType(node); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: return checkTemplateLiteralType(node); - case 205 /* ImportType */: + case 206 /* ImportType */: return checkImportType(node); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 328 /* JSDocAugmentsTag */: + case 329 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 329 /* JSDocImplementsTag */: + case 330 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 340 /* JSDocEnumTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 341 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 324 /* JSDocLink */: - case 325 /* JSDocLinkCode */: - case 326 /* JSDocLinkPlain */: + case 325 /* JSDocLink */: + case 326 /* JSDocLinkCode */: + case 327 /* JSDocLinkPlain */: return checkJSDocLinkLikeTag(node); - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 315 /* JSDocNonNullableType */: - case 314 /* JSDocNullableType */: - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: - case 322 /* JSDocTypeLiteral */: + case 316 /* JSDocNonNullableType */: + case 315 /* JSDocNullableType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: + case 323 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); forEachChild(node, checkSourceElement); return; - case 318 /* JSDocVariadicType */: + case 319 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 309 /* JSDocTypeExpression */: + case 310 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 333 /* JSDocPublicTag */: - case 335 /* JSDocProtectedTag */: - case 334 /* JSDocPrivateTag */: + case 334 /* JSDocPublicTag */: + case 336 /* JSDocProtectedTag */: + case 335 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); - case 350 /* JSDocSatisfiesTag */: + case 351 /* JSDocSatisfiesTag */: return checkJSDocSatisfiesTag(node); - case 343 /* JSDocThisTag */: + case 344 /* JSDocThisTag */: return checkJSDocThisTag(node); - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return checkJSDocImportTag(node); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 200 /* MappedType */: + case 201 /* MappedType */: return checkMappedType(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 241 /* Block */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 269 /* ModuleBlock */: return checkBlock(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return checkVariableStatement(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return checkExpressionStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return checkIfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return checkDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return checkWhileStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return checkForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return checkForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return checkForOfStatement(node); - case 251 /* ContinueStatement */: - case 252 /* BreakStatement */: + case 252 /* ContinueStatement */: + case 253 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return checkReturnStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return checkWithStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return checkSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return checkLabeledStatement(node); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return checkThrowStatement(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return checkTryStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return checkBindingElement(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return checkClassDeclaration(node); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 267 /* ModuleDeclaration */: + case 307 /* EnumMember */: + return checkEnumMember(node); + case 268 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return checkImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return checkExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return checkExportAssignment(node); - case 242 /* EmptyStatement */: - case 259 /* DebuggerStatement */: + case 243 /* EmptyStatement */: + case 260 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -90257,44 +91236,44 @@ function createTypeChecker(host) { currentNode = node; instantiationCount = 0; switch (node.kind) { - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 215 /* TaggedTemplateExpression */: - case 170 /* Decorator */: - case 286 /* JsxOpeningElement */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 216 /* TaggedTemplateExpression */: + case 171 /* Decorator */: + case 287 /* JsxOpeningElement */: resolveUntypedCall(node); break; - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: checkTypeParameterDeferred(node); break; - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 284 /* JsxElement */: + case 285 /* JsxElement */: checkJsxElementDeferred(node); break; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: - case 217 /* ParenthesizedExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: + case 218 /* ParenthesizedExpression */: checkAssertionDeferred(node); break; - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: checkExpression(node.expression); break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isInstanceOfExpression(node)) { resolveUntypedCall(node); } @@ -90485,16 +91464,16 @@ function createTypeChecker(host) { copySymbols(location.locals, meaning); } switch (location.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (!isExternalModule(location)) break; // falls through - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: copySymbols(getSymbolOfDeclaration(location).exports, meaning & 8 /* EnumMember */); break; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: const className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -90502,13 +91481,13 @@ function createTypeChecker(host) { // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: if (!isStaticSymbol) { copySymbols(getMembersOfSymbol(getSymbolOfDeclaration(location)), meaning & 788968 /* Type */); } break; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: const funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -90541,7 +91520,7 @@ function createTypeChecker(host) { function copyLocallyVisibleExportSymbols(source, meaning2) { if (meaning2) { source.forEach((symbol) => { - if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) { + if (!getDeclarationOfKind(symbol, 282 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 281 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) { copySymbol(symbol, meaning2); } }); @@ -90552,16 +91531,16 @@ function createTypeChecker(host) { return name.kind === 80 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name; } function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 166 /* QualifiedName */) { + while (node.parent.kind === 167 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 183 /* TypeReference */; + return node.parent.kind === 184 /* TypeReference */; } function isInNameOfExpressionWithTypeArguments(node) { - while (node.parent.kind === 211 /* PropertyAccessExpression */) { + while (node.parent.kind === 212 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 233 /* ExpressionWithTypeArguments */; + return node.parent.kind === 234 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { let result; @@ -90586,13 +91565,13 @@ function createTypeChecker(host) { return !!forEachEnclosingClass(node, (n) => n === classDeclaration); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 167 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 271 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 272 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0; } - if (nodeOnRightSide.parent.kind === 277 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 278 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0; } return void 0; @@ -90622,7 +91601,7 @@ function createTypeChecker(host) { node = parent2; parent2 = parent2.parent; } - if (parent2 && parent2.kind === 205 /* ImportType */ && parent2.qualifier === node) { + if (parent2 && parent2.kind === 206 /* ImportType */ && parent2.qualifier === node) { return parent2; } return void 0; @@ -90654,7 +91633,7 @@ function createTypeChecker(host) { if (isDeclarationName(name)) { return getSymbolOfNode(name.parent); } - if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { + if (isInJSFile(name) && name.parent.kind === 212 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { if (!isPrivateIdentifier(name) && !isJSDocMemberName(name) && !isThisPropertyAndThisTyped(name.parent)) { const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); if (specialPropertyAssignmentSymbol) { @@ -90662,7 +91641,7 @@ function createTypeChecker(host) { } } } - if (name.parent.kind === 277 /* ExportAssignment */ && isEntityNameExpression(name)) { + if (name.parent.kind === 278 /* ExportAssignment */ && isEntityNameExpression(name)) { const success = resolveEntityName( name, /*all meanings*/ @@ -90674,7 +91653,7 @@ function createTypeChecker(host) { return success; } } else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) { - const importEqualsDeclaration = getAncestor(name, 271 /* ImportEqualsDeclaration */); + const importEqualsDeclaration = getAncestor(name, 272 /* ImportEqualsDeclaration */); Debug.assert(importEqualsDeclaration !== void 0); return getSymbolOfPartOfRightHandSideOfImportEquals( name, @@ -90695,7 +91674,7 @@ function createTypeChecker(host) { } if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; - if (name.parent.kind === 233 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) { meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; @@ -90714,10 +91693,10 @@ function createTypeChecker(host) { return entityNameSymbol; } } - if (name.parent.kind === 341 /* JSDocParameterTag */) { + if (name.parent.kind === 342 /* JSDocParameterTag */) { return getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 345 /* JSDocTemplateTag */) { + if (name.parent.kind === 169 /* TypeParameter */ && name.parent.parent.kind === 346 /* JSDocTemplateTag */) { Debug.assert(!isInJSFile(name)); const typeParameter = getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -90770,12 +91749,12 @@ function createTypeChecker(host) { return result; } else if (isPrivateIdentifier(name)) { return getSymbolForPrivateIdentifierExpression(name); - } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) { + } else if (name.kind === 212 /* PropertyAccessExpression */ || name.kind === 167 /* QualifiedName */) { const links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 211 /* PropertyAccessExpression */) { + if (name.kind === 212 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name, 0 /* Normal */); if (!links.resolvedSymbol) { links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name)); @@ -90791,7 +91770,7 @@ function createTypeChecker(host) { return resolveJSDocMemberName(name); } } else if (isEntityName(name) && isTypeReferenceIdentifier(name)) { - const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + const meaning = name.parent.kind === 184 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; const symbol = resolveEntityName( name, meaning, @@ -90802,7 +91781,7 @@ function createTypeChecker(host) { ); return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name); } - if (name.parent.kind === 182 /* TypePredicate */) { + if (name.parent.kind === 183 /* TypePredicate */) { return resolveEntityName( name, /*meaning*/ @@ -90882,7 +91861,7 @@ function createTypeChecker(host) { if (node.kind === 80 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); - } else if (parent2.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent2.propertyName) { + } else if (parent2.kind === 209 /* BindingElement */ && grandParent.kind === 207 /* ObjectBindingPattern */ && node === parent2.propertyName) { const typeOfPattern = getTypeOfNode(grandParent); const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); if (propertyDeclaration) { @@ -90901,8 +91880,8 @@ function createTypeChecker(host) { switch (node.kind) { case 80 /* Identifier */: case 81 /* PrivateIdentifier */: - case 211 /* PropertyAccessExpression */: - case 166 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: if (!isThisInTypeQuery(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } @@ -90925,19 +91904,19 @@ function createTypeChecker(host) { return checkExpression(node).symbol; } // falls through - case 197 /* ThisType */: + case 198 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 108 /* SuperKeyword */: return checkExpression(node).symbol; case 137 /* ConstructorKeyword */: const constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 177 /* Constructor */) { return constructorDeclaration.parent.symbol; } return void 0; case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall( + if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 273 /* ImportDeclaration */ || node.parent.kind === 279 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall( node.parent, /*requireStringLiteralLikeArgument*/ false @@ -90956,11 +91935,15 @@ function createTypeChecker(host) { case 39 /* EqualsGreaterThanToken */: case 86 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 205 /* ImportType */: + case 206 /* ImportType */: return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0; case 95 /* ExportKeyword */: return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0; case 102 /* ImportKeyword */: + if (isMetaProperty(node.parent) && node.parent.name.escapedText === "defer") { + return void 0; + } + // falls through case 105 /* NewKeyword */: return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0; case 104 /* InstanceOfKeyword */: @@ -90970,9 +91953,9 @@ function createTypeChecker(host) { return (hasInstanceMethodType == null ? void 0 : hasInstanceMethodType.symbol) ?? type.symbol; } return void 0; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return checkExpression(node).symbol; - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: if (isJSXTagName(node) && isJsxIntrinsicTagName(node)) { const symbol = getIntrinsicTagSymbol(node.parent); return symbol === unknownSymbol ? void 0 : symbol; @@ -90992,7 +91975,7 @@ function createTypeChecker(host) { return void 0; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 304 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 305 /* ShorthandPropertyAssignment */) { return resolveEntityName( location.name, 111551 /* Value */ | 2097152 /* Alias */, @@ -91097,16 +92080,16 @@ function createTypeChecker(host) { return errorType; } function getTypeOfAssignmentPattern(expr) { - Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */); - if (expr.parent.kind === 250 /* ForOfStatement */) { + Debug.assert(expr.kind === 211 /* ObjectLiteralExpression */ || expr.kind === 210 /* ArrayLiteralExpression */); + if (expr.parent.kind === 251 /* ForOfStatement */) { const iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 226 /* BinaryExpression */) { + if (expr.parent.kind === 227 /* BinaryExpression */) { const iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 303 /* PropertyAssignment */) { + if (expr.parent.kind === 304 /* PropertyAssignment */) { const node2 = cast(expr.parent.parent, isObjectLiteralExpression); const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType; const propertyIndex = indexOfNode(node2.properties, expr.parent); @@ -91139,7 +92122,7 @@ function createTypeChecker(host) { case 9 /* NumericLiteral */: case 11 /* StringLiteral */: return getStringLiteralType(name.text); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: const nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -91214,7 +92197,7 @@ function createTypeChecker(host) { } const parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 307 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 308 /* SourceFile */) { const symbolFile = parentSymbol.valueDeclaration; const referenceFile = getSourceFileOfNode(node); const symbolIsUmdExport = symbolFile !== referenceFile; @@ -91244,7 +92227,7 @@ function createTypeChecker(host) { return void 0; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { - return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 299 /* CatchClause */; + return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 300 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) { @@ -91269,7 +92252,7 @@ function createTypeChecker(host) { /*lookInLabeledStatements*/ false ); - const inLoopBodyBlock = container.kind === 241 /* Block */ && isIterationStatement( + const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement( container.parent, /*lookInLabeledStatements*/ false @@ -91309,22 +92292,22 @@ function createTypeChecker(host) { function isValueAliasDeclaration(node) { Debug.assert(canCollectSymbolAliasAccessabilityData); switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: const symbol = getSymbolOfDeclaration(node); return !!symbol && isAliasResolvedToValue( symbol, /*excludeTypeOnlyValues*/ true ); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportClause = node.exportClause; return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration)); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue( getSymbolOfDeclaration(node), /*excludeTypeOnlyValues*/ @@ -91335,7 +92318,7 @@ function createTypeChecker(host) { } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration); - if (node === void 0 || node.parent.kind !== 307 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { + if (node === void 0 || node.parent.kind !== 308 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { return false; } const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node)); @@ -91565,15 +92548,15 @@ function createTypeChecker(host) { } function canHaveConstantValue(node) { switch (node.kind) { - case 306 /* EnumMember */: - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 307 /* EnumMember */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return true; } return false; } function getConstantValue2(node) { - if (node.kind === 306 /* EnumMember */) { + if (node.kind === 307 /* EnumMember */) { return getEnumMemberValue(node).value; } if (!getNodeLinks(node).resolvedSymbol) { @@ -91694,12 +92677,12 @@ function createTypeChecker(host) { } function getAllAccessorDeclarationsForDeclaration(accessor) { accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration); - const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */; + const otherKind = accessor.kind === 179 /* SetAccessor */ ? 178 /* GetAccessor */ : 179 /* SetAccessor */; const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(accessor), otherKind); const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor; const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor; - const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor; - const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor; + const setAccessor = accessor.kind === 179 /* SetAccessor */ ? accessor : otherAccessor; + const getAccessor = accessor.kind === 178 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor, secondAccessor, @@ -91783,24 +92766,24 @@ function createTypeChecker(host) { if (symbol) { return filter(getExportSymbolOfValueSymbolIfExported(symbol).declarations, (declaration) => { switch (declaration.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 306 /* EnumMember */: - case 210 /* ObjectLiteralExpression */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 266 /* EnumDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 267 /* ModuleDeclaration */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 307 /* EnumMember */: + case 211 /* ObjectLiteralExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 267 /* EnumDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 268 /* ModuleDeclaration */: return true; } return false; @@ -91862,7 +92845,7 @@ function createTypeChecker(host) { if (direct) { return direct; } - if (node.kind === 169 /* Parameter */ && node.parent.kind === 178 /* SetAccessor */) { + if (node.kind === 170 /* Parameter */ && node.parent.kind === 179 /* SetAccessor */) { const other = getAllAccessorDeclarationsForDeclaration(node.parent).getAccessor; if (other) { return getEffectiveReturnTypeNode(other); @@ -91939,7 +92922,7 @@ function createTypeChecker(host) { }, getDeclarationStatementsForSourceFile: (node, flags, internalFlags, tracker) => { const n = getParseTreeNode(node); - Debug.assert(n && n.kind === 307 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + Debug.assert(n && n.kind === 308 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); const sym = getSymbolOfDeclaration(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, internalFlags, tracker); @@ -92016,6 +92999,9 @@ function createTypeChecker(host) { tracker.trackSymbol(name, enclosing, 111551 /* Value */); } } + }, + symbolToDeclarations: (symbol, meaning, flags, maximumLength, verbosityLevel, out) => { + return nodeBuilder.symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out); } }; function isImportRequiredByAugmentation(node) { @@ -92042,7 +93028,7 @@ function createTypeChecker(host) { } } function getExternalModuleFileFromDeclaration(declaration) { - const specifier = declaration.kind === 267 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); + const specifier = declaration.kind === 268 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); const moduleSymbol = resolveExternalModuleNameWorker( specifier, specifier, @@ -92052,7 +93038,7 @@ function createTypeChecker(host) { if (!moduleSymbol) { return void 0; } - return getDeclarationOfKind(moduleSymbol, 307 /* SourceFile */); + return getDeclarationOfKind(moduleSymbol, 308 /* SourceFile */); } function initializeTypeChecker() { for (const file of host.getSourceFiles()) { @@ -92349,12 +93335,12 @@ function createTypeChecker(host) { for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { - if (node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + if (node.kind === 175 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); } - } else if (legacyDecorators && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */)) { + } else if (legacyDecorators && (node.kind === 178 /* GetAccessor */ || node.kind === 179 /* SetAccessor */)) { const accessors = getAllAccessorDeclarationsForDeclaration(node); if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -92384,25 +93370,25 @@ function createTypeChecker(host) { firstDecorator ?? (firstDecorator = modifier); } else { if (modifier.kind !== 148 /* ReadonlyKeyword */) { - if (node.kind === 171 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) { + if (node.kind === 172 /* PropertySignature */ || node.kind === 174 /* MethodSignature */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 126 /* StaticKeyword */ || !isClassLike(node.parent))) { + if (node.kind === 182 /* IndexSignature */ && (modifier.kind !== 126 /* StaticKeyword */ || !isClassLike(node.parent))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } } if (modifier.kind !== 103 /* InKeyword */ && modifier.kind !== 147 /* OutKeyword */ && modifier.kind !== 87 /* ConstKeyword */) { - if (node.kind === 168 /* TypeParameter */) { + if (node.kind === 169 /* TypeParameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } } switch (modifier.kind) { case 87 /* ConstKeyword */: { - if (node.kind !== 266 /* EnumDeclaration */ && node.kind !== 168 /* TypeParameter */) { + if (node.kind !== 267 /* EnumDeclaration */ && node.kind !== 169 /* TypeParameter */) { return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */)); } const parent2 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent; - if (node.kind === 168 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { + if (node.kind === 169 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); } break; @@ -92438,7 +93424,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + } else if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 64 /* Abstract */) { if (modifier.kind === 123 /* PrivateKeyword */) { @@ -92460,9 +93446,9 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + } else if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); @@ -92479,7 +93465,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); } else if (flags & 128 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 172 /* PropertyDeclaration */) { + } else if (node.kind !== 173 /* PropertyDeclaration */) { return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); } flags |= 512 /* Accessor */; @@ -92487,7 +93473,7 @@ function createTypeChecker(host) { case 148 /* ReadonlyKeyword */: if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) { + } else if (node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 172 /* PropertySignature */ && node.kind !== 182 /* IndexSignature */ && node.kind !== 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); @@ -92495,8 +93481,8 @@ function createTypeChecker(host) { flags |= 8 /* Readonly */; break; case 95 /* ExportKeyword */: - if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 265 /* TypeAliasDeclaration */ && node.kind !== 264 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later - node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 307 /* SourceFile */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 266 /* TypeAliasDeclaration */ && node.kind !== 265 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 268 /* ModuleDeclaration */ && node.parent.kind === 308 /* SourceFile */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) { return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } if (flags & 32 /* Export */) { @@ -92509,7 +93495,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (isClassLike(node.parent)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } else if (blockScopeKind === 4 /* Using */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "export"); @@ -92519,8 +93505,8 @@ function createTypeChecker(host) { flags |= 32 /* Export */; break; case 90 /* DefaultKeyword */: - const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) { + const container = node.parent.kind === 308 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 268 /* ModuleDeclaration */ && !isAmbientModule(container)) { return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } else if (blockScopeKind === 4 /* Using */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default"); @@ -92542,13 +93528,13 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } else if (blockScopeKind === 4 /* Using */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "declare"); } else if (blockScopeKind === 6 /* AwaitUsing */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "declare"); - } else if (node.parent.flags & 33554432 /* Ambient */ && node.parent.kind === 268 /* ModuleBlock */) { + } else if (node.parent.flags & 33554432 /* Ambient */ && node.parent.kind === 269 /* ModuleBlock */) { return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (isPrivateIdentifierClassElementDeclaration(node)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); @@ -92562,12 +93548,12 @@ function createTypeChecker(host) { if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) { - if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) { + if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 186 /* ConstructorType */) { + if (node.kind !== 175 /* MethodDeclaration */ && node.kind !== 173 /* PropertyDeclaration */ && node.kind !== 178 /* GetAccessor */ && node.kind !== 179 /* SetAccessor */) { return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) { - const message = node.kind === 172 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; + if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) { + const message = node.kind === 173 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; return grammarErrorOnNode(modifier, message); } if (flags & 256 /* Static */) { @@ -92596,7 +93582,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); } else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 169 /* Parameter */) { + } else if (node.kind === 170 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } if (flags & 64 /* Abstract */) { @@ -92610,7 +93596,7 @@ function createTypeChecker(host) { const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */; const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out"; const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent; - if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) { + if (node.kind !== 169 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); } if (flags & inOutFlag) { @@ -92625,7 +93611,7 @@ function createTypeChecker(host) { } } } - if (node.kind === 176 /* Constructor */) { + if (node.kind === 177 /* Constructor */) { if (flags & 256 /* Static */) { return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -92636,11 +93622,11 @@ function createTypeChecker(host) { return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async"); } return false; - } else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) { + } else if ((node.kind === 273 /* ImportDeclaration */ || node.kind === 272 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) { return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) { + } else if (node.kind === 170 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) { return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); - } else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) { + } else if (node.kind === 170 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) { return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 1024 /* Async */) { @@ -92659,47 +93645,47 @@ function createTypeChecker(host) { } function findFirstIllegalModifier(node) { switch (node.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 181 /* IndexSignature */: - case 267 /* ModuleDeclaration */: - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 169 /* Parameter */: - case 168 /* TypeParameter */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 182 /* IndexSignature */: + case 268 /* ModuleDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 170 /* Parameter */: + case 169 /* TypeParameter */: return void 0; - case 175 /* ClassStaticBlockDeclaration */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 270 /* NamespaceExportDeclaration */: - case 282 /* MissingDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 271 /* NamespaceExportDeclaration */: + case 283 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: - if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + if (node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { return void 0; } switch (node.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return findFirstModifierExcept(node, 134 /* AsyncKeyword */); - case 263 /* ClassDeclaration */: - case 185 /* ConstructorType */: + case 264 /* ClassDeclaration */: + case 186 /* ConstructorType */: return findFirstModifierExcept(node, 128 /* AbstractKeyword */); - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return find(node.modifiers, isModifier); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return node.declarationList.flags & 4 /* Using */ ? findFirstModifierExcept(node, 135 /* AwaitKeyword */) : find(node.modifiers, isModifier); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return findFirstModifierExcept(node, 87 /* ConstKeyword */); default: Debug.assertNever(node); @@ -92715,10 +93701,10 @@ function createTypeChecker(host) { } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -92931,11 +93917,11 @@ function createTypeChecker(host) { return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 167 /* ComputedPropertyName */) { + if (node.kind !== 168 /* ComputedPropertyName */) { return false; } const computedPropertyName = node; - if (computedPropertyName.expression.kind === 226 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 28 /* CommaToken */) { + if (computedPropertyName.expression.kind === 227 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 28 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; @@ -92943,7 +93929,7 @@ function createTypeChecker(host) { function checkGrammarForGenerator(node) { if (node.asteriskToken) { Debug.assert( - node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */ + node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */ || node.kind === 175 /* MethodDeclaration */ ); if (node.flags & 33554432 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context); @@ -92962,7 +93948,7 @@ function createTypeChecker(host) { function checkGrammarObjectLiteralExpression(node, inDestructuring) { const seen = /* @__PURE__ */ new Map(); for (const prop of node.properties) { - if (prop.kind === 305 /* SpreadAssignment */) { + if (prop.kind === 306 /* SpreadAssignment */) { if (inDestructuring) { const expression = skipParentheses(prop.expression); if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) { @@ -92972,10 +93958,10 @@ function createTypeChecker(host) { continue; } const name = prop.name; - if (name.kind === 167 /* ComputedPropertyName */) { + if (name.kind === 168 /* ComputedPropertyName */) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 304 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 305 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); } if (name.kind === 81 /* PrivateIdentifier */) { @@ -92983,7 +93969,7 @@ function createTypeChecker(host) { } if (canHaveModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) { + if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 175 /* MethodDeclaration */)) { grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); } } @@ -92996,8 +93982,8 @@ function createTypeChecker(host) { } let currentKind; switch (prop.kind) { - case 304 /* ShorthandPropertyAssignment */: - case 303 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 9 /* NumericLiteral */) { @@ -93012,13 +93998,13 @@ function createTypeChecker(host) { } currentKind = 4 /* PropertyAssignment */; break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -93055,7 +94041,7 @@ function createTypeChecker(host) { checkGrammarTypeArguments(node, node.typeArguments); const seen = /* @__PURE__ */ new Map(); for (const attr of node.attributes.properties) { - if (attr.kind === 293 /* JsxSpreadAttribute */) { + if (attr.kind === 294 /* JsxSpreadAttribute */) { continue; } const { name, initializer } = attr; @@ -93065,7 +94051,7 @@ function createTypeChecker(host) { } else { return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 294 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 295 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -93087,7 +94073,7 @@ function createTypeChecker(host) { if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 250 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 251 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if (!(forInOrOfStatement.flags & 65536 /* AwaitContext */)) { const sourceFile = getSourceFileOfNode(forInOrOfStatement); if (isInTopLevelContext(forInOrOfStatement)) { @@ -93098,6 +94084,7 @@ function createTypeChecker(host) { switch (moduleKind) { case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) { diagnostics.add( @@ -93116,7 +94103,7 @@ function createTypeChecker(host) { // fallthrough default: diagnostics.add( - createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher) + createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher) ); break; } @@ -93125,7 +94112,7 @@ function createTypeChecker(host) { if (!hasParseDiagnostics(sourceFile)) { const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); const func = getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 176 /* Constructor */) { + if (func && func.kind !== 177 /* Constructor */) { Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async); addRelatedInfo(diagnostic, relatedInfo); @@ -93140,7 +94127,7 @@ function createTypeChecker(host) { grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async); return false; } - if (forInOrOfStatement.initializer.kind === 261 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 262 /* VariableDeclarationList */) { const variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { const declarations = variableList.declarations; @@ -93148,16 +94135,16 @@ function createTypeChecker(host) { return false; } if (declarations.length > 1) { - const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } const firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); } } @@ -93165,7 +94152,7 @@ function createTypeChecker(host) { return false; } function checkGrammarAccessor(accessor) { - if (!(accessor.flags & 33554432 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 264 /* InterfaceDeclaration */) { + if (!(accessor.flags & 33554432 /* Ambient */) && accessor.parent.kind !== 188 /* TypeLiteral */ && accessor.parent.kind !== 265 /* InterfaceDeclaration */) { if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) { return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } @@ -93177,7 +94164,7 @@ function createTypeChecker(host) { if (hasSyntacticModifier(accessor, 64 /* Abstract */)) { return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } - if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) { + if (accessor.parent.kind === 188 /* TypeLiteral */ || accessor.parent.kind === 265 /* InterfaceDeclaration */) { return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } } @@ -93187,10 +94174,10 @@ function createTypeChecker(host) { if (!doesAccessorHaveCorrectParameterCount(accessor)) { return grammarErrorOnNode( accessor.name, - accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter + accessor.kind === 178 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter ); } - if (accessor.kind === 178 /* SetAccessor */) { + if (accessor.kind === 179 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -93208,10 +94195,10 @@ function createTypeChecker(host) { return false; } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 178 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 178 /* GetAccessor */ ? 1 : 2)) { return getThisParameter(accessor); } } @@ -93228,7 +94215,7 @@ function createTypeChecker(host) { } } switch (parent2.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: const decl = parent2; if (decl.name.kind !== 80 /* Identifier */) { return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -93240,12 +94227,12 @@ function createTypeChecker(host) { return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (!isStatic(parent2) || !hasEffectiveReadonlyModifier(parent2)) { return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: if (!hasSyntacticModifier(parent2, 8 /* Readonly */)) { return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -93254,7 +94241,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here); } } else if (node.operator === 148 /* ReadonlyKeyword */) { - if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) { + if (node.type.kind !== 189 /* ArrayType */ && node.type.kind !== 190 /* TupleType */) { return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(155 /* SymbolKeyword */)); } } @@ -93268,8 +94255,8 @@ function createTypeChecker(host) { if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 174 /* MethodDeclaration */) { - if (node.parent.kind === 210 /* ObjectLiteralExpression */) { + if (node.kind === 175 /* MethodDeclaration */) { + if (node.parent.kind === 211 /* ObjectLiteralExpression */) { if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 134 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); } else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) { @@ -93290,12 +94277,12 @@ function createTypeChecker(host) { } if (node.flags & 33554432 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); - } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) { + } else if (node.kind === 175 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - } else if (node.parent.kind === 264 /* InterfaceDeclaration */) { + } else if (node.parent.kind === 265 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); - } else if (node.parent.kind === 187 /* TypeLiteral */) { + } else if (node.parent.kind === 188 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -93306,9 +94293,9 @@ function createTypeChecker(host) { return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { - const isMisplacedContinueLabel = node.kind === 251 /* ContinueStatement */ && !isIterationStatement( + const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement( current.statement, /*lookInLabeledStatements*/ true @@ -93319,8 +94306,8 @@ function createTypeChecker(host) { return false; } break; - case 255 /* SwitchStatement */: - if (node.kind === 252 /* BreakStatement */ && !node.label) { + case 256 /* SwitchStatement */: + if (node.kind === 253 /* BreakStatement */ && !node.label) { return false; } break; @@ -93337,10 +94324,10 @@ function createTypeChecker(host) { current = current.parent; } if (node.label) { - const message = node.kind === 252 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - const message = node.kind === 252 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } } @@ -93360,10 +94347,10 @@ function createTypeChecker(host) { } } function isStringOrNumberLiteralExpression(expr) { - return isStringOrNumericLiteralLike(expr) || expr.kind === 224 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; + return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { - return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 224 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; + return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { @@ -93395,7 +94382,7 @@ function createTypeChecker(host) { return grammarErrorOnNode(node, Diagnostics._0_declarations_may_not_have_binding_patterns, "using"); } } - if (node.parent.parent.kind !== 249 /* ForInStatement */ && node.parent.parent.kind !== 250 /* ForOfStatement */) { + if (node.parent.parent.kind !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* ForOfStatement */) { if (nodeFlags & 33554432 /* Ambient */) { checkAmbientInitializer(node); } else if (!node.initializer) { @@ -93412,7 +94399,7 @@ function createTypeChecker(host) { } } } - if (node.exclamationToken && (node.parent.parent.kind !== 243 /* VariableStatement */ || !node.type || node.initializer || nodeFlags & 33554432 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 244 /* VariableStatement */ || !node.type || node.initializer || nodeFlags & 33554432 /* Ambient */)) { const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; return grammarErrorOnNode(node.exclamationToken, message); } @@ -93460,28 +94447,36 @@ function createTypeChecker(host) { return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); } const blockScopeFlags = declarationList.flags & 7 /* BlockScoped */; - if ((blockScopeFlags === 4 /* Using */ || blockScopeFlags === 6 /* AwaitUsing */) && isForInStatement(declarationList.parent)) { - return grammarErrorOnNode( - declarationList, - blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration - ); - } - if (blockScopeFlags === 6 /* AwaitUsing */) { - return checkAwaitGrammar(declarationList); + if (blockScopeFlags === 4 /* Using */ || blockScopeFlags === 6 /* AwaitUsing */) { + if (isForInStatement(declarationList.parent)) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration + ); + } + if (declarationList.flags & 33554432 /* Ambient */) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === 4 /* Using */ ? Diagnostics.using_declarations_are_not_allowed_in_ambient_contexts : Diagnostics.await_using_declarations_are_not_allowed_in_ambient_contexts + ); + } + if (blockScopeFlags === 6 /* AwaitUsing */) { + return checkAwaitGrammar(declarationList); + } } return false; } function allowBlockDeclarations(parent2) { switch (parent2.kind) { - case 245 /* IfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 246 /* IfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: return false; - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return allowBlockDeclarations(parent2.parent); } return true; @@ -93491,7 +94486,7 @@ function createTypeChecker(host) { const blockScopeKind = getCombinedNodeFlagsCached(node.declarationList) & 7 /* BlockScoped */; if (blockScopeKind) { const keyword = blockScopeKind === 1 /* Let */ ? "let" : blockScopeKind === 2 /* Const */ ? "const" : blockScopeKind === 4 /* Using */ ? "using" : blockScopeKind === 6 /* AwaitUsing */ ? "await using" : Debug.fail("Unknown BlockScope flag"); - return grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); + error2(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); } } } @@ -93505,7 +94500,17 @@ function createTypeChecker(host) { break; case 102 /* ImportKeyword */: if (escapedText !== "meta") { - return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "meta"); + const isCallee = isCallExpression(node.parent) && node.parent.expression === node; + if (escapedText === "defer") { + if (!isCallee) { + return grammarErrorAtPos(node, node.end, 0, Diagnostics._0_expected, "("); + } + } else { + if (isCallee) { + return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer, unescapeLeadingUnderscores(node.name.escapedText)); + } + return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "meta"); + } } break; } @@ -93541,7 +94546,7 @@ function createTypeChecker(host) { function grammarErrorOnNode(node, message, ...args) { const sourceFile = getSourceFileOfNode(node); if (!hasParseDiagnostics(sourceFile)) { - diagnostics.add(createDiagnosticForNode(node, message, ...args)); + error2(node, message, ...args); return true; } return false; @@ -93574,13 +94579,13 @@ function createTypeChecker(host) { if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(node.name)) { return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } - if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node)) { + if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) { return grammarErrorOnNode(node.name, Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher); } if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) { return true; } - } else if (node.parent.kind === 264 /* InterfaceDeclaration */) { + } else if (node.parent.kind === 265 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -93606,14 +94611,14 @@ function createTypeChecker(host) { } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 265 /* TypeAliasDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 278 /* ExportDeclaration */ || node.kind === 277 /* ExportAssignment */ || node.kind === 270 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 128 /* Ambient */ | 32 /* Export */ | 2048 /* Default */)) { + if (node.kind === 265 /* InterfaceDeclaration */ || node.kind === 266 /* TypeAliasDeclaration */ || node.kind === 273 /* ImportDeclaration */ || node.kind === 272 /* ImportEqualsDeclaration */ || node.kind === 279 /* ExportDeclaration */ || node.kind === 278 /* ExportAssignment */ || node.kind === 271 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 128 /* Ambient */ | 32 /* Export */ | 2048 /* Default */)) { return false; } return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (const decl of file.statements) { - if (isDeclaration(decl) || decl.kind === 243 /* VariableStatement */) { + if (isDeclaration(decl) || decl.kind === 244 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -93630,7 +94635,7 @@ function createTypeChecker(host) { if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 241 /* Block */ || node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 307 /* SourceFile */) { + if (node.parent.kind === 242 /* Block */ || node.parent.kind === 269 /* ModuleBlock */ || node.parent.kind === 308 /* SourceFile */) { const links2 = getNodeLinks(node.parent); if (!links2.hasReportedStatementInAmbientContext) { return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -93659,7 +94664,7 @@ function createTypeChecker(host) { function checkGrammarBigIntLiteral(node) { const literalType = isLiteralTypeNode(node.parent) || isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent); if (!literalType) { - if (languageVersion < 7 /* ES2020 */) { + if (!(node.flags & 33554432 /* Ambient */) && languageVersion < 7 /* ES2020 */) { if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) { return true; } @@ -93695,12 +94700,24 @@ function createTypeChecker(host) { return ambientModulesCache; } function checkGrammarImportClause(node) { - var _a; - if (node.isTypeOnly && node.name && node.namedBindings) { - return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); - } - if (node.isTypeOnly && ((_a = node.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */) { - return checkGrammarNamedImportsOrExports(node.namedBindings); + var _a, _b; + if (node.phaseModifier === 156 /* TypeKeyword */) { + if (node.name && node.namedBindings) { + return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); + } + if (((_a = node.namedBindings) == null ? void 0 : _a.kind) === 276 /* NamedImports */) { + return checkGrammarNamedImportsOrExports(node.namedBindings); + } + } else if (node.phaseModifier === 166 /* DeferKeyword */) { + if (node.name) { + return grammarErrorOnNode(node, Diagnostics.Default_imports_are_not_allowed_in_a_deferred_import); + } + if (((_b = node.namedBindings) == null ? void 0 : _b.kind) === 276 /* NamedImports */) { + return grammarErrorOnNode(node, Diagnostics.Named_imports_are_not_allowed_in_a_deferred_import); + } + if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { + return grammarErrorOnNode(node, Diagnostics.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve); + } } return false; } @@ -93709,17 +94726,21 @@ function createTypeChecker(host) { if (specifier.isTypeOnly) { return grammarErrorOnFirstToken( specifier, - specifier.kind === 276 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement + specifier.kind === 277 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement ); } }); } function checkGrammarImportCallExpression(node) { if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) { - return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + return grammarErrorOnNode(node, getVerbatimModuleSyntaxErrorMessage(node)); } - if (moduleKind === 5 /* ES2015 */) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext); + if (node.expression.kind === 237 /* MetaProperty */) { + if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) { + return grammarErrorOnNode(node, Diagnostics.Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve); + } + } else if (moduleKind === 5 /* ES2015 */) { + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext); } if (node.typeArguments) { return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); @@ -93729,7 +94750,7 @@ function createTypeChecker(host) { checkGrammarForDisallowedTrailingComma(nodeArguments); if (nodeArguments.length > 1) { const importAttributesArgument = nodeArguments[1]; - return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve); + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve); } } if (nodeArguments.length === 0 || nodeArguments.length > 2) { @@ -93765,8 +94786,8 @@ function createTypeChecker(host) { } function findBestTypeForInvokable(source, unionTarget) { let signatureKind = 0 /* Call */; - const hasSignatures = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1 /* Construct */, getSignaturesOfType(source, signatureKind).length > 0); - if (hasSignatures) { + const hasSignatures2 = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1 /* Construct */, getSignaturesOfType(source, signatureKind).length > 0); + if (hasSignatures2) { return find(unionTarget.types, (t) => getSignaturesOfType(t, signatureKind).length > 0); } } @@ -93862,12 +94883,12 @@ function isNotAccessor(declaration) { return !isAccessor(declaration); } function isNotOverload(declaration) { - return declaration.kind !== 262 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body; + return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 175 /* MethodDeclaration */ || !!declaration.body; } function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: return isIdentifier(name) || name.kind === 11 /* StringLiteral */; default: return isDeclarationName(name); @@ -93917,7 +94938,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) { }, useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), redirectTargetsMap: host.redirectTargetsMap, - getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName), + getRedirectFromSourceFile: (fileName) => host.getRedirectFromSourceFile(fileName), isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName), fileExists: (fileName) => host.fileExists(fileName), getFileIncludeReasons: () => host.getFileIncludeReasons(), @@ -94284,21 +95305,21 @@ function visitEachChild(node, visitor, context = nullTransformationContext, node return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor); } var visitEachChildTable = { - [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [167 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, - [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [168 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements - [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [169 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94307,7 +95328,7 @@ var visitEachChildTable = { nodeVisitor(node.default, visitor, isTypeNode) ); }, - [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [170 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94318,14 +95339,14 @@ var visitEachChildTable = { nodeVisitor(node.initializer, visitor, isExpression) ); }, - [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [171 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements - [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [172 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94334,7 +95355,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [173 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94345,7 +95366,7 @@ var visitEachChildTable = { nodeVisitor(node.initializer, visitor, isExpression) ); }, - [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [174 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94356,7 +95377,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [175 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94369,7 +95390,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [177 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94377,7 +95398,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [178 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94387,7 +95408,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [179 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94396,7 +95417,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [176 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { context.startLexicalEnvironment(); context.suspendLexicalEnvironment(); return context.factory.updateClassStaticBlockDeclaration( @@ -94404,7 +95425,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [180 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -94412,7 +95433,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [181 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -94420,7 +95441,7 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [182 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94429,7 +95450,7 @@ var visitEachChildTable = { ); }, // Types - [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [183 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), @@ -94437,14 +95458,14 @@ var visitEachChildTable = { nodeVisitor(node.type, visitor, isTypeNode) ); }, - [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [184 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [185 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -94452,7 +95473,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [186 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorTypeNode( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94461,56 +95482,56 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [187 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [188 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateTypeLiteralNode( node, nodesVisitor(node.members, visitor, isTypeElement) ); }, - [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [189 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, - [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [190 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateTupleTypeNode( node, nodesVisitor(node.elements, visitor, isTypeNode) ); }, - [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [191 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [192 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [193 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateUnionTypeNode( node, nodesVisitor(node.types, visitor, isTypeNode) ); }, - [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [194 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateIntersectionTypeNode( node, nodesVisitor(node.types, visitor, isTypeNode) ); }, - [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [195 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), @@ -94519,13 +95540,13 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, - [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [196 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, - [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [206 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), @@ -94535,14 +95556,14 @@ var visitEachChildTable = { node.isTypeOf ); }, - [302 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [303 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, - [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [203 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, @@ -94551,26 +95572,26 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [197 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [199 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [200 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, - [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [201 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, @@ -94581,20 +95602,20 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isTypeElement) ); }, - [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [202 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, - [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [204 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, - [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [205 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), @@ -94602,19 +95623,19 @@ var visitEachChildTable = { ); }, // Binding patterns - [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [207 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateObjectBindingPattern( node, nodesVisitor(node.elements, visitor, isBindingElement) ); }, - [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [208 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateArrayBindingPattern( node, nodesVisitor(node.elements, visitor, isArrayBindingElement) ); }, - [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [209 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, @@ -94624,19 +95645,19 @@ var visitEachChildTable = { ); }, // Expression - [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [210 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateArrayLiteralExpression( node, nodesVisitor(node.elements, visitor, isExpression) ); }, - [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [211 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateObjectLiteralExpression( node, nodesVisitor(node.properties, visitor, isObjectLiteralElementLike) ); }, - [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [212 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94648,7 +95669,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, - [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [213 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94660,7 +95681,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, - [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [214 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94674,7 +95695,7 @@ var visitEachChildTable = { nodesVisitor(node.arguments, visitor, isExpression) ); }, - [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [215 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94682,7 +95703,7 @@ var visitEachChildTable = { nodesVisitor(node.arguments, visitor, isExpression) ); }, - [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [216 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), @@ -94690,20 +95711,20 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, - [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [217 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [218 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [219 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94715,7 +95736,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [220 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateArrowFunction( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -94726,43 +95747,43 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [220 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [221 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [222 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [223 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [224 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, - [225 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, - [226 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), @@ -94770,7 +95791,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, - [227 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), @@ -94780,27 +95801,27 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, - [228 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, - [229 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, - [230 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [231 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateClassExpression( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -94810,28 +95831,28 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isClassElement) ); }, - [233 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [234 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [238 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [235 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) @@ -94840,14 +95861,14 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [236 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc - [239 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94855,26 +95876,26 @@ var visitEachChildTable = { ); }, // Element - [241 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateBlock( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [243 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, nodesVisitor(node.modifiers, visitor, isModifierLike), Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, - [244 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [245 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -94882,21 +95903,21 @@ var visitEachChildTable = { nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, - [246 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [247 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [248 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForStatement( node, nodeVisitor(node.initializer, visitor, isForInitializer), @@ -94905,7 +95926,7 @@ var visitEachChildTable = { visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [249 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), @@ -94913,7 +95934,7 @@ var visitEachChildTable = { visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [250 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, @@ -94922,52 +95943,52 @@ var visitEachChildTable = { visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [251 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateContinueStatement( node, nodeVisitor(node.label, visitor, isIdentifier) ); }, - [252 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateBreakStatement( node, nodeVisitor(node.label, visitor, isIdentifier) ); }, - [253 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateReturnStatement( node, nodeVisitor(node.expression, visitor, isExpression) ); }, - [254 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, - [255 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, - [256 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, - [257 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [258 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), @@ -94975,7 +95996,7 @@ var visitEachChildTable = { nodeVisitor(node.finallyBlock, visitor, isBlock) ); }, - [260 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), @@ -94984,13 +96005,13 @@ var visitEachChildTable = { nodeVisitor(node.initializer, visitor, isExpression) ); }, - [261 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateVariableDeclarationList( node, nodesVisitor(node.declarations, visitor, isVariableDeclaration) ); }, - [262 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -95002,7 +96023,7 @@ var visitEachChildTable = { visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [263 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateClassDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95012,7 +96033,7 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isClassElement) ); }, - [264 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [265 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95022,7 +96043,7 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isTypeElement) ); }, - [265 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [266 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95031,7 +96052,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [266 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [267 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95039,7 +96060,7 @@ var visitEachChildTable = { nodesVisitor(node.members, visitor, isEnumMember) ); }, - [267 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [268 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95047,25 +96068,25 @@ var visitEachChildTable = { nodeVisitor(node.body, visitor, isModuleBody) ); }, - [268 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [269 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateModuleBlock( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [269 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [270 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCaseBlock( node, nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause) ); }, - [270 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [271 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [271 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [272 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95074,7 +96095,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, - [272 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [273 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95083,47 +96104,47 @@ var visitEachChildTable = { nodeVisitor(node.attributes, visitor, isImportAttributes) ); }, - [300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [301 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateImportAttributes( node, nodesVisitor(node.elements, visitor, isImportAttribute), node.multiLine ); }, - [301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [302 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportAttribute( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)), Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, - [273 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [274 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportClause( node, - node.isTypeOnly, + node.phaseModifier, nodeVisitor(node.name, visitor, isIdentifier), nodeVisitor(node.namedBindings, visitor, isNamedImportBindings) ); }, - [274 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [275 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [280 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [281 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [275 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [276 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateNamedImports( node, nodesVisitor(node.elements, visitor, isImportSpecifier) ); }, - [276 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [277 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportSpecifier( node, node.isTypeOnly, @@ -95131,14 +96152,14 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [277 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [278 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, nodesVisitor(node.modifiers, visitor, isModifierLike), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [278 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [279 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -95148,13 +96169,13 @@ var visitEachChildTable = { nodeVisitor(node.attributes, visitor, isImportAttributes) ); }, - [279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [280 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateNamedExports( node, nodesVisitor(node.elements, visitor, isExportSpecifier) ); }, - [281 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [282 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportSpecifier( node, node.isTypeOnly, @@ -95163,14 +96184,14 @@ var visitEachChildTable = { ); }, // Module references - [283 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [284 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX - [284 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [285 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), @@ -95178,7 +96199,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, - [285 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [286 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), @@ -95186,7 +96207,7 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, - [286 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [287 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), @@ -95194,20 +96215,20 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, - [287 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [288 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, - [295 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName2(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [296 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName2(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxNamespacedName( node, Debug.checkDefined(nodeVisitor(node.namespace, visitor, isIdentifier)), Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [288 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [289 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), @@ -95215,52 +96236,52 @@ var visitEachChildTable = { Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, - [291 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [292 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isJsxAttributeName)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, - [292 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [293 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttributes( node, nodesVisitor(node.properties, visitor, isJsxAttributeLike) ); }, - [293 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [294 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [294 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [295 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses - [296 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [297 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, - [297 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [298 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateDefaultClause( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [298 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [299 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateHeritageClause( node, nodesVisitor(node.types, visitor, isExpressionWithTypeArguments) ); }, - [299 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [300 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), @@ -95268,28 +96289,28 @@ var visitEachChildTable = { ); }, // Property assignments - [303 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [304 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, - [304 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [305 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, - [305 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [306 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum - [306 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [307 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), @@ -95297,20 +96318,20 @@ var visitEachChildTable = { ); }, // Top-level nodes - [307 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { + [308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateSourceFile( node, visitLexicalEnvironment(node.statements, visitor, context) ); }, // Transformation nodes - [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -95880,7 +96901,7 @@ function isNamedDefaultReference(e) { function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 307 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 308 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(map(node.sourceFiles, transformSourceFile)); @@ -95925,7 +96946,7 @@ function collectExternalModuleInfo(context, sourceFile) { let hasImportDefault = false; for (const node of sourceFile.statements) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: externalImports.push(node); if (!hasImportStar && getImportNeedsImportStarHelper(node)) { hasImportStar = true; @@ -95934,12 +96955,12 @@ function collectExternalModuleInfo(context, sourceFile) { hasImportDefault = true; } break; - case 271 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 283 /* ExternalModuleReference */) { + case 272 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 284 /* ExternalModuleReference */) { externalImports.push(node); } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -95964,19 +96985,19 @@ function collectExternalModuleInfo(context, sourceFile) { addExportedNamesForExportDeclaration(node); } break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: if (hasSyntacticModifier(node, 32 /* Export */)) { for (const decl of node.declarationList.declarations) { exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings); } } break; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: if (hasSyntacticModifier(node, 32 /* Export */)) { addExportedFunctionDeclaration( node, @@ -95986,7 +97007,7 @@ function collectExternalModuleInfo(context, sourceFile) { ); } break; - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: if (hasSyntacticModifier(node, 32 /* Export */)) { if (hasSyntacticModifier(node, 2048 /* Default */)) { if (!hasExportDefault) { @@ -96021,7 +97042,7 @@ function collectExternalModuleInfo(context, sourceFile) { } const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (decl) { - if (decl.kind === 262 /* FunctionDeclaration */) { + if (decl.kind === 263 /* FunctionDeclaration */) { addExportedFunctionDeclaration(decl, specifier.name, moduleExportNameIsDefault(specifier.name)); continue; } @@ -96241,7 +97262,7 @@ function isStaticPropertyDeclaration(member) { return isPropertyDeclaration(member) && hasStaticModifier(member); } function isInitializedProperty(member) { - return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0; + return member.kind === 173 /* PropertyDeclaration */ && member.initializer !== void 0; } function isNonStaticMethodOrAccessorWithPrivateName(member) { return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name); @@ -96278,8 +97299,8 @@ function getAllDecoratorsOfClass(node, useLegacyDecorators) { } function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { switch (member.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: if (!useLegacyDecorators) { return getAllDecoratorsOfMethod( member, @@ -96293,9 +97314,9 @@ function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { /*useLegacyDecorators*/ true ); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member, useLegacyDecorators); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return void 0; @@ -97087,21 +98108,21 @@ function transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptySt } function transformNamedEvaluation(context, node, ignoreEmptyStringLiteral, assignedName) { switch (node.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return transformNamedEvaluationOfPropertyAssignment(context, node, ignoreEmptyStringLiteral, assignedName); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return transformNamedEvaluationOfShorthandAssignmentProperty(context, node, ignoreEmptyStringLiteral, assignedName); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return transformNamedEvaluationOfVariableDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 169 /* Parameter */: + case 170 /* Parameter */: return transformNamedEvaluationOfParameterDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return transformNamedEvaluationOfBindingElement(context, node, ignoreEmptyStringLiteral, assignedName); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return transformNamedEvaluationOfPropertyDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return transformNamedEvaluationOfAssignmentExpression(context, node, ignoreEmptyStringLiteral, assignedName); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptyStringLiteral, assignedName); } } @@ -97195,8 +98216,8 @@ function transformTypeScript(context) { const previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(211 /* PropertyAccessExpression */); - context.enableSubstitution(212 /* ElementAccessExpression */); + context.enableSubstitution(212 /* PropertyAccessExpression */); + context.enableSubstitution(213 /* ElementAccessExpression */); let currentSourceFile; let currentNamespace; let currentNamespaceContainerName; @@ -97206,7 +98227,7 @@ function transformTypeScript(context) { let applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 308 /* Bundle */) { + if (node.kind === 309 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); @@ -97239,22 +98260,22 @@ function transformTypeScript(context) { } function onBeforeVisitNode(node) { switch (node.kind) { - case 307 /* SourceFile */: - case 269 /* CaseBlock */: - case 268 /* ModuleBlock */: - case 241 /* Block */: + case 308 /* SourceFile */: + case 270 /* CaseBlock */: + case 269 /* ModuleBlock */: + case 242 /* Block */: currentLexicalScope = node; currentScopeFirstDeclarationsOfName = void 0; break; - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: if (hasSyntacticModifier(node, 128 /* Ambient */)) { break; } if (node.name) { recordEmittedDeclarationInScope(node); } else { - Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */)); + Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */)); } break; } @@ -97273,10 +98294,10 @@ function transformTypeScript(context) { } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -97291,7 +98312,7 @@ function transformTypeScript(context) { return true; } switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: Debug.assertNode(parsed, isImportDeclaration); if (node.importClause !== parsed.importClause) { return true; @@ -97300,7 +98321,7 @@ function transformTypeScript(context) { return true; } break; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: Debug.assertNode(parsed, isImportEqualsDeclaration); if (node.name !== parsed.name) { return true; @@ -97312,7 +98333,7 @@ function transformTypeScript(context) { return true; } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: Debug.assertNode(parsed, isExportDeclaration); if (node.exportClause !== parsed.exportClause) { return true; @@ -97332,13 +98353,13 @@ function transformTypeScript(context) { return node; } switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return visitExportDeclaration(node); default: Debug.fail("Unhandled ellided statement"); @@ -97348,7 +98369,7 @@ function transformTypeScript(context) { return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) { + if (node.kind === 279 /* ExportDeclaration */ || node.kind === 273 /* ImportDeclaration */ || node.kind === 274 /* ImportClause */ || node.kind === 272 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 284 /* ExternalModuleReference */) { return void 0; } else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) { return visitTypeScript(node); @@ -97360,21 +98381,21 @@ function transformTypeScript(context) { } function classElementVisitorWorker(node, parent2) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return visitConstructor(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return visitPropertyDeclaration(node, parent2); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessor(node, parent2); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessor(node, parent2); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node, parent2); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return visitEachChild(node, visitor, context); - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: return node; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return; default: return Debug.failBadSyntaxKind(node); @@ -97385,15 +98406,15 @@ function transformTypeScript(context) { } function objectLiteralElementVisitorWorker(node, parent2) { switch (node.kind) { - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return visitor(node); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessor(node, parent2); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessor(node, parent2); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node, parent2); default: return Debug.failBadSyntaxKind(node); @@ -97434,13 +98455,13 @@ function transformTypeScript(context) { case 147 /* OutKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 188 /* ArrayType */: - case 189 /* TupleType */: - case 190 /* OptionalType */: - case 191 /* RestType */: - case 187 /* TypeLiteral */: - case 182 /* TypePredicate */: - case 168 /* TypeParameter */: + case 189 /* ArrayType */: + case 190 /* TupleType */: + case 191 /* OptionalType */: + case 192 /* RestType */: + case 188 /* TypeLiteral */: + case 183 /* TypePredicate */: + case 169 /* TypeParameter */: case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: case 136 /* BooleanKeyword */: @@ -97449,82 +98470,82 @@ function transformTypeScript(context) { case 146 /* NeverKeyword */: case 116 /* VoidKeyword */: case 155 /* SymbolKeyword */: - case 185 /* ConstructorType */: - case 184 /* FunctionType */: - case 186 /* TypeQuery */: - case 183 /* TypeReference */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 194 /* ConditionalType */: - case 196 /* ParenthesizedType */: - case 197 /* ThisType */: - case 198 /* TypeOperator */: - case 199 /* IndexedAccessType */: - case 200 /* MappedType */: - case 201 /* LiteralType */: + case 186 /* ConstructorType */: + case 185 /* FunctionType */: + case 187 /* TypeQuery */: + case 184 /* TypeReference */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 195 /* ConditionalType */: + case 197 /* ParenthesizedType */: + case 198 /* ThisType */: + case 199 /* TypeOperator */: + case 200 /* IndexedAccessType */: + case 201 /* MappedType */: + case 202 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return void 0; - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return factory2.createNotEmittedStatement(node); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return void 0; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return factory2.createNotEmittedStatement(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return visitHeritageClause(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return visitExpressionWithTypeArguments(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 176 /* ClassStaticBlockDeclaration */: return Debug.fail("Class and object literal elements must be visited with their respective visitors"); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return visitArrowFunction(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameter(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: return visitAssertionExpression(node); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return visitSatisfiesExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return visitNewExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return visitNonNullExpression(node); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return visitEnumDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return visitModuleDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 286 /* JsxOpeningElement */: + case 287 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: return visitEachChild(node, visitor, context); @@ -97840,19 +98861,19 @@ function transformTypeScript(context) { } function shouldAddTypeMetadata(node) { const kind = node.kind; - return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */; + return kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */ || kind === 173 /* PropertyDeclaration */; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 174 /* MethodDeclaration */; + return node.kind === 175 /* MethodDeclaration */; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return getFirstConstructorWithBody(node) !== void 0; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; } return false; @@ -98497,7 +99518,7 @@ function transformTypeScript(context) { /*allowSourceMaps*/ true )); - const varFlags = currentLexicalScope.kind === 307 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; + const varFlags = currentLexicalScope.kind === 308 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; const statement = factory2.createVariableStatement( visitNodes2(node.modifiers, modifierVisitor, isModifier), factory2.createVariableDeclarationList([varDecl], varFlags) @@ -98508,7 +99529,7 @@ function transformTypeScript(context) { setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 266 /* EnumDeclaration */) { + if (node.kind === 267 /* EnumDeclaration */) { setSourceMapRange(statement.declarationList, node); } else { setSourceMapRange(statement, node); @@ -98616,7 +99637,7 @@ function transformTypeScript(context) { let statementsLocation; let blockLocation; if (node.body) { - if (node.body.kind === 268 /* ModuleBlock */) { + if (node.body.kind === 269 /* ModuleBlock */) { saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement))); statementsLocation = node.body.statements; blockLocation = node.body; @@ -98647,13 +99668,13 @@ function transformTypeScript(context) { true ); setTextRange(block, blockLocation); - if (!node.body || node.body.kind !== 268 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 269 /* ModuleBlock */) { setEmitFlags(block, getEmitFlags(block) | 3072 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 267 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 268 /* ModuleDeclaration */) { const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -98676,19 +99697,13 @@ function transformTypeScript(context) { ) : void 0; } function visitImportClause(node) { - Debug.assert(!node.isTypeOnly); + Debug.assert(node.phaseModifier !== 156 /* TypeKeyword */); const name = shouldEmitAliasDeclaration(node) ? node.name : void 0; const namedBindings = visitNode(node.namedBindings, visitNamedImportBindings, isNamedImportBindings); - return name || namedBindings ? factory2.updateImportClause( - node, - /*isTypeOnly*/ - false, - name, - namedBindings - ) : void 0; + return name || namedBindings ? factory2.updateImportClause(node, node.phaseModifier, name, namedBindings) : void 0; } function visitNamedImportBindings(node) { - if (node.kind === 274 /* NamespaceImport */) { + if (node.kind === 275 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { const allowEmpty = compilerOptions.verbatimModuleSyntax; @@ -98878,15 +99893,15 @@ function transformTypeScript(context) { if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) { enabledSubstitutions |= 2 /* NamespaceExports */; context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(304 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(267 /* ModuleDeclaration */); + context.enableSubstitution(305 /* ShorthandPropertyAssignment */); + context.enableEmitNotification(268 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return getOriginalNode(node).kind === 267 /* ModuleDeclaration */; + return getOriginalNode(node).kind === 268 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return getOriginalNode(node).kind === 266 /* EnumDeclaration */; + return getOriginalNode(node).kind === 267 /* EnumDeclaration */; } function onEmitNode(hint, node, emitCallback) { const savedApplicableSubstitutions = applicableSubstitutions; @@ -98931,9 +99946,9 @@ function transformTypeScript(context) { switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -98948,8 +99963,8 @@ function transformTypeScript(context) { /*prefixLocals*/ false ); - if (container && container.kind !== 307 /* SourceFile */) { - const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 267 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 266 /* EnumDeclaration */; + if (container && container.kind !== 308 /* SourceFile */) { + const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 268 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 267 /* EnumDeclaration */; if (substitute) { return setTextRange( factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node), @@ -99061,72 +100076,72 @@ function transformClassFields(context) { return node; } switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 175 /* ClassStaticBlockDeclaration */: - case 172 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: + case 173 /* PropertyDeclaration */: return Debug.fail("Use `classElementVisitor` instead."); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return visitPropertyAssignment(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameterDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return visitBindingElement(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); case 81 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ false ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ false ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ false ); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); case 110 /* ThisKeyword */: return visitThisExpression(node); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return setCurrentClassElementAnd( /*classElement*/ void 0, fallbackVisitor, node ); - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: { + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: { return setCurrentClassElementAnd( node, fallbackVisitor, @@ -99142,26 +100157,26 @@ function transformClassFields(context) { } function discardedValueVisitor(node) { switch (node.kind) { - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ true ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ true ); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ true ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ @@ -99173,9 +100188,9 @@ function transformClassFields(context) { } function heritageClauseVisitor(node) { switch (node.kind) { - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return visitEachChild(node, heritageClauseVisitor, context); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return visitExpressionWithTypeArgumentsInHeritageClause(node); default: return visitor(node); @@ -99183,8 +100198,8 @@ function transformClassFields(context) { } function assignmentTargetVisitor(node) { switch (node.kind) { - case 210 /* ObjectLiteralExpression */: - case 209 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -99192,35 +100207,35 @@ function transformClassFields(context) { } function classElementVisitor(node) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return setCurrentClassElementAnd( node, visitConstructorDeclaration, node ); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: return setCurrentClassElementAnd( node, visitMethodOrAccessorDeclaration, node ); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return setCurrentClassElementAnd( node, visitPropertyDeclaration, node ); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return setCurrentClassElementAnd( node, visitClassStaticBlockDeclaration, node ); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: return node; default: return isModifierLike(node) ? modifierVisitor(node) : visitor(node); @@ -99228,7 +100243,7 @@ function transformClassFields(context) { } function propertyNameVisitor(node) { switch (node.kind) { - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); default: return visitor(node); @@ -99236,10 +100251,10 @@ function transformClassFields(context) { } function accessorFieldResultVisitor(node) { switch (node.kind) { - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return transformFieldInitializer(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return classElementVisitor(node); default: Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration"); @@ -100730,14 +101745,14 @@ function transformClassFields(context) { if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) { enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */; context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(262 /* FunctionDeclaration */); - context.enableEmitNotification(218 /* FunctionExpression */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(172 /* PropertyDeclaration */); - context.enableEmitNotification(167 /* ComputedPropertyName */); + context.enableEmitNotification(263 /* FunctionDeclaration */); + context.enableEmitNotification(219 /* FunctionExpression */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(173 /* PropertyDeclaration */); + context.enableEmitNotification(168 /* ComputedPropertyName */); } } function addInstanceMethodStatements(statements, methods, receiver) { @@ -101091,17 +102106,17 @@ function transformClassFields(context) { return; } switch (node.kind) { - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) { break; } // falls through - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const savedLexicalEnvironment = lexicalEnvironment; const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; lexicalEnvironment = void 0; @@ -101113,7 +102128,7 @@ function transformClassFields(context) { lexicalEnvironment = savedLexicalEnvironment; return; } - case 167 /* ComputedPropertyName */: { + case 168 /* ComputedPropertyName */: { const savedLexicalEnvironment = lexicalEnvironment; const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; @@ -101253,15 +102268,15 @@ function createRuntimeTypeSerializer(context) { } function serializeTypeOfNode(node, container) { switch (node.kind) { - case 172 /* PropertyDeclaration */: - case 169 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 170 /* Parameter */: return serializeTypeNode(node.type); - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node, container)); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 174 /* MethodDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 175 /* MethodDeclaration */: return factory2.createIdentifier("Function"); default: return factory2.createVoidZero(); @@ -101288,7 +102303,7 @@ function createRuntimeTypeSerializer(context) { return factory2.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 177 /* GetAccessor */) { + if (container && node.kind === 178 /* GetAccessor */) { const { setAccessor } = getAllAccessorDeclarations(container.members, node); if (setAccessor) { return setAccessor.parameters; @@ -101314,22 +102329,22 @@ function createRuntimeTypeSerializer(context) { case 157 /* UndefinedKeyword */: case 146 /* NeverKeyword */: return factory2.createVoidZero(); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: return factory2.createIdentifier("Function"); - case 188 /* ArrayType */: - case 189 /* TupleType */: + case 189 /* ArrayType */: + case 190 /* TupleType */: return factory2.createIdentifier("Array"); - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return node.assertsModifier ? factory2.createVoidZero() : factory2.createIdentifier("Boolean"); case 136 /* BooleanKeyword */: return factory2.createIdentifier("Boolean"); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: case 154 /* StringKeyword */: return factory2.createIdentifier("String"); case 151 /* ObjectKeyword */: return factory2.createIdentifier("Object"); - case 201 /* LiteralType */: + case 202 /* LiteralType */: return serializeLiteralOfLiteralTypeNode(node.literal); case 150 /* NumberKeyword */: return factory2.createIdentifier("Number"); @@ -101337,50 +102352,50 @@ function createRuntimeTypeSerializer(context) { return getGlobalConstructor("BigInt", 7 /* ES2020 */); case 155 /* SymbolKeyword */: return getGlobalConstructor("Symbol", 2 /* ES2015 */); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return serializeTypeReferenceNode(node); - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return serializeUnionOrIntersectionConstituents( node.types, /*isIntersection*/ true ); - case 192 /* UnionType */: + case 193 /* UnionType */: return serializeUnionOrIntersectionConstituents( node.types, /*isIntersection*/ false ); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return serializeUnionOrIntersectionConstituents( [node.trueType, node.falseType], /*isIntersection*/ false ); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: if (node.operator === 148 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 186 /* TypeQuery */: - case 199 /* IndexedAccessType */: - case 200 /* MappedType */: - case 187 /* TypeLiteral */: + case 187 /* TypeQuery */: + case 200 /* IndexedAccessType */: + case 201 /* MappedType */: + case 188 /* TypeLiteral */: case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: - case 197 /* ThisType */: - case 205 /* ImportType */: + case 198 /* ThisType */: + case 206 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: - case 317 /* JSDocFunctionType */: - case 318 /* JSDocVariadicType */: - case 319 /* JSDocNamepathType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: + case 318 /* JSDocFunctionType */: + case 319 /* JSDocVariadicType */: + case 320 /* JSDocNamepathType */: break; - case 314 /* JSDocNullableType */: - case 315 /* JSDocNonNullableType */: - case 316 /* JSDocOptionalType */: + case 315 /* JSDocNullableType */: + case 316 /* JSDocNonNullableType */: + case 317 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return Debug.failBadSyntaxKind(node); @@ -101392,7 +102407,7 @@ function createRuntimeTypeSerializer(context) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return factory2.createIdentifier("String"); - case 224 /* PrefixUnaryExpression */: { + case 225 /* PrefixUnaryExpression */: { const operand = node.operand; switch (operand.kind) { case 9 /* NumericLiteral */: @@ -101549,7 +102564,7 @@ function createRuntimeTypeSerializer(context) { name.original = void 0; setParent(name, getParseTreeNode(currentLexicalScope)); return name; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -101599,23 +102614,23 @@ function transformLegacyDecorators(context) { return node; } switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return void 0; - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return visitConstructorDeclaration(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameterDeclaration(node); default: return visitEachChild(node, visitor, context); @@ -102209,80 +103224,80 @@ function transformESDecorators(context) { return node; } switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return Debug.fail("Use `modifierVisitor` instead."); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameterDeclaration(node); // Support NamedEvaluation to ensure the correct class name for class expressions. - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ false ); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return visitPropertyAssignment(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return visitBindingElement(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); case 110 /* ThisKeyword */: return visitThisExpression(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ false ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ false ); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression( node, /*discarded*/ false ); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ false ); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: // object literal methods and accessors - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: { + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: { enterOther(); const result = visitEachChild(node, fallbackVisitor, context); exitOther(); @@ -102294,7 +103309,7 @@ function transformESDecorators(context) { } function fallbackVisitor(node) { switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return void 0; default: return visitor(node); @@ -102302,7 +103317,7 @@ function transformESDecorators(context) { } function modifierVisitor(node) { switch (node.kind) { - case 170 /* Decorator */: + case 171 /* Decorator */: return void 0; default: return node; @@ -102310,17 +103325,17 @@ function transformESDecorators(context) { } function classElementVisitor(node) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return visitConstructorDeclaration(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return visitClassStaticBlockDeclaration(node); default: return visitor(node); @@ -102328,26 +103343,26 @@ function transformESDecorators(context) { } function discardedValueVisitor(node) { switch (node.kind) { - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ true ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ true ); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ true ); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ @@ -104022,16 +105037,16 @@ function transformES2017(context) { } function argumentsVisitor(node) { switch (node.kind) { - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: return node; - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 260 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 261 /* VariableDeclaration */: break; case 80 /* Identifier */: if (lexicalArgumentsBinding && resolver.isArgumentsLocalBinding(node)) { @@ -104048,34 +105063,34 @@ function transformES2017(context) { switch (node.kind) { case 134 /* AsyncKeyword */: return void 0; - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return visitAwaitExpression(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return visitEachChild(node, visitor, context); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { hasSuperElementAccess = true; } return visitEachChild(node, visitor, context); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node); - case 176 /* Constructor */: + case 177 /* Constructor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return visitEachChild(node, visitor, context); @@ -104084,27 +105099,27 @@ function transformES2017(context) { function asyncBodyVisitor(node) { if (isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 241 /* Block */: - case 255 /* SwitchStatement */: - case 269 /* CaseBlock */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: - case 258 /* TryStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 245 /* IfStatement */: - case 254 /* WithStatement */: - case 256 /* LabeledStatement */: + case 242 /* Block */: + case 256 /* SwitchStatement */: + case 270 /* CaseBlock */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: + case 259 /* TryStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 246 /* IfStatement */: + case 255 /* WithStatement */: + case 257 /* LabeledStatement */: return visitEachChild(node, asyncBodyVisitor, context); default: return Debug.assertNever(node, "Unhandled node."); @@ -104434,7 +105449,7 @@ function transformES2017(context) { const newParameters = []; for (const parameter of node.parameters) { if (parameter.initializer || parameter.dotDotDotToken) { - if (node.kind === 219 /* ArrowFunction */) { + if (node.kind === 220 /* ArrowFunction */) { const restParameter = factory2.createParameterDeclaration( /*modifiers*/ void 0, @@ -104464,7 +105479,7 @@ function transformES2017(context) { const original = getOriginalNode(node, isFunctionLike); const nodeType = original.type; const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0; - const isArrowFunction2 = node.kind === 219 /* ArrowFunction */; + const isArrowFunction2 = node.kind === 220 /* ArrowFunction */; const savedLexicalArgumentsBinding = lexicalArgumentsBinding; const hasLexicalArguments = resolver.hasNodeCheckFlag(node, 512 /* CaptureArguments */); const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding; @@ -104588,15 +105603,15 @@ function transformES2017(context) { function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(213 /* CallExpression */); - context.enableSubstitution(211 /* PropertyAccessExpression */); - context.enableSubstitution(212 /* ElementAccessExpression */); - context.enableEmitNotification(263 /* ClassDeclaration */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(243 /* VariableStatement */); + context.enableSubstitution(214 /* CallExpression */); + context.enableSubstitution(212 /* PropertyAccessExpression */); + context.enableSubstitution(213 /* ElementAccessExpression */); + context.enableEmitNotification(264 /* ClassDeclaration */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(244 /* VariableStatement */); } } function onEmitNode(hint, node, emitCallback) { @@ -104627,11 +105642,11 @@ function transformES2017(context) { } function substituteExpression(node) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -104675,7 +105690,7 @@ function transformES2017(context) { } function isSuperContainer(node) { const kind = node.kind; - return kind === 263 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 264 /* ClassDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { @@ -104915,119 +105930,119 @@ function transformES2018(context) { return node; } switch (node.kind) { - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return visitAwaitExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return visitYieldExpression(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitReturnStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 249 /* ForInStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 250 /* ForInStatement */: return doWithHierarchyFacts( visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */ ); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return doWithHierarchyFacts( visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */ ); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return visitVoidExpression(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return doWithHierarchyFacts( visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return doWithHierarchyFacts( visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return doWithHierarchyFacts( visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return doWithHierarchyFacts( visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return doWithHierarchyFacts( visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return doWithHierarchyFacts( visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return doWithHierarchyFacts( visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */ ); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameter(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return visitEachChild(node, visitor, context); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { hasSuperElementAccess = true; } return visitEachChild(node, visitor, context); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return doWithHierarchyFacts( visitDefault, node, @@ -105115,7 +106130,7 @@ function transformES2018(context) { function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { const statement = unwrapInnermostStatementOfLabel(node); - if (statement.kind === 250 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node); @@ -105126,7 +106141,7 @@ function transformES2018(context) { let chunkObject; const objects = []; for (const e of elements) { - if (e.kind === 305 /* SpreadAssignment */) { + if (e.kind === 306 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory2.createObjectLiteralExpression(chunkObject)); chunkObject = void 0; @@ -105136,7 +106151,7 @@ function transformES2018(context) { } else { chunkObject = append( chunkObject, - e.kind === 303 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike) + e.kind === 304 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike) ); } } @@ -105148,7 +106163,7 @@ function transformES2018(context) { function visitObjectLiteralExpression(node) { if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { const objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 211 /* ObjectLiteralExpression */) { objects.unshift(factory2.createObjectLiteralExpression()); } let expression = objects[0]; @@ -105932,15 +106947,15 @@ function transformES2018(context) { function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(213 /* CallExpression */); - context.enableSubstitution(211 /* PropertyAccessExpression */); - context.enableSubstitution(212 /* ElementAccessExpression */); - context.enableEmitNotification(263 /* ClassDeclaration */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(243 /* VariableStatement */); + context.enableSubstitution(214 /* CallExpression */); + context.enableSubstitution(212 /* PropertyAccessExpression */); + context.enableSubstitution(213 /* ElementAccessExpression */); + context.enableEmitNotification(264 /* ClassDeclaration */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(244 /* VariableStatement */); } } function onEmitNode(hint, node, emitCallback) { @@ -105971,11 +106986,11 @@ function transformES2018(context) { } function substituteExpression(node) { switch (node.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -106019,7 +107034,7 @@ function transformES2018(context) { } function isSuperContainer(node) { const kind = node.kind; - return kind === 263 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 264 /* ClassDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { @@ -106064,7 +107079,7 @@ function transformES2019(context) { return node; } switch (node.kind) { - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); default: return visitEachChild(node, visitor, context); @@ -106103,7 +107118,7 @@ function transformES2020(context) { return node; } switch (node.kind) { - case 213 /* CallExpression */: { + case 214 /* CallExpression */: { const updated = visitNonOptionalCallExpression( node, /*captureThisArg*/ @@ -106112,8 +107127,8 @@ function transformES2020(context) { Debug.assertNotNode(updated, isSyntheticReference); return updated; } - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: if (isOptionalChain(node)) { const updated = visitOptionalExpression( node, @@ -106126,12 +107141,12 @@ function transformES2020(context) { return updated; } return visitEachChild(node, visitor, context); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (node.operatorToken.kind === 61 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return visitEachChild(node, visitor, context); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return visitDeleteExpression(node); default: return visitEachChild(node, visitor, context); @@ -106169,7 +107184,7 @@ function transformES2020(context) { thisArg = expression; } } - expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); + expression = node.kind === 212 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression; } function visitNonOptionalCallExpression(node, captureThisArg) { @@ -106205,12 +107220,12 @@ function transformES2020(context) { } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return visitNode(node, visitor, isExpression); @@ -106236,8 +107251,8 @@ function transformES2020(context) { for (let i = 0; i < chain.length; i++) { const segment = chain[i]; switch (segment.kind) { - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!isSimpleCopiableExpression(rightExpression)) { thisArg = factory2.createTempVariable(hoistVariableDeclaration); @@ -106246,9 +107261,9 @@ function transformES2020(context) { thisArg = rightExpression; } } - rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); + rightExpression = segment.kind === 212 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (i === 0 && leftThisArg) { if (!isGeneratedIdentifier(leftThisArg)) { leftThisArg = factory2.cloneNode(leftThisArg); @@ -106450,15 +107465,15 @@ function transformESNext(context) { return node; } switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return visitSourceFile(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); default: return visitEachChild(node, visitor, context); @@ -106736,16 +107751,16 @@ function transformESNext(context) { function hoist(node) { if (!topLevelStatements) return node; switch (node.kind) { - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 278 /* ExportDeclaration */: - case 262 /* FunctionDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 279 /* ExportDeclaration */: + case 263 /* FunctionDeclaration */: return hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return hoistExportAssignment(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return hoistClassDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return hoistVariableStatement(node); } return node; @@ -107137,8 +108152,8 @@ function transformJsx(context) { /*modifiers*/ void 0, factory2.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory2.createNamedImports(arrayFrom(importSpecifiersMap.values())) @@ -107203,25 +108218,25 @@ function transformJsx(context) { } function visitorWorker(node) { switch (node.kind) { - case 284 /* JsxElement */: + case 285 /* JsxElement */: return visitJsxElement( node, /*isChild*/ false ); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement( node, /*isChild*/ false ); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return visitJsxFragment( node, /*isChild*/ false ); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return visitJsxExpression(node); default: return visitEachChild(node, visitor, context); @@ -107231,21 +108246,21 @@ function transformJsx(context) { switch (node.kind) { case 12 /* JsxText */: return visitJsxText(node); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return visitJsxExpression(node); - case 284 /* JsxElement */: + case 285 /* JsxElement */: return visitJsxElement( node, /*isChild*/ true ); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement( node, /*isChild*/ true ); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return visitJsxFragment( node, /*isChild*/ @@ -107497,7 +108512,7 @@ function transformJsx(context) { const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return setTextRange(literal, node); } - if (node.kind === 294 /* JsxExpression */) { + if (node.kind === 295 /* JsxExpression */) { if (node.expression === void 0) { return factory2.createTrue(); } @@ -107571,7 +108586,7 @@ function transformJsx(context) { return decoded === text ? void 0 : decoded; } function getTagName(node) { - if (node.kind === 284 /* JsxElement */) { + if (node.kind === 285 /* JsxElement */) { return getTagName(node.openingElement); } else { const tagName = node.tagName; @@ -107871,7 +108886,7 @@ function transformES2016(context) { return node; } switch (node.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node); default: return visitEachChild(node, visitor, context); @@ -107999,7 +109014,7 @@ function transformES2015(context) { hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return (hierarchyFacts & 8192 /* ConstructorWithSuperCall */) !== 0 && node.kind === 253 /* ReturnStatement */ && !node.expression; + return (hierarchyFacts & 8192 /* ConstructorWithSuperCall */) !== 0 && node.kind === 254 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement( @@ -108068,85 +109083,85 @@ function transformES2015(context) { case 126 /* StaticKeyword */: return void 0; // elide static keyword - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return visitClassExpression(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return visitParameter(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return visitArrowFunction(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return visitVariableDeclaration(node); case 80 /* Identifier */: return visitIdentifier(node); - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return visitCaseBlock(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock( node, /*isFunctionBody*/ false ); - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return visitDoOrWhileStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return visitNewExpression(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 15 /* NoSubstitutionTemplateLiteral */: case 16 /* TemplateHead */: @@ -108157,13 +109172,13 @@ function transformES2015(context) { return visitStringLiteral(node); case 9 /* NumericLiteral */: return visitNumericLiteral(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return visitTemplateExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return visitYieldExpression(node); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return visitSpreadElement(node); case 108 /* SuperKeyword */: return visitSuperKeyword( @@ -108173,18 +109188,18 @@ function transformES2015(context) { ); case 110 /* ThisKeyword */: return visitThisKeyword(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return visitMetaProperty(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return visitAccessorDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitReturnStatement(node); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return visitVoidExpression(node); default: return visitEachChild(node, visitor, context); @@ -108299,13 +109314,13 @@ function transformES2015(context) { } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - const jump = node.kind === 252 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + const jump = node.kind === 253 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump; if (!canUseBreakOrContinue) { let labelMarker; const label = node.label; if (!label) { - if (node.kind === 252 /* BreakStatement */) { + if (node.kind === 253 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } else { @@ -108313,7 +109328,7 @@ function transformES2015(context) { labelMarker = "continue"; } } else { - if (node.kind === 252 /* BreakStatement */) { + if (node.kind === 253 /* BreakStatement */) { labelMarker = `break-${label.escapedText}`; setLabeledJump( convertedLoopState, @@ -108531,17 +109546,17 @@ function transformES2015(context) { } switch (node.kind) { // stop at function boundaries - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return false; // only step into computed property names for class and object literal elements - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const named = node; if (isComputedPropertyName(named.name)) { return !!forEachChild(named.name, containsSuperCall); @@ -108747,17 +109762,17 @@ function transformES2015(context) { } switch (node.kind) { // stop at function boundaries - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return node; // only step into computed property names for class and object literal elements - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const named = node; if (isComputedPropertyName(named.name)) { return factory2.replacePropertyName(named, visitEachChild( @@ -108800,17 +109815,17 @@ function transformES2015(context) { } switch (node.kind) { // stop at function boundaries - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return node; // only step into computed property names for class and object literal elements - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - case 172 /* PropertyDeclaration */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: { const named = node; if (isComputedPropertyName(named.name)) { return factory2.replacePropertyName(named, visitEachChild( @@ -108846,14 +109861,14 @@ function transformES2015(context) { return body; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 253 /* ReturnStatement */) { + if (statement.kind === 254 /* ReturnStatement */) { return true; - } else if (statement.kind === 245 /* IfStatement */) { + } else if (statement.kind === 246 /* IfStatement */) { const ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } - } else if (statement.kind === 241 /* Block */) { + } else if (statement.kind === 242 /* Block */) { const lastStatement = lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -109127,7 +110142,7 @@ function transformES2015(context) { return true; } function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 131072 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) { + if (hierarchyFacts & 131072 /* CapturedLexicalThis */ && node.kind !== 220 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory2.createThis()); return true; } @@ -109157,21 +110172,21 @@ function transformES2015(context) { if (hierarchyFacts & 32768 /* NewTarget */) { let newTarget; switch (node.kind) { - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return statements; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: newTarget = factory2.createVoidZero(); break; - case 176 /* Constructor */: + case 177 /* Constructor */: newTarget = factory2.createPropertyAccessExpression( setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), "constructor" ); break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: newTarget = factory2.createConditionalExpression( factory2.createLogicalAnd( setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), @@ -109217,21 +110232,21 @@ function transformES2015(context) { function addClassMembers(statements, node) { for (const member of node.members) { switch (member.kind) { - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: const accessors = getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: break; default: Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); @@ -109438,7 +110453,7 @@ function transformES2015(context) { const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */); const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); - if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { + if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 219 /* FunctionExpression */)) { name = factory2.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -109499,7 +110514,7 @@ function transformES2015(context) { multiLine = true; } } else { - Debug.assert(node.kind === 219 /* ArrowFunction */); + Debug.assert(node.kind === 220 /* ArrowFunction */); statementsLocation = moveRangeEnd(body, -1); const equalsGreaterThanToken = node.equalsGreaterThanToken; if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) { @@ -109723,14 +110738,14 @@ function transformES2015(context) { } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -110080,7 +111095,7 @@ function transformES2015(context) { let numInitialProperties = -1, hasComputed = false; for (let i = 0; i < properties.length; i++) { const property = properties[i]; - if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) { + if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 168 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -110200,15 +111215,15 @@ function transformES2015(context) { } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 248 /* ForStatement */: + case 249 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return Debug.failBadSyntaxKind(node, "IterationStatement expected"); @@ -110260,11 +111275,11 @@ function transformES2015(context) { function createConvertedLoopState(node) { let loopInitializer; switch (node.kind) { - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: const initializer = node.initializer; - if (initializer && initializer.kind === 261 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 262 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -110698,20 +111713,20 @@ function transformES2015(context) { for (let i = start; i < numProperties; i++) { const property = properties[i]; switch (property.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: const accessors = getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -110837,7 +111852,7 @@ function transformES2015(context) { let updated; const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body); } else { updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body); @@ -111200,13 +112215,13 @@ function transformES2015(context) { if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(176 /* Constructor */); - context.enableEmitNotification(174 /* MethodDeclaration */); - context.enableEmitNotification(177 /* GetAccessor */); - context.enableEmitNotification(178 /* SetAccessor */); - context.enableEmitNotification(219 /* ArrowFunction */); - context.enableEmitNotification(218 /* FunctionExpression */); - context.enableEmitNotification(262 /* FunctionDeclaration */); + context.enableEmitNotification(177 /* Constructor */); + context.enableEmitNotification(175 /* MethodDeclaration */); + context.enableEmitNotification(178 /* GetAccessor */); + context.enableEmitNotification(179 /* SetAccessor */); + context.enableEmitNotification(220 /* ArrowFunction */); + context.enableEmitNotification(219 /* FunctionExpression */); + context.enableEmitNotification(263 /* FunctionDeclaration */); } } function onSubstituteNode(hint, node) { @@ -111230,10 +112245,10 @@ function transformES2015(context) { } function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 260 /* VariableDeclaration */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 261 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } return false; @@ -111290,11 +112305,11 @@ function transformES2015(context) { return false; } const statement = firstOrUndefined(constructor.body.statements); - if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 244 /* ExpressionStatement */) { + if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) { return false; } const statementExpression = statement.expression; - if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) { + if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 214 /* CallExpression */) { return false; } const callTarget = statementExpression.expression; @@ -111302,7 +112317,7 @@ function transformES2015(context) { return false; } const callArgument = singleOrUndefined(statementExpression.arguments); - if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 230 /* SpreadElement */) { + if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) { return false; } const expression = callArgument.expression; @@ -111391,13 +112406,13 @@ function transformGenerators(context) { } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 246 /* DoStatement */: + case 247 /* DoStatement */: return visitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return visitWhileStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -111405,24 +112420,24 @@ function transformGenerators(context) { } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return visitAccessorDeclaration(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node); - case 252 /* BreakStatement */: + case 253 /* BreakStatement */: return visitBreakStatement(node); - case 251 /* ContinueStatement */: + case 252 /* ContinueStatement */: return visitContinueStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 1048576 /* ContainsYield */) { @@ -111436,23 +112451,23 @@ function transformGenerators(context) { } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return visitBinaryExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return visitCommaListExpression(node); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return visitConditionalExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return visitYieldExpression(node); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return visitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return visitNewExpression(node); default: return visitEachChild(node, visitor, context); @@ -111460,9 +112475,9 @@ function transformGenerators(context) { } function visitGenerator(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return visitFunctionExpression(node); default: return Debug.failBadSyntaxKind(node); @@ -111647,14 +112662,14 @@ function transformGenerators(context) { if (containsYield(right)) { let target; switch (left.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: target = factory2.updateElementAccessExpression(left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression)))); break; default: @@ -111974,35 +112989,35 @@ function transformGenerators(context) { } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 241 /* Block */: + case 242 /* Block */: return transformAndEmitBlock(node); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return transformAndEmitIfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return transformAndEmitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return transformAndEmitForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 251 /* ContinueStatement */: + case 252 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 252 /* BreakStatement */: + case 253 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return transformAndEmitWithStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(visitNode(node, visitor, isStatement)); @@ -112349,7 +113364,7 @@ function transformGenerators(context) { for (let i = 0; i < numClauses; i++) { const clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 297 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 298 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -112359,7 +113374,7 @@ function transformGenerators(context) { let defaultClausesSkipped = 0; for (let i = clausesWritten; i < numClauses; i++) { const clause = caseBlock.clauses[i]; - if (clause.kind === 296 /* CaseClause */) { + if (clause.kind === 297 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -113325,12 +114340,12 @@ function transformModule(context) { const previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(213 /* CallExpression */); - context.enableSubstitution(215 /* TaggedTemplateExpression */); + context.enableSubstitution(214 /* CallExpression */); + context.enableSubstitution(216 /* TaggedTemplateExpression */); context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(226 /* BinaryExpression */); - context.enableSubstitution(304 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(307 /* SourceFile */); + context.enableSubstitution(227 /* BinaryExpression */); + context.enableSubstitution(305 /* ShorthandPropertyAssignment */); + context.enableEmitNotification(308 /* SourceFile */); const moduleInfoMap = []; let currentSourceFile; let currentModuleInfo; @@ -113771,13 +114786,13 @@ function transformModule(context) { } function topLevelVisitor(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitTopLevelImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitTopLevelImportEqualsDeclaration(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return visitTopLevelExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitTopLevelExportAssignment(node); default: return topLevelNestedVisitor(node); @@ -113785,45 +114800,45 @@ function transformModule(context) { } function topLevelNestedVisitor(node) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ true ); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return visitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return visitWhileStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return visitWithStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return visitIfStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return visitCaseBlock(node); - case 296 /* CaseClause */: + case 297 /* CaseClause */: return visitCaseClause(node); - case 297 /* DefaultClause */: + case 298 /* DefaultClause */: return visitDefaultClause(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return visitTryStatement(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock(node); default: return visitor(node); @@ -113834,19 +114849,19 @@ function transformModule(context) { return node; } switch (node.kind) { - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ false ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 213 /* CallExpression */: + case 214 /* CallExpression */: const needsRewrite = node === firstOrUndefined(importsAndRequiresToRewriteOrShim); if (needsRewrite) { importsAndRequiresToRewriteOrShim.shift(); @@ -113857,13 +114872,13 @@ function transformModule(context) { return shimOrRewriteImportOrRequireCall(node); } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isDestructuringAssignment(node)) { return visitDestructuringAssignment(node, valueIsDiscarded); } break; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded); } return visitEachChild(node, visitor, context); @@ -113886,24 +114901,24 @@ function transformModule(context) { if (isObjectLiteralExpression(node)) { for (const elem of node.properties) { switch (elem.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return false; default: Debug.assertNever(elem, "Unhandled object member kind"); @@ -114874,10 +115889,10 @@ function transformModule(context) { const namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, seen, namedBindings); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: for (const importBinding of namedBindings.elements) { statements = appendExportsOfDeclaration( statements, @@ -115069,7 +116084,7 @@ function transformModule(context) { return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)]; previousOnEmitNode(hint, node, emitCallback); @@ -115107,11 +116122,11 @@ function transformModule(context) { switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return substituteCallExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return substituteTaggedTemplateExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return substituteBinaryExpression(node); } return node; @@ -115164,7 +116179,7 @@ function transformModule(context) { return node; } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); - if (exportContainer && exportContainer.kind === 307 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { return setTextRange( factory2.createPropertyAccessExpression( factory2.createIdentifier("exports"), @@ -115273,10 +116288,10 @@ function transformSystemModule(context) { context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(304 /* ShorthandPropertyAssignment */); - context.enableSubstitution(226 /* BinaryExpression */); - context.enableSubstitution(236 /* MetaProperty */); - context.enableEmitNotification(307 /* SourceFile */); + context.enableSubstitution(305 /* ShorthandPropertyAssignment */); + context.enableSubstitution(227 /* BinaryExpression */); + context.enableSubstitution(237 /* MetaProperty */); + context.enableEmitNotification(308 /* SourceFile */); const moduleInfoMap = []; const exportFunctionsMap = []; const noSubstitutionMap = []; @@ -115460,7 +116475,7 @@ function transformSystemModule(context) { if (!some(moduleInfo.exportedNames) && moduleInfo.exportedFunctions.size === 0 && moduleInfo.exportSpecifiers.size === 0) { let hasExportDeclarationWithExportClause = false; for (const externalImport of moduleInfo.externalImports) { - if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 279 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -115620,12 +116635,12 @@ function transformSystemModule(context) { for (const entry of group2.externalImports) { const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile); switch (entry.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: if (!entry.importClause) { break; } // falls through - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: Debug.assert(importVariableName !== void 0); statements.push( factory2.createExpressionStatement( @@ -115648,7 +116663,7 @@ function transformSystemModule(context) { ); } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: Debug.assert(importVariableName !== void 0); if (entry.exportClause) { if (isNamedExports(entry.exportClause)) { @@ -115743,13 +116758,13 @@ function transformSystemModule(context) { } function topLevelVisitor(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitImportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return visitExportDeclaration(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); default: return topLevelNestedVisitor(node); @@ -115904,7 +116919,7 @@ function transformSystemModule(context) { } } function shouldHoistVariableDeclarationList(node) { - return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 307 /* SourceFile */ || (getOriginalNode(node).flags & 7 /* BlockScoped */) === 0); + return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 7 /* BlockScoped */) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; @@ -115954,10 +116969,10 @@ function transformSystemModule(context) { const namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: for (const importBinding of namedBindings.elements) { statements = appendExportsOfDeclaration(statements, importBinding); } @@ -116057,45 +117072,45 @@ function transformSystemModule(context) { } function topLevelNestedVisitor(node) { switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return visitVariableStatement(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return visitClassDeclaration(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ true ); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return visitForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return visitForOfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return visitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return visitWhileStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return visitLabeledStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return visitWithStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return visitIfStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return visitSwitchStatement(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return visitCaseBlock(node); - case 296 /* CaseClause */: + case 297 /* CaseClause */: return visitCaseClause(node); - case 297 /* DefaultClause */: + case 298 /* DefaultClause */: return visitDefaultClause(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return visitTryStatement(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return visitCatchClause(node); - case 241 /* Block */: + case 242 /* Block */: return visitBlock(node); default: return visitor(node); @@ -116249,30 +117264,30 @@ function transformSystemModule(context) { return node; } switch (node.kind) { - case 248 /* ForStatement */: + case 249 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ false ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return visitExpressionStatement(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (isDestructuringAssignment(node)) { return visitDestructuringAssignment(node, valueIsDiscarded); } break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (isImportCall(node)) { return visitImportCallExpression(node); } break; - case 224 /* PrefixUnaryExpression */: - case 225 /* PostfixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded); } return visitEachChild(node, visitor, context); @@ -116345,7 +117360,7 @@ function transformSystemModule(context) { return hasExportedReferenceInDestructuringTarget(node.initializer); } else if (isIdentifier(node)) { const container = resolver.getReferencedExportContainer(node); - return container !== void 0 && container.kind === 307 /* SourceFile */; + return container !== void 0 && container.kind === 308 /* SourceFile */; } else { return false; } @@ -116389,7 +117404,7 @@ function transformSystemModule(context) { return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { const id = getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -116423,7 +117438,7 @@ function transformSystemModule(context) { } function substituteUnspecified(node) { switch (node.kind) { - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -116466,9 +117481,9 @@ function transformSystemModule(context) { switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return substituteBinaryExpression(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -116535,7 +117550,7 @@ function transformSystemModule(context) { /*prefixLocals*/ false ); - if (exportContainer && exportContainer.kind === 307 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 308 /* SourceFile */) { exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration)); } exportedNames = addRange(exportedNames, moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]); @@ -116590,7 +117605,7 @@ function transformECMAScriptModule(context) { const previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(307 /* SourceFile */); + context.enableEmitNotification(308 /* SourceFile */); context.enableSubstitution(80 /* Identifier */); const noSubstitution = /* @__PURE__ */ new Set(); let importsAndRequiresToRewriteOrShim; @@ -116655,16 +117670,16 @@ function transformECMAScriptModule(context) { } function visitor(node) { switch (node.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return visitExportAssignment(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportDecl = node; return visitExportDeclaration(exportDecl); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return visitImportDeclaration(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) { return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift()); } @@ -116723,8 +117738,8 @@ function transformECMAScriptModule(context) { /*modifiers*/ void 0, factory2.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory2.createNamedImports([ @@ -116869,8 +117884,8 @@ function transformECMAScriptModule(context) { /*modifiers*/ void 0, factory2.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory2.createNamespaceImport( @@ -116952,8 +117967,8 @@ function transformImpliedNodeFormatDependentModule(context) { const getEmitModuleFormatOfFile2 = (file) => context.getEmitHost().getEmitModuleFormatOfFile(file); context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(307 /* SourceFile */); - context.enableEmitNotification(307 /* SourceFile */); + context.enableSubstitution(308 /* SourceFile */); + context.enableEmitNotification(308 /* SourceFile */); let currentSourceFile; return transformSourceFileOrBundle; function onSubstituteNode(hint, node) { @@ -116996,7 +118011,7 @@ function transformImpliedNodeFormatDependentModule(context) { return result; } function transformSourceFileOrBundle(node) { - return node.kind === 307 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 308 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(map(node.sourceFiles, transformSourceFile)); @@ -117026,7 +118041,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) { function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; @@ -117043,7 +118058,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) { function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1; @@ -117074,12 +118089,12 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { + if (node.kind === 261 /* VariableDeclaration */ || node.kind === 209 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */ || node.kind === 226 /* BinaryExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 2 /* Private */)) { + } else if (node.kind === 173 /* PropertyDeclaration */ || node.kind === 212 /* PropertyAccessExpression */ || node.kind === 213 /* ElementAccessExpression */ || node.kind === 227 /* BinaryExpression */ || node.kind === 172 /* PropertySignature */ || node.kind === 170 /* Parameter */ && hasSyntacticModifier(node.parent, 2 /* Private */)) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */ || node.kind === 170 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; @@ -117096,7 +118111,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { let diagnosticMessage; - if (node.kind === 178 /* SetAccessor */) { + if (node.kind === 179 /* SetAccessor */) { if (isStatic(node)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1; } else { @@ -117118,26 +118133,26 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { function getReturnTypeVisibilityError(symbolAccessibilityResult) { let diagnosticMessage; switch (node.kind) { - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isStatic(node)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } else if (node.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.kind === 264 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -117158,29 +118173,29 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 180 /* ConstructSignature */: - case 185 /* ConstructorType */: + case 181 /* ConstructSignature */: + case 186 /* ConstructorType */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 179 /* CallSignature */: + case 180 /* CallSignature */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isStatic(node.parent)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 262 /* FunctionDeclaration */: - case 184 /* FunctionType */: + case 263 /* FunctionDeclaration */: + case 185 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1; default: return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`); @@ -117189,40 +118204,40 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { function getTypeParameterConstraintVisibilityError() { let diagnosticMessage; switch (node.parent.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 200 /* MappedType */: + case 201 /* MappedType */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isStatic(node.parent)) { diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.parent.kind === 263 /* ClassDeclaration */) { + } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) { diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 184 /* FunctionType */: - case 262 /* FunctionDeclaration */: + case 185 /* FunctionType */: + case 263 /* FunctionDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 195 /* InferType */: + case 196 /* InferType */: diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1; break; - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -117264,37 +118279,37 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) { } function createGetIsolatedDeclarationErrors(resolver) { const relatedSuggestionByDeclarationKind = { - [219 /* ArrowFunction */]: Diagnostics.Add_a_return_type_to_the_function_expression, - [218 /* FunctionExpression */]: Diagnostics.Add_a_return_type_to_the_function_expression, - [174 /* MethodDeclaration */]: Diagnostics.Add_a_return_type_to_the_method, - [177 /* GetAccessor */]: Diagnostics.Add_a_return_type_to_the_get_accessor_declaration, - [178 /* SetAccessor */]: Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration, - [262 /* FunctionDeclaration */]: Diagnostics.Add_a_return_type_to_the_function_declaration, - [180 /* ConstructSignature */]: Diagnostics.Add_a_return_type_to_the_function_declaration, - [169 /* Parameter */]: Diagnostics.Add_a_type_annotation_to_the_parameter_0, - [260 /* VariableDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_variable_0, - [172 /* PropertyDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_property_0, - [171 /* PropertySignature */]: Diagnostics.Add_a_type_annotation_to_the_property_0, - [277 /* ExportAssignment */]: Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it + [220 /* ArrowFunction */]: Diagnostics.Add_a_return_type_to_the_function_expression, + [219 /* FunctionExpression */]: Diagnostics.Add_a_return_type_to_the_function_expression, + [175 /* MethodDeclaration */]: Diagnostics.Add_a_return_type_to_the_method, + [178 /* GetAccessor */]: Diagnostics.Add_a_return_type_to_the_get_accessor_declaration, + [179 /* SetAccessor */]: Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration, + [263 /* FunctionDeclaration */]: Diagnostics.Add_a_return_type_to_the_function_declaration, + [181 /* ConstructSignature */]: Diagnostics.Add_a_return_type_to_the_function_declaration, + [170 /* Parameter */]: Diagnostics.Add_a_type_annotation_to_the_parameter_0, + [261 /* VariableDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_variable_0, + [173 /* PropertyDeclaration */]: Diagnostics.Add_a_type_annotation_to_the_property_0, + [172 /* PropertySignature */]: Diagnostics.Add_a_type_annotation_to_the_property_0, + [278 /* ExportAssignment */]: Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it }; const errorByDeclarationKind = { - [218 /* FunctionExpression */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [262 /* FunctionDeclaration */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [219 /* ArrowFunction */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [174 /* MethodDeclaration */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [180 /* ConstructSignature */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, - [177 /* GetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [178 /* SetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [169 /* Parameter */]: Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [260 /* VariableDeclaration */]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [172 /* PropertyDeclaration */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [171 /* PropertySignature */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, - [167 /* ComputedPropertyName */]: Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations, - [305 /* SpreadAssignment */]: Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations, - [304 /* ShorthandPropertyAssignment */]: Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations, - [209 /* ArrayLiteralExpression */]: Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations, - [277 /* ExportAssignment */]: Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations, - [230 /* SpreadElement */]: Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations + [219 /* FunctionExpression */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [263 /* FunctionDeclaration */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [220 /* ArrowFunction */]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [175 /* MethodDeclaration */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [181 /* ConstructSignature */]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations, + [178 /* GetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [179 /* SetAccessor */]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [170 /* Parameter */]: Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [261 /* VariableDeclaration */]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [173 /* PropertyDeclaration */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [172 /* PropertySignature */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations, + [168 /* ComputedPropertyName */]: Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations, + [306 /* SpreadAssignment */]: Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations, + [305 /* ShorthandPropertyAssignment */]: Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations, + [210 /* ArrayLiteralExpression */]: Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations, + [278 /* ExportAssignment */]: Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations, + [231 /* SpreadElement */]: Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations }; return getDiagnostic2; function getDiagnostic2(node) { @@ -117307,32 +118322,32 @@ function createGetIsolatedDeclarationErrors(resolver) { } Debug.type(node); switch (node.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return createAccessorTypeError(node); - case 167 /* ComputedPropertyName */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 168 /* ComputedPropertyName */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return createObjectLiteralError(node); - case 209 /* ArrayLiteralExpression */: - case 230 /* SpreadElement */: + case 210 /* ArrayLiteralExpression */: + case 231 /* SpreadElement */: return createArrayLiteralError(node); - case 174 /* MethodDeclaration */: - case 180 /* ConstructSignature */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 181 /* ConstructSignature */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: return createReturnTypeError(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return createBindingElementError(node); - case 172 /* PropertyDeclaration */: - case 260 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: return createVariableOrPropertyError(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return createParameterError(node); - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return createExpressionError(node.initializer); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return createClassExpressionError(node); default: assertType(node); @@ -117646,10 +118661,10 @@ function transformDeclarations(context) { return result; } function transformRoot(node) { - if (node.kind === 307 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 308 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 308 /* Bundle */) { + if (node.kind === 309 /* Bundle */) { isBundledEmit = true; rawReferencedFiles = []; rawTypeReferenceDirectives = []; @@ -117825,14 +118840,14 @@ function transformDeclarations(context) { if (name.kind === 80 /* Identifier */) { return name; } else { - if (name.kind === 207 /* ArrayBindingPattern */) { + if (name.kind === 208 /* ArrayBindingPattern */) { return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { - if (elem.kind === 232 /* OmittedExpression */) { + if (elem.kind === 233 /* OmittedExpression */) { return elem; } if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) { @@ -117922,22 +118937,22 @@ function transformDeclarations(context) { function isDeclarationAndNotVisible(node) { node = getParseTreeNode(node); switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 267 /* ModuleDeclaration */: - case 264 /* InterfaceDeclaration */: - case 263 /* ClassDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: + case 263 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 265 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 271 /* ImportEqualsDeclaration */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: + case 272 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: return false; - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return true; } return false; @@ -118017,7 +119032,7 @@ function transformDeclarations(context) { } function rewriteModuleSpecifier2(parent2, input) { if (!input) return void 0; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 267 /* ModuleDeclaration */ && parent2.kind !== 205 /* ImportType */; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 268 /* ModuleDeclaration */ && parent2.kind !== 206 /* ImportType */; if (isStringLiteralLike(input)) { if (isBundledEmit) { const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2); @@ -118030,7 +119045,7 @@ function transformDeclarations(context) { } function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 283 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 284 /* ExternalModuleReference */) { const specifier = getExternalModuleImportEqualsDeclarationExpression(decl); return factory2.updateImportEqualsDeclaration( decl, @@ -118057,6 +119072,7 @@ function transformDeclarations(context) { tryGetResolutionModeOverride(decl.attributes) ); } + const phaseModifier = decl.importClause.phaseModifier === 166 /* DeferKeyword */ ? void 0 : decl.importClause.phaseModifier; const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0; if (!decl.importClause.namedBindings) { return visibleDefaultBinding && factory2.updateImportDeclaration( @@ -118064,7 +119080,7 @@ function transformDeclarations(context) { decl.modifiers, factory2.updateImportClause( decl.importClause, - decl.importClause.isTypeOnly, + phaseModifier, visibleDefaultBinding, /*namedBindings*/ void 0 @@ -118073,7 +119089,7 @@ function transformDeclarations(context) { tryGetResolutionModeOverride(decl.attributes) ); } - if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 275 /* NamespaceImport */) { const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : ( /*namedBindings*/ void 0 @@ -118083,7 +119099,7 @@ function transformDeclarations(context) { decl.modifiers, factory2.updateImportClause( decl.importClause, - decl.importClause.isTypeOnly, + phaseModifier, visibleDefaultBinding, namedBindings ), @@ -118098,7 +119114,7 @@ function transformDeclarations(context) { decl.modifiers, factory2.updateImportClause( decl.importClause, - decl.importClause.isTypeOnly, + phaseModifier, visibleDefaultBinding, bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0 ), @@ -118190,7 +119206,7 @@ function transformDeclarations(context) { const oldDiag = getSymbolAccessibilityDiagnostic; const canProduceDiagnostic = canProduceDiagnostics(input); const oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */; + let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 188 /* TypeLiteral */ || input.kind === 201 /* MappedType */) && input.parent.kind !== 266 /* TypeAliasDeclaration */; if (isMethodDeclaration(input) || isMethodSignature(input)) { if (hasEffectiveModifier(input, 2 /* Private */)) { if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) return; @@ -118217,26 +119233,26 @@ function transformDeclarations(context) { } if (isProcessedComponent(input)) { switch (input.kind) { - case 233 /* ExpressionWithTypeArguments */: { + case 234 /* ExpressionWithTypeArguments */: { if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } const node = visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 183 /* TypeReference */: { + case 184 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); const node = visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return cleanup(factory2.updateConstructSignature( input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input) )); - case 176 /* Constructor */: { + case 177 /* Constructor */: { const ctor = factory2.createConstructorDeclaration( /*modifiers*/ ensureModifiers(input), @@ -118246,7 +119262,7 @@ function transformDeclarations(context) { ); return cleanup(ctor); } - case 174 /* MethodDeclaration */: { + case 175 /* MethodDeclaration */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118267,7 +119283,7 @@ function transformDeclarations(context) { ); return cleanup(sig); } - case 177 /* GetAccessor */: { + case 178 /* GetAccessor */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118284,7 +119300,7 @@ function transformDeclarations(context) { void 0 )); } - case 178 /* SetAccessor */: { + case 179 /* SetAccessor */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118300,7 +119316,7 @@ function transformDeclarations(context) { void 0 )); } - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118315,7 +119331,7 @@ function transformDeclarations(context) { ensureType(input), ensureNoInitializer(input) )); - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118329,7 +119345,7 @@ function transformDeclarations(context) { input.questionToken, ensureType(input) )); - case 173 /* MethodSignature */: { + case 174 /* MethodSignature */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -118346,7 +119362,7 @@ function transformDeclarations(context) { ensureType(input) )); } - case 179 /* CallSignature */: { + case 180 /* CallSignature */: { return cleanup( factory2.updateCallSignature( input, @@ -118356,7 +119372,7 @@ function transformDeclarations(context) { ) ); } - case 181 /* IndexSignature */: { + case 182 /* IndexSignature */: { return cleanup(factory2.updateIndexSignature( input, ensureModifiers(input), @@ -118364,7 +119380,7 @@ function transformDeclarations(context) { visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(133 /* AnyKeyword */) )); } - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { if (isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -118379,7 +119395,7 @@ function transformDeclarations(context) { ensureNoInitializer(input) )); } - case 168 /* TypeParameter */: { + case 169 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory2.updateTypeParameterDeclaration( input, @@ -118393,7 +119409,7 @@ function transformDeclarations(context) { } return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } - case 194 /* ConditionalType */: { + case 195 /* ConditionalType */: { const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; @@ -118407,7 +119423,7 @@ function transformDeclarations(context) { Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 184 /* FunctionType */: { + case 185 /* FunctionType */: { return cleanup(factory2.updateFunctionTypeNode( input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), @@ -118415,7 +119431,7 @@ function transformDeclarations(context) { Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); } - case 185 /* ConstructorType */: { + case 186 /* ConstructorType */: { return cleanup(factory2.updateConstructorTypeNode( input, ensureModifiers(input), @@ -118424,7 +119440,7 @@ function transformDeclarations(context) { Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) )); } - case 205 /* ImportType */: { + case 206 /* ImportType */: { if (!isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory2.updateImportTypeNode( input, @@ -118463,7 +119479,7 @@ function transformDeclarations(context) { } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */); + return node.parent.kind === 175 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -118471,7 +119487,7 @@ function transformDeclarations(context) { } if (shouldStripInternal(input)) return; switch (input.kind) { - case 278 /* ExportDeclaration */: { + case 279 /* ExportDeclaration */: { if (isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -118485,7 +119501,7 @@ function transformDeclarations(context) { tryGetResolutionModeOverride(input.attributes) ); } - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { if (isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -118548,10 +119564,10 @@ function transformDeclarations(context) { } if (shouldStripInternal(input)) return; switch (input.kind) { - case 271 /* ImportEqualsDeclaration */: { + case 272 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 272 /* ImportDeclaration */: { + case 273 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -118570,7 +119586,7 @@ function transformDeclarations(context) { } const previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 265 /* TypeAliasDeclaration */: { + case 266 /* TypeAliasDeclaration */: { needsDeclare = false; const clean2 = cleanup(factory2.updateTypeAliasDeclaration( input, @@ -118582,7 +119598,7 @@ function transformDeclarations(context) { needsDeclare = previousNeedsDeclare; return clean2; } - case 264 /* InterfaceDeclaration */: { + case 265 /* InterfaceDeclaration */: { return cleanup(factory2.updateInterfaceDeclaration( input, ensureModifiers(input), @@ -118592,7 +119608,7 @@ function transformDeclarations(context) { visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } - case 262 /* FunctionDeclaration */: { + case 263 /* FunctionDeclaration */: { const clean2 = cleanup(factory2.updateFunctionDeclaration( input, ensureModifiers(input), @@ -118704,10 +119720,10 @@ function transformDeclarations(context) { return clean2; } } - case 267 /* ModuleDeclaration */: { + case 268 /* ModuleDeclaration */: { needsDeclare = false; const inner = input.body; - if (inner && inner.kind === 268 /* ModuleBlock */) { + if (inner && inner.kind === 269 /* ModuleBlock */) { const oldNeedsScopeFix = needsScopeFixMarker; const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -118751,7 +119767,7 @@ function transformDeclarations(context) { )); } } - case 263 /* ClassDeclaration */: { + case 264 /* ClassDeclaration */: { errorNameNode = input.name; errorFallbackNode = input; const modifiers = factory2.createNodeArray(ensureModifiers(input)); @@ -118868,10 +119884,10 @@ function transformDeclarations(context) { )); } } - case 243 /* VariableStatement */: { + case 244 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 266 /* EnumDeclaration */: { + case 267 /* EnumDeclaration */: { return cleanup(factory2.updateEnumDeclaration( input, factory2.createNodeArray(ensureModifiers(input)), @@ -118898,7 +119914,7 @@ function transformDeclarations(context) { if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 267 /* ModuleDeclaration */) { + if (input.kind === 268 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -118929,7 +119945,7 @@ function transformDeclarations(context) { return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e))); } function recreateBindingElement(e) { - if (e.kind === 232 /* OmittedExpression */) { + if (e.kind === 233 /* OmittedExpression */) { return; } if (e.name) { @@ -118984,7 +120000,7 @@ function transformDeclarations(context) { function ensureModifierFlags(node) { let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */); let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */; - const parentIsFile = node.parent.kind === 307 /* SourceFile */; + const parentIsFile = node.parent.kind === 308 /* SourceFile */; if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) { mask2 ^= 128 /* Ambient */; additions = 0 /* None */; @@ -119008,7 +120024,7 @@ function transformDeclarations(context) { } } function isAlwaysType(node) { - if (node.kind === 264 /* InterfaceDeclaration */) { + if (node.kind === 265 /* InterfaceDeclaration */) { return true; } return false; @@ -119028,52 +120044,52 @@ function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public * } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return !hasEffectiveModifier(node, 2 /* Private */); - case 169 /* Parameter */: - case 260 /* VariableDeclaration */: + case 170 /* Parameter */: + case 261 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 267 /* ModuleDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 264 /* InterfaceDeclaration */: - case 263 /* ClassDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 243 /* VariableStatement */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 277 /* ExportAssignment */: + case 263 /* FunctionDeclaration */: + case 268 /* ModuleDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 265 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 244 /* VariableStatement */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 278 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 180 /* ConstructSignature */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 181 /* IndexSignature */: - case 260 /* VariableDeclaration */: - case 168 /* TypeParameter */: - case 233 /* ExpressionWithTypeArguments */: - case 183 /* TypeReference */: - case 194 /* ConditionalType */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 205 /* ImportType */: + case 181 /* ConstructSignature */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 182 /* IndexSignature */: + case 261 /* VariableDeclaration */: + case 169 /* TypeParameter */: + case 234 /* ExpressionWithTypeArguments */: + case 184 /* TypeReference */: + case 195 /* ConditionalType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 206 /* ImportType */: return true; } return false; @@ -119090,6 +120106,7 @@ function getModuleTransformer(moduleKind) { case 5 /* ES2015 */: case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: case 1 /* CommonJS */: return transformImpliedNodeFormatDependentModule; @@ -119182,7 +120199,7 @@ function noEmitNotification(hint, node, callback) { } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a, _b; - const enabledSyntaxKindFeatures = new Array(358 /* Count */); + const enabledSyntaxKindFeatures = new Array(359 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -119261,7 +120278,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers, state = 1 /* Initialized */; const transformed = []; for (const node of nodes) { - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 307 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 308 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); (_b = tracing) == null ? void 0 : _b.pop(); } @@ -119578,7 +120595,7 @@ function getOutputPathsForBundle(options, forceDtsPaths) { } function getOutputPathsFor(sourceFile, host, forceDtsPaths) { const options = host.getCompilerOptions(); - if (sourceFile.kind === 308 /* Bundle */) { + if (sourceFile.kind === 309 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options)); @@ -119953,8 +120970,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, mapOptions) { const sourceFileOrBundle = transform2.transformed[0]; - const bundle = sourceFileOrBundle.kind === 308 /* Bundle */ ? sourceFileOrBundle : void 0; - const sourceFile = sourceFileOrBundle.kind === 307 /* SourceFile */ ? sourceFileOrBundle : void 0; + const bundle = sourceFileOrBundle.kind === 309 /* Bundle */ ? sourceFileOrBundle : void 0; + const sourceFile = sourceFileOrBundle.kind === 308 /* SourceFile */ ? sourceFileOrBundle : void 0; const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; let sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -120013,7 +121030,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla return !data.skippedDtsWrite; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { - return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 307 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 308 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || ""); @@ -120112,7 +121129,8 @@ var notImplementedResolver = { getDeclarationStatementsForSourceFile: notImplemented, isImportRequiredByAugmentation: notImplemented, isDefinitelyReferenceToGlobalSymbolObject: notImplemented, - createLateBoundIndexSignatures: notImplemented + createLateBoundIndexSignatures: notImplemented, + symbolToDeclarations: notImplemented }; var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); @@ -120204,9 +121222,9 @@ function createPrinter(printerOptions = {}, handlers = {}) { break; } switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return printFile(node); - case 308 /* Bundle */: + case 309 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); @@ -120484,311 +121502,311 @@ function createPrinter(printerOptions = {}, handlers = {}) { return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: return emitQualifiedName(node); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return emitTypeParameter(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return emitParameter(node); - case 170 /* Decorator */: + case 171 /* Decorator */: return emitDecorator(node); // Type members - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return emitPropertySignature(node); - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: return emitMethodSignature(node); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: return emitClassStaticBlockDeclaration(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return emitConstructor(node); - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return emitAccessorDeclaration(node); - case 179 /* CallSignature */: + case 180 /* CallSignature */: return emitCallSignature(node); - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return emitConstructSignature(node); - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return emitIndexSignature(node); // Types - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: return emitTypePredicate(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return emitTypeReference(node); - case 184 /* FunctionType */: + case 185 /* FunctionType */: return emitFunctionType(node); - case 185 /* ConstructorType */: + case 186 /* ConstructorType */: return emitConstructorType(node); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return emitTypeQuery(node); - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return emitTypeLiteral(node); - case 188 /* ArrayType */: + case 189 /* ArrayType */: return emitArrayType(node); - case 189 /* TupleType */: + case 190 /* TupleType */: return emitTupleType(node); - case 190 /* OptionalType */: + case 191 /* OptionalType */: return emitOptionalType(node); // SyntaxKind.RestType is handled below - case 192 /* UnionType */: + case 193 /* UnionType */: return emitUnionType(node); - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: return emitIntersectionType(node); - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: return emitConditionalType(node); - case 195 /* InferType */: + case 196 /* InferType */: return emitInferType(node); - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return emitParenthesizedType(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 197 /* ThisType */: + case 198 /* ThisType */: return emitThisType(); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: return emitTypeOperator(node); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 200 /* MappedType */: + case 201 /* MappedType */: return emitMappedType(node); - case 201 /* LiteralType */: + case 202 /* LiteralType */: return emitLiteralType(node); - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return emitNamedTupleMember(node); - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: return emitTemplateType(node); - case 204 /* TemplateLiteralTypeSpan */: + case 205 /* TemplateLiteralTypeSpan */: return emitTemplateTypeSpan(node); - case 205 /* ImportType */: + case 206 /* ImportType */: return emitImportTypeNode(node); // Binding patterns - case 206 /* ObjectBindingPattern */: + case 207 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return emitBindingElement(node); // Misc - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return emitTemplateSpan(node); - case 240 /* SemicolonClassElement */: + case 241 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 241 /* Block */: + case 242 /* Block */: return emitBlock(node); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return emitVariableStatement(node); - case 242 /* EmptyStatement */: + case 243 /* EmptyStatement */: return emitEmptyStatement( /*isEmbeddedStatement*/ false ); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return emitExpressionStatement(node); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return emitIfStatement(node); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return emitDoStatement(node); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return emitWhileStatement(node); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return emitForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return emitForInStatement(node); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return emitForOfStatement(node); - case 251 /* ContinueStatement */: + case 252 /* ContinueStatement */: return emitContinueStatement(node); - case 252 /* BreakStatement */: + case 253 /* BreakStatement */: return emitBreakStatement(node); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return emitReturnStatement(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return emitWithStatement(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return emitSwitchStatement(node); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return emitLabeledStatement(node); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return emitThrowStatement(node); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return emitTryStatement(node); - case 259 /* DebuggerStatement */: + case 260 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return emitClassDeclaration(node); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return emitModuleBlock(node); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return emitCaseBlock(node); - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return emitImportDeclaration(node); - case 273 /* ImportClause */: + case 274 /* ImportClause */: return emitImportClause(node); - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: return emitNamespaceImport(node); - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: return emitNamespaceExport(node); - case 275 /* NamedImports */: + case 276 /* NamedImports */: return emitNamedImports(node); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return emitImportSpecifier(node); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return emitExportAssignment(node); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return emitExportDeclaration(node); - case 279 /* NamedExports */: + case 280 /* NamedExports */: return emitNamedExports(node); - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: return emitExportSpecifier(node); - case 300 /* ImportAttributes */: + case 301 /* ImportAttributes */: return emitImportAttributes(node); - case 301 /* ImportAttribute */: + case 302 /* ImportAttribute */: return emitImportAttribute(node); - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return; // Module references - case 283 /* ExternalModuleReference */: + case 284 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 12 /* JsxText */: return emitJsxText(node); - case 286 /* JsxOpeningElement */: - case 289 /* JsxOpeningFragment */: + case 287 /* JsxOpeningElement */: + case 290 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 287 /* JsxClosingElement */: - case 290 /* JsxClosingFragment */: + case 288 /* JsxClosingElement */: + case 291 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return emitJsxAttribute(node); - case 292 /* JsxAttributes */: + case 293 /* JsxAttributes */: return emitJsxAttributes(node); - case 293 /* JsxSpreadAttribute */: + case 294 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 294 /* JsxExpression */: + case 295 /* JsxExpression */: return emitJsxExpression(node); - case 295 /* JsxNamespacedName */: + case 296 /* JsxNamespacedName */: return emitJsxNamespacedName(node); // Clauses - case 296 /* CaseClause */: + case 297 /* CaseClause */: return emitCaseClause(node); - case 297 /* DefaultClause */: + case 298 /* DefaultClause */: return emitDefaultClause(node); - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: return emitHeritageClause(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 306 /* EnumMember */: + case 307 /* EnumMember */: return emitEnumMember(node); // Top-level nodes - case 307 /* SourceFile */: + case 308 /* SourceFile */: return emitSourceFile(node); - case 308 /* Bundle */: + case 309 /* Bundle */: return Debug.fail("Bundles should be printed using printBundle"); // JSDoc nodes (only used in codefixes currently) - case 309 /* JSDocTypeExpression */: + case 310 /* JSDocTypeExpression */: return emitJSDocTypeExpression(node); - case 310 /* JSDocNameReference */: + case 311 /* JSDocNameReference */: return emitJSDocNameReference(node); - case 312 /* JSDocAllType */: + case 313 /* JSDocAllType */: return writePunctuation("*"); - case 313 /* JSDocUnknownType */: + case 314 /* JSDocUnknownType */: return writePunctuation("?"); - case 314 /* JSDocNullableType */: + case 315 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 315 /* JSDocNonNullableType */: + case 316 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 316 /* JSDocOptionalType */: + case 317 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 191 /* RestType */: - case 318 /* JSDocVariadicType */: + case 192 /* RestType */: + case 319 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 319 /* JSDocNamepathType */: + case 320 /* JSDocNamepathType */: return; - case 320 /* JSDoc */: + case 321 /* JSDoc */: return emitJSDoc(node); - case 322 /* JSDocTypeLiteral */: + case 323 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 323 /* JSDocSignature */: + case 324 /* JSDocSignature */: return emitJSDocSignature(node); - case 327 /* JSDocTag */: - case 332 /* JSDocClassTag */: - case 337 /* JSDocOverrideTag */: + case 328 /* JSDocTag */: + case 333 /* JSDocClassTag */: + case 338 /* JSDocOverrideTag */: return emitJSDocSimpleTag(node); - case 328 /* JSDocAugmentsTag */: - case 329 /* JSDocImplementsTag */: + case 329 /* JSDocAugmentsTag */: + case 330 /* JSDocImplementsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocAuthorTag */: - case 331 /* JSDocDeprecatedTag */: + case 331 /* JSDocAuthorTag */: + case 332 /* JSDocDeprecatedTag */: return; // SyntaxKind.JSDocClassTag (see JSDocTag, above) - case 333 /* JSDocPublicTag */: - case 334 /* JSDocPrivateTag */: - case 335 /* JSDocProtectedTag */: - case 336 /* JSDocReadonlyTag */: + case 334 /* JSDocPublicTag */: + case 335 /* JSDocPrivateTag */: + case 336 /* JSDocProtectedTag */: + case 337 /* JSDocReadonlyTag */: return; - case 338 /* JSDocCallbackTag */: + case 339 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 339 /* JSDocOverloadTag */: + case 340 /* JSDocOverloadTag */: return emitJSDocOverloadTag(node); // SyntaxKind.JSDocEnumTag (see below) - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 340 /* JSDocEnumTag */: - case 342 /* JSDocReturnTag */: - case 343 /* JSDocThisTag */: - case 344 /* JSDocTypeTag */: - case 349 /* JSDocThrowsTag */: - case 350 /* JSDocSatisfiesTag */: + case 341 /* JSDocEnumTag */: + case 343 /* JSDocReturnTag */: + case 344 /* JSDocThisTag */: + case 345 /* JSDocTypeTag */: + case 350 /* JSDocThrowsTag */: + case 351 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 347 /* JSDocSeeTag */: + case 348 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 351 /* JSDocImportTag */: + case 352 /* JSDocImportTag */: return emitJSDocImportTag(node); // SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above) // Transformation nodes - case 353 /* NotEmittedStatement */: - case 354 /* NotEmittedTypeElement */: + case 354 /* NotEmittedStatement */: + case 355 /* NotEmittedTypeElement */: return; } if (isExpression(node)) { @@ -120824,86 +121842,86 @@ function createPrinter(printerOptions = {}, handlers = {}) { case 81 /* PrivateIdentifier */: return emitPrivateIdentifier(node); // Expressions - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return emitCallExpression(node); - case 214 /* NewExpression */: + case 215 /* NewExpression */: return emitNewExpression(node); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: return emitFunctionExpression(node); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return emitArrowFunction(node); - case 220 /* DeleteExpression */: + case 221 /* DeleteExpression */: return emitDeleteExpression(node); - case 221 /* TypeOfExpression */: + case 222 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 222 /* VoidExpression */: + case 223 /* VoidExpression */: return emitVoidExpression(node); - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: return emitAwaitExpression(node); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return emitBinaryExpression(node); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return emitConditionalExpression(node); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return emitTemplateExpression(node); - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: return emitYieldExpression(node); - case 230 /* SpreadElement */: + case 231 /* SpreadElement */: return emitSpreadElement(node); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return emitClassExpression(node); - case 232 /* OmittedExpression */: + case 233 /* OmittedExpression */: return; - case 234 /* AsExpression */: + case 235 /* AsExpression */: return emitAsExpression(node); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return emitNonNullExpression(node); - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return emitSatisfiesExpression(node); - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return emitMetaProperty(node); - case 237 /* SyntheticExpression */: + case 238 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); - case 282 /* MissingDeclaration */: + case 283 /* MissingDeclaration */: return; // JSX - case 284 /* JsxElement */: + case 285 /* JsxElement */: return emitJsxElement(node); - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return emitJsxFragment(node); // Synthesized list - case 352 /* SyntaxList */: + case 353 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); // Transformation nodes - case 353 /* NotEmittedStatement */: + case 354 /* NotEmittedStatement */: return; - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 356 /* CommaListExpression */: + case 357 /* CommaListExpression */: return emitCommaList(node); - case 357 /* SyntheticReferenceExpression */: + case 358 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -120927,7 +121945,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitHelpers(node) { let helpersEmitted = false; - const bundle = node.kind === 308 /* Bundle */ ? node : void 0; + const bundle = node.kind === 309 /* Bundle */ ? node : void 0; if (bundle && moduleKind === 0 /* None */) { return; } @@ -121008,7 +122026,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { nonEscapingWrite(`}`); } function emitTabStop(hint, node, snippet) { - Debug.assert(node.kind === 242 /* EmptyStatement */, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`); + Debug.assert(node.kind === 243 /* EmptyStatement */, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`); Debug.assert(hint !== 5 /* EmbeddedStatement */, `A tab stop cannot be attached to an embedded statement.`); nonEscapingWrite(`$${snippet.order}`); } @@ -121071,7 +122089,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 317 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 318 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { emitTypeAnnotation(node.type); @@ -121144,7 +122162,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { /*allowDecorators*/ true ); - const token = node.kind === 177 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; + const token = node.kind === 178 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); @@ -121590,7 +122608,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function shouldEmitWhitespaceBeforeOperand(node) { const operand = node.operand; - return operand.kind === 224 /* PrefixUnaryExpression */ && (node.operator === 40 /* PlusToken */ && (operand.operator === 40 /* PlusToken */ || operand.operator === 46 /* PlusPlusToken */) || node.operator === 41 /* MinusToken */ && (operand.operator === 41 /* MinusToken */ || operand.operator === 47 /* MinusMinusToken */)); + return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 40 /* PlusToken */ && (operand.operator === 40 /* PlusToken */ || operand.operator === 46 /* PlusPlusToken */) || node.operator === 41 /* MinusToken */ && (operand.operator === 41 /* MinusToken */ || operand.operator === 47 /* MinusMinusToken */)); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); @@ -121845,7 +122863,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(93 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 245 /* IfStatement */) { + if (node.elseStatement.kind === 246 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } else { @@ -121920,7 +122938,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } function emitForBinding(node) { if (node !== void 0) { - if (node.kind === 261 /* VariableDeclarationList */) { + if (node.kind === 262 /* VariableDeclarationList */) { emit(node); } else { emitExpression(node); @@ -121960,7 +122978,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { pos = writeTokenText(token, writer2, pos); } if (isSimilarNode && contextNode.end !== pos) { - const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */; + const isJsxExprContext = contextNode.kind === 295 /* JsxExpression */; emitTrailingCommentsOfPosition( pos, /*prefixSpace*/ @@ -121996,7 +123014,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { function parenthesizeExpressionForNoAsi(node) { if (!commentsDisabled) { switch (node.kind) { - case 355 /* PartiallyEmittedExpression */: + case 356 /* PartiallyEmittedExpression */: if (willEmitLeadingNewLine(node)) { const parseNode = getParseTreeNode(node); if (parseNode && isParenthesizedExpression(parseNode)) { @@ -122011,45 +123029,45 @@ function createPrinter(printerOptions = {}, handlers = {}) { node, parenthesizeExpressionForNoAsi(node.expression) ); - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return factory.updatePropertyAccessExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.name ); - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return factory.updateElementAccessExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.argumentExpression ); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return factory.updateCallExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.typeArguments, node.arguments ); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression( node, parenthesizeExpressionForNoAsi(node.tag), node.typeArguments, node.template ); - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression( node, parenthesizeExpressionForNoAsi(node.operand) ); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return factory.updateBinaryExpression( node, parenthesizeExpressionForNoAsi(node.left), node.operatorToken, node.right ); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return factory.updateConditionalExpression( node, parenthesizeExpressionForNoAsi(node.condition), @@ -122058,19 +123076,19 @@ function createPrinter(printerOptions = {}, handlers = {}) { node.colonToken, node.whenFalse ); - case 234 /* AsExpression */: + case 235 /* AsExpression */: return factory.updateAsExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.type ); - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: return factory.updateSatisfiesExpression( node, parenthesizeExpressionForNoAsi(node.expression), node.type ); - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: return factory.updateNonNullExpression( node, parenthesizeExpressionForNoAsi(node.expression) @@ -122442,8 +123460,8 @@ function createPrinter(printerOptions = {}, handlers = {}) { writeTrailingSemicolon(); } function emitImportClause(node) { - if (node.isTypeOnly) { - emitTokenWithComment(156 /* TypeKeyword */, node.pos, writeKeyword, node); + if (node.phaseModifier !== void 0) { + emitTokenWithComment(node.phaseModifier, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -122768,7 +123786,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 344 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 345 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } else { @@ -122827,7 +123845,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 309 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 310 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { writeSpace(); @@ -122845,7 +123863,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 322 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 323 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -123647,7 +124665,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); } function skipSynthesizedParentheses(node) { - while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { + while (node.kind === 218 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -123728,84 +124746,84 @@ function createPrinter(printerOptions = {}, handlers = {}) { function generateNames(node) { if (!node) return; switch (node.kind) { - case 241 /* Block */: + case 242 /* Block */: forEach(node.statements, generateNames); break; - case 256 /* LabeledStatement */: - case 254 /* WithStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 257 /* LabeledStatement */: + case 255 /* WithStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: generateNames(node.statement); break; - case 245 /* IfStatement */: + case 246 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: forEach(node.clauses, generateNames); break; - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: forEach(node.statements, generateNames); break; - case 258 /* TryStatement */: + case 259 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 299 /* CatchClause */: + case 300 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: generateNames(node.declarationList); break; - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: forEach(node.declarations, generateNames); break; - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: forEach(node.elements, generateNames); break; - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: generateNames(node.importClause); break; - case 273 /* ImportClause */: + case 274 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 280 /* NamespaceExport */: + case 281 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: forEach(node.elements, generateNames); break; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -123813,14 +124831,14 @@ function createPrinter(printerOptions = {}, handlers = {}) { function generateMemberNames(node) { if (!node) return; switch (node.kind) { - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -124099,16 +125117,16 @@ function createPrinter(printerOptions = {}, handlers = {}) { prefix, suffix ); - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForModuleOrEnum(node); - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: { + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: { Debug.assert(!prefix && !suffix && !privateName); const name = node.name; if (name && !isGeneratedIdentifier(name)) { @@ -124123,17 +125141,17 @@ function createPrinter(printerOptions = {}, handlers = {}) { } return generateNameForExportDefault(); } - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForClassExpression(); - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return makeTempVariableName( 0 /* Auto */, /*reservedInNestedScopes*/ @@ -124227,7 +125245,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 353 /* NotEmittedStatement */ + node.kind !== 354 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -124235,7 +125253,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { } if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) { containerEnd = end; - if (node.kind === 261 /* VariableDeclarationList */) { + if (node.kind === 262 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -124251,7 +125269,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 353 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -124497,7 +125515,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { const emitFlags = getEmitFlags(node); const sourceMapRange = getSourceMapRange(node); const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -124510,7 +125528,7 @@ function createPrinter(printerOptions = {}, handlers = {}) { if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -126021,8 +127039,8 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0; let resolvedProjectReferences; let projectReferenceRedirects; - let mapFromFileToProjectReferenceRedirects; - let mapFromToProjectReferenceRedirectSource; + let mapSourceFileToResolvedRef; + let mapOutputFileToResolvedRef; const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect; const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({ compilerHost: host, @@ -126030,7 +127048,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi useSourceOfProjectReferenceRedirect, toPath: toPath3, getResolvedProjectReferences, - getSourceOfProjectReferenceRedirect, + getRedirectFromOutput, forEachResolvedProjectReference: forEachResolvedProjectReference2 }); const readFile = host.readFile.bind(host); @@ -126240,12 +127258,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2, getProjectReferences, getResolvedProjectReferences, - getProjectReferenceRedirect, - getResolvedProjectReferenceToRedirect, + getRedirectFromSourceFile, getResolvedProjectReferenceByPath, forEachResolvedProjectReference: forEachResolvedProjectReference2, isSourceOfProjectReferenceRedirect, - getRedirectReferenceForResolutionFromSourceOfProject, + getRedirectFromOutput, getCompilerOptionsForFile, getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2, getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2, @@ -126374,23 +127391,14 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return result; } function getRedirectReferenceForResolution(file) { - const redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect; - const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path); + var _a2, _b2; + const redirect = getRedirectFromSourceFile(file.originalFileName); + if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect == null ? void 0 : redirect.resolvedRef; + const resultFromDts = (_a2 = getRedirectFromOutput(file.path)) == null ? void 0 : _a2.resolvedRef; if (resultFromDts) return resultFromDts; if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart)) return void 0; const realDeclarationPath = toPath3(host.realpath(file.originalFileName)); - return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(filePath) { - const source = getSourceOfProjectReferenceRedirect(filePath); - if (isString(source)) return getResolvedProjectReferenceToRedirect(source); - if (!source) return void 0; - return forEachResolvedProjectReference2((resolvedRef) => { - const out = resolvedRef.commandLine.options.outFile; - if (!out) return void 0; - return toPath3(out) === filePath ? resolvedRef : void 0; - }); + return realDeclarationPath === file.path ? void 0 : (_b2 = getRedirectFromOutput(realDeclarationPath)) == null ? void 0 : _b2.resolvedRef; } function compareDefaultLibFiles(a, b) { return compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); @@ -126762,8 +127770,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, isSourceFileFromExternalLibrary, - getResolvedProjectReferenceToRedirect, - getProjectReferenceRedirect, + getRedirectFromSourceFile, isSourceOfProjectReferenceRedirect, getSymlinkCache, writeFile: writeFileCallback || writeFile2, @@ -127081,98 +128088,98 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return diagnostics; function walk(node, parent2) { switch (parent2.kind) { - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: if (parent2.questionToken === node) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: - case 260 /* VariableDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: + case 261 /* VariableDeclaration */: if (parent2.type === node) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); return "skip"; } } switch (node.kind) { - case 273 /* ImportClause */: + case 274 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type")); return "skip"; } break; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 298 /* HeritageClause */: + case 299 /* HeritageClause */: const heritageClause = node; if (heritageClause.token === 119 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: const interfaceKeyword = tokenToString(120 /* InterfaceKeyword */); Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const moduleKeyword = node.flags & 32 /* Namespace */ ? tokenToString(145 /* NamespaceKeyword */) : tokenToString(144 /* ModuleKeyword */); Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: if (!node.body) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } return; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 235 /* NonNullExpression */: + case 236 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 234 /* AsExpression */: + case 235 /* AsExpression */: diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: Debug.fail(); } } @@ -127207,27 +128214,27 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi } } switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: if (nodes === parent2.typeParameters) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: if (nodes === parent2.modifiers) { - checkModifiers(parent2.modifiers, parent2.kind === 243 /* VariableStatement */); + checkModifiers(parent2.modifiers, parent2.kind === 244 /* VariableStatement */); return "skip"; } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (nodes === parent2.modifiers) { for (const modifier of nodes) { if (isModifier(modifier) && modifier.kind !== 126 /* StaticKeyword */ && modifier.kind !== 129 /* AccessorKeyword */) { @@ -127237,18 +128244,18 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return "skip"; } break; - case 169 /* Parameter */: + case 170 /* Parameter */: if (nodes === parent2.modifiers && some(nodes, isModifier)) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 233 /* ExpressionWithTypeArguments */: - case 285 /* JsxSelfClosingElement */: - case 286 /* JsxOpeningElement */: - case 215 /* TaggedTemplateExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 234 /* ExpressionWithTypeArguments */: + case 286 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 216 /* TaggedTemplateExpression */: if (nodes === parent2.typeArguments) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); return "skip"; @@ -127478,9 +128485,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi const sourceFile = getSourceFile2(fileName); if (fail) { if (!sourceFile) { - const redirect = getProjectReferenceRedirect(fileName); - if (redirect) { - fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName); + const redirect = getRedirectFromSourceFile(fileName); + if (redirect == null ? void 0 : redirect.outputDts) { + fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, fileName); } else { fail(Diagnostics.File_0_not_found, fileName); } @@ -127566,16 +128573,16 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode }; } function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { - var _a2; + var _a2, _b2; const path = toPath3(fileName); if (useSourceOfProjectReferenceRedirect) { - let source = getSourceOfProjectReferenceRedirect(path); + let source = getRedirectFromOutput(path); if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) { const realPath2 = toPath3(host.realpath(fileName)); - if (realPath2 !== path) source = getSourceOfProjectReferenceRedirect(realPath2); + if (realPath2 !== path) source = getRedirectFromOutput(realPath2); } - if (source) { - const file2 = isString(source) ? findSourceFile(source, isDefaultLib, ignoreNoDefaultLib, reason, packageId) : void 0; + if (source == null ? void 0 : source.source) { + const file2 = findSourceFile(source.source, isDefaultLib, ignoreNoDefaultLib, reason, packageId); if (file2) addFileToFilesByName( file2, path, @@ -127599,7 +128606,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi const checkedName = file2.fileName; const isRedirect = toPath3(checkedName) !== toPath3(fileName); if (isRedirect) { - fileName = getProjectReferenceRedirect(fileName) || fileName; + fileName = ((_a2 = getRedirectFromSourceFile(fileName)) == null ? void 0 : _a2.outputDts) || fileName; } const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory); const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory); @@ -127628,14 +128635,13 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi } let redirectedPath; if (!useSourceOfProjectReferenceRedirect) { - const redirectProject = getProjectReferenceRedirectProject(fileName); - if (redirectProject) { - if (redirectProject.commandLine.options.outFile) { + const redirectProject = getRedirectFromSourceFile(fileName); + if (redirectProject == null ? void 0 : redirectProject.outputDts) { + if (redirectProject.resolvedRef.commandLine.options.outFile) { return void 0; } - const redirect = getProjectReferenceOutputName(redirectProject, fileName); - fileName = redirect; - redirectedPath = toPath3(redirect); + fileName = redirectProject.outputDts; + redirectedPath = toPath3(redirectProject.outputDts); } } const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options); @@ -127679,7 +128685,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi file.path = path; file.resolvedPath = toPath3(fileName); file.originalFileName = originalFileName; - file.packageJsonLocations = ((_a2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a2.length) ? sourceFileOptions.packageJsonLocations : void 0; + file.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0; file.packageJsonScope = sourceFileOptions.packageJsonScope; addFileIncludeReason( file, @@ -127734,59 +128740,17 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi if (file !== void 0) missingFileNames.delete(path); else missingFileNames.set(path, fileName); } - function getProjectReferenceRedirect(fileName) { - const referencedProject = getProjectReferenceRedirectProject(fileName); - return referencedProject && getProjectReferenceOutputName(referencedProject, fileName); - } - function getProjectReferenceRedirectProject(fileName) { - if (!resolvedProjectReferences || !resolvedProjectReferences.length || isDeclarationFileName(fileName) || fileExtensionIs(fileName, ".json" /* Json */)) { - return void 0; - } - return getResolvedProjectReferenceToRedirect(fileName); - } - function getProjectReferenceOutputName(referencedProject, fileName) { - const out = referencedProject.commandLine.options.outFile; - return out ? changeExtension(out, ".d.ts" /* Dts */) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames()); - } - function getResolvedProjectReferenceToRedirect(fileName) { - if (mapFromFileToProjectReferenceRedirects === void 0) { - mapFromFileToProjectReferenceRedirects = /* @__PURE__ */ new Map(); - forEachResolvedProjectReference2((referencedProject) => { - if (toPath3(options.configFilePath) !== referencedProject.sourceFile.path) { - referencedProject.commandLine.fileNames.forEach((f) => mapFromFileToProjectReferenceRedirects.set(toPath3(f), referencedProject.sourceFile.path)); - } - }); - } - const referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath3(fileName)); - return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); + function getRedirectFromSourceFile(fileName) { + return mapSourceFileToResolvedRef == null ? void 0 : mapSourceFileToResolvedRef.get(toPath3(fileName)); } function forEachResolvedProjectReference2(cb) { return forEachResolvedProjectReference(resolvedProjectReferences, cb); } - function getSourceOfProjectReferenceRedirect(path) { - if (!isDeclarationFileName(path)) return void 0; - if (mapFromToProjectReferenceRedirectSource === void 0) { - mapFromToProjectReferenceRedirectSource = /* @__PURE__ */ new Map(); - forEachResolvedProjectReference2((resolvedRef) => { - const out = resolvedRef.commandLine.options.outFile; - if (out) { - const outputDts = changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), true); - } else { - const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); - forEach(resolvedRef.commandLine.fileNames, (fileName) => { - if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) { - const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); - mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), fileName); - } - }); - } - }); - } - return mapFromToProjectReferenceRedirectSource.get(path); + function getRedirectFromOutput(path) { + return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(path); } function isSourceOfProjectReferenceRedirect(fileName) { - return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); + return useSourceOfProjectReferenceRedirect && !!getRedirectFromSourceFile(fileName); } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { @@ -127954,7 +128918,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi continue; } const isFromNodeModulesSearch = resolution.isExternalLibraryImport; - const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getProjectReferenceRedirectProject(resolution.resolvedFileName); + const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getRedirectFromSourceFile(resolution.resolvedFileName); const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName)); const resolvedFileName = resolution.resolvedFileName; if (isFromNodeModulesSearch) { @@ -128064,6 +129028,30 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi sourceFile.originalFileName = refPath; const resolvedRef = { commandLine, sourceFile }; projectReferenceRedirects.set(sourceFilePath, resolvedRef); + if (options.configFile !== sourceFile) { + mapSourceFileToResolvedRef ?? (mapSourceFileToResolvedRef = /* @__PURE__ */ new Map()); + mapOutputFileToResolvedRef ?? (mapOutputFileToResolvedRef = /* @__PURE__ */ new Map()); + let outDts; + if (commandLine.options.outFile) { + outDts = changeExtension(commandLine.options.outFile, ".d.ts" /* Dts */); + mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.set(toPath3(outDts), { resolvedRef }); + } + const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); + commandLine.fileNames.forEach((fileName) => { + if (isDeclarationFileName(fileName)) return; + const path = toPath3(fileName); + let outputDts; + if (!fileExtensionIs(fileName, ".json" /* Json */)) { + if (!commandLine.options.outFile) { + outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); + mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName }); + } else { + outputDts = outDts; + } + } + mapSourceFileToResolvedRef.set(path, { resolvedRef, outputDts }); + }); + } if (commandLine.projectReferences) { resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile); } @@ -128784,8 +129772,8 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) { ); } function fileExistsIfProjectReferenceDts(file) { - const source = host.getSourceOfProjectReferenceRedirect(host.toPath(file)); - return source !== void 0 ? isString(source) ? originalFileExists.call(host.compilerHost, source) : true : void 0; + const source = host.getRedirectFromOutput(host.toPath(file)); + return source !== void 0 ? isString(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0; } function directoryExistsIfProjectReferenceDeclDir(dir) { const dirPath = host.toPath(dir); @@ -128817,7 +129805,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) { } function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { var _a; - const fileOrDirectoryExistsUsingSource2 = isFile ? (file) => fileExistsIfProjectReferenceDts(file) : (dir) => directoryExistsIfProjectReferenceDeclDir(dir); + const fileOrDirectoryExistsUsingSource2 = isFile ? fileExistsIfProjectReferenceDts : directoryExistsIfProjectReferenceDeclDir; const result = fileOrDirectoryExistsUsingSource2(fileOrDirectory); if (result !== void 0) return result; const symlinkCache = host.getSymlinkCache(); @@ -129328,7 +130316,8 @@ var BuilderState; return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); } function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { - return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); + var _a; + return toPath(((_a = program.getRedirectFromSourceFile(fileName)) == null ? void 0 : _a.outputDts) || fileName, sourceFileDirectory, getCanonicalFileName); } function getReferencedFiles(program, sourceFile, getCanonicalFileName) { let referencedFiles; @@ -131244,7 +132233,7 @@ function canWatchAtTypes(atTypes) { return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes)); } function isInDirectoryPath(dirComponents, fileOrDirComponents) { - if (fileOrDirComponents.length < fileOrDirComponents.length) return false; + if (fileOrDirComponents.length < dirComponents.length) return false; for (let i = 0; i < dirComponents.length; i++) { if (fileOrDirComponents[i] !== dirComponents[i]) return false; } @@ -131650,12 +132639,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW shouldRetryResolution, logChanges }) { + var _a; const path = resolutionHost.toPath(containingFile); const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path); const resolvedModules = []; const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path); const program = resolutionHost.getCurrentProgram(); - const oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile); + const oldRedirect = program && ((_a = program.getRedirectFromSourceFile(containingFile)) == null ? void 0 : _a.resolvedRef); const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference; const seenNamesInFile = createModeAwareCache(); for (const entry of entries) { @@ -132553,7 +133543,7 @@ function getMatchedIncludeSpec(program, fileName) { const index = findIndex((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => { if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */)) return false; const pattern = getPatternFromSpec(includeSpec, basePath, "files"); - return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName); + return !!pattern && getRegexFromPattern(`(?:${pattern})$`, useCaseSensitiveFileNames2).test(fileName); }); return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[index] : void 0; } @@ -135901,7 +136891,7 @@ function executeCommandLineWorker(sys2, cb, commandLine) { return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */); } if (commandLine.options.init) { - writeConfigFile(sys2, reportDiagnostic, commandLine.options, commandLine.fileNames); + writeConfigFile(sys2, reportDiagnostic, commandLine.options); return sys2.exit(0 /* Success */); } if (commandLine.options.version) { @@ -136540,15 +137530,14 @@ function statisticValue(s) { Debug.assertNever(s.type); } } -function writeConfigFile(sys2, reportDiagnostic, options, fileNames) { +function writeConfigFile(sys2, reportDiagnostic, options) { const currentDirectory = sys2.getCurrentDirectory(); const file = normalizePath(combinePaths(currentDirectory, "tsconfig.json")); if (sys2.fileExists(file)) { reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file)); } else { - sys2.writeFile(file, generateTSConfig(options, fileNames, sys2.newLine)); - const output = [sys2.newLine, ...getHeader(sys2, "Created a new tsconfig.json with:")]; - output.push(getCompilerOptionsDiffValue(options, sys2.newLine) + sys2.newLine + sys2.newLine); + sys2.writeFile(file, generateTSConfig(options, sys2.newLine)); + const output = [sys2.newLine, ...getHeader(sys2, "Created a new tsconfig.json")]; output.push(`You can learn more at https://aka.ms/tsconfig` + sys2.newLine); for (const line of output) { sys2.write(line); @@ -136622,13 +137611,13 @@ function createSyntacticTypeNodeBuilder(options, resolver) { function tryVisitSimpleTypeNode(node) { const innerNode = skipTypeParentheses(node); switch (innerNode.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return tryVisitTypeReference(innerNode); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return tryVisitTypeQuery(innerNode); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: return tryVisitIndexedAccess(innerNode); - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: const typeOperatorNode = innerNode; if (typeOperatorNode.operator === 143 /* KeyOfKeyword */) { return tryVisitKeyOf(typeOperatorNode); @@ -136700,7 +137689,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { if (isJSDocTypeExpression(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode); } - if (isJSDocAllType(node) || node.kind === 319 /* JSDocNamepathType */) { + if (isJSDocAllType(node) || node.kind === 320 /* JSDocNamepathType */) { return factory.createKeywordTypeNode(133 /* AnyKeyword */); } if (isJSDocUnknownType(node)) { @@ -136829,16 +137818,18 @@ function createSyntacticTypeNodeBuilder(options, resolver) { if (!resolver.canReuseTypeNode(context, node)) { return resolver.serializeExistingTypeNode(context, node); } + const specifier = rewriteModuleSpecifier2(node, node.argument.literal); + const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier; return factory.updateImportTypeNode( node, - factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier2(node, node.argument.literal)), + literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal), visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes), visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName), visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode), node.isTypeOf ); } - if (isNamedDeclaration(node) && node.name.kind === 167 /* ComputedPropertyName */ && !resolver.hasLateBindableName(node)) { + if (isNamedDeclaration(node) && node.name.kind === 168 /* ComputedPropertyName */ && !resolver.hasLateBindableName(node)) { if (!hasDynamicName(node)) { return visitEachChild2(node, visitExistingNodeTreeSymbols); } @@ -136986,10 +137977,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function rewriteModuleSpecifier2(parent2, lit) { const newName = resolver.getModuleSpecifierOverride(context, parent2, lit); - if (newName) { - return setOriginalNode(factory.createStringLiteral(newName), lit); - } - return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral); + return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit; } } } @@ -137059,18 +138047,18 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function serializeTypeOfDeclaration(node, symbol, context) { switch (node.kind) { - case 169 /* Parameter */: - case 341 /* JSDocParameterTag */: + case 170 /* Parameter */: + case 342 /* JSDocParameterTag */: return typeFromParameter(node, symbol, context); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return typeFromVariable(node, symbol, context); - case 171 /* PropertySignature */: - case 348 /* JSDocPropertyTag */: - case 172 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 349 /* JSDocPropertyTag */: + case 173 /* PropertyDeclaration */: return typeFromProperty(node, symbol, context); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return inferTypeOfDeclaration(node, symbol, context); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return serializeTypeOfExpression( node.expression, context, @@ -137079,12 +138067,12 @@ function createSyntacticTypeNodeBuilder(options, resolver) { /*preserveLiterals*/ true ); - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: - case 226 /* BinaryExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: + case 227 /* BinaryExpression */: return typeFromExpandoProperty(node, symbol, context); - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return typeFromPropertyAssignment(node, symbol, context); default: Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`); @@ -137096,9 +138084,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) { if (typeAnnotation && resolver.canReuseTypeNodeAnnotation(context, node, typeAnnotation, symbol)) { result = serializeExistingTypeNode(typeAnnotation, context); } - if (!result && node.kind === 303 /* PropertyAssignment */) { + if (!result && node.kind === 304 /* PropertyAssignment */) { const initializer = node.initializer; - const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0; + const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 235 /* AsExpression */ || initializer.kind === 217 /* TypeAssertionExpression */ ? initializer.type : void 0; if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) { result = serializeExistingTypeNode(assertionNode, context); } @@ -137113,22 +138101,22 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function serializeReturnTypeForSignature(node, symbol, context) { switch (node.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return serializeTypeOfAccessor(node, symbol, context); - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: - case 180 /* ConstructSignature */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 176 /* Constructor */: - case 178 /* SetAccessor */: - case 181 /* IndexSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 317 /* JSDocFunctionType */: - case 323 /* JSDocSignature */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 181 /* ConstructSignature */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 177 /* Constructor */: + case 179 /* SetAccessor */: + case 182 /* IndexSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 318 /* JSDocFunctionType */: + case 324 /* JSDocSignature */: return createReturnFromSignature(node, symbol, context); default: Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`); @@ -137136,7 +138124,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 177 /* GetAccessor */ ? isInJSFile(accessor) && getJSDocType(accessor) || getEffectiveReturnTypeNode(accessor) : getEffectiveSetAccessorTypeAnnotationNode(accessor); + return accessor.kind === 178 /* GetAccessor */ ? isInJSFile(accessor) && getJSDocType(accessor) || getEffectiveReturnTypeNode(accessor) : getEffectiveSetAccessorTypeAnnotationNode(accessor); } } function getTypeAnnotationFromAllAccessorDeclarations(node, accessors) { @@ -137156,12 +138144,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { return withNewScope(context, node, () => serializeTypeAnnotationOfDeclaration(accessorType, context, node, symbol) ?? inferTypeOfDeclaration(node, symbol, context)); } if (accessorDeclarations.getAccessor) { - return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature( - accessorDeclarations.getAccessor, - /*symbol*/ - void 0, - context - )); + return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(accessorDeclarations.getAccessor, symbol, context)); } return void 0; } @@ -137188,7 +138171,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function typeFromParameter(node, symbol, context) { const parent2 = node.parent; - if (parent2.kind === 178 /* SetAccessor */) { + if (parent2.kind === 179 /* SetAccessor */) { return serializeTypeOfAccessor( parent2, /*symbol*/ @@ -137271,17 +138254,17 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } return resolver.serializeTypeOfExpression(context, node) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); } - function inferReturnTypeOfSignatureSignature(node, context, reportFallback) { + function inferReturnTypeOfSignatureSignature(node, context, symbol, reportFallback) { if (reportFallback) { context.tracker.reportInferenceFallback(node); } if (context.noInferenceFallback === true) { return factory.createKeywordTypeNode(133 /* AnyKeyword */); } - return resolver.serializeReturnTypeForSignature(context, node) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); + return resolver.serializeReturnTypeForSignature(context, node, symbol) ?? factory.createKeywordTypeNode(133 /* AnyKeyword */); } function inferAccessorType(node, allAccessors, context, symbol, reportFallback = true) { - if (node.kind === 177 /* GetAccessor */) { + if (node.kind === 178 /* GetAccessor */) { return createReturnFromSignature(node, symbol, context, reportFallback); } else { if (reportFallback) { @@ -137311,7 +138294,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function typeFromExpression(node, context, isConstContext = false, requiresAddingUndefined = false, preserveLiterals = false) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: if (isJSDocTypeAssertion(node)) { return typeFromTypeAssertion(node.expression, getJSDocTypeAssertionType(node), context, requiresAddingUndefined); } @@ -137327,15 +138310,15 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } else { return syntacticResult(factory.createKeywordTypeNode(133 /* AnyKeyword */)); } - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: Debug.type(node); return withNewScope(context, node, () => typeFromFunctionLikeExpression(node, context)); - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: const asExpression = node; return typeFromTypeAssertion(asExpression.expression, asExpression.type, context, requiresAddingUndefined); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: const unaryExpression = node; if (isPrimitiveLiteralValue(unaryExpression)) { return typeFromPrimitiveLiteral( @@ -137347,11 +138330,11 @@ function createSyntacticTypeNodeBuilder(options, resolver) { ); } break; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return typeFromArrayLiteral(node, context, isConstContext, requiresAddingUndefined); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return typeFromObjectLiteral(node, context, isConstContext, requiresAddingUndefined); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return syntacticResult(inferExpressionType( node, context, @@ -137359,7 +138342,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { true, requiresAddingUndefined )); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: if (!isConstContext && !preserveLiterals) { return syntacticResult(factory.createKeywordTypeNode(154 /* StringKeyword */)); } @@ -137415,7 +138398,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { return false; } for (const element of arrayLiteral.elements) { - if (element.kind === 230 /* SpreadElement */) { + if (element.kind === 231 /* SpreadElement */) { context.tracker.reportInferenceFallback(element); return false; } @@ -137439,8 +138422,8 @@ function createSyntacticTypeNodeBuilder(options, resolver) { context.noInferenceFallback = true; const elementTypesInfo = []; for (const element of arrayLiteral.elements) { - Debug.assert(element.kind !== 230 /* SpreadElement */); - if (element.kind === 232 /* OmittedExpression */) { + Debug.assert(element.kind !== 231 /* SpreadElement */); + if (element.kind === 233 /* OmittedExpression */) { elementTypesInfo.push( createUndefinedTypeNode() ); @@ -137462,7 +138445,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { result = false; break; } - if (prop.kind === 304 /* ShorthandPropertyAssignment */ || prop.kind === 305 /* SpreadAssignment */) { + if (prop.kind === 305 /* ShorthandPropertyAssignment */ || prop.kind === 306 /* SpreadAssignment */) { context.tracker.reportInferenceFallback(prop); result = false; } else if (prop.name.flags & 262144 /* ThisNodeHasError */) { @@ -137470,7 +138453,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { break; } else if (prop.name.kind === 81 /* PrivateIdentifier */) { result = false; - } else if (prop.name.kind === 167 /* ComputedPropertyName */) { + } else if (prop.name.kind === 168 /* ComputedPropertyName */) { const expression = prop.name.expression; if (!isPrimitiveLiteralValue( expression, @@ -137507,14 +138490,14 @@ function createSyntacticTypeNodeBuilder(options, resolver) { const name = prop.name; let newProp; switch (prop.kind) { - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: newProp = withNewScope(context, prop, () => typeFromObjectLiteralMethod(prop, name, context, isConstContext)); break; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: newProp = typeFromObjectLiteralPropertyAssignment(prop, name, context, isConstContext); break; - case 178 /* SetAccessor */: - case 177 /* GetAccessor */: + case 179 /* SetAccessor */: + case 178 /* GetAccessor */: newProp = typeFromObjectLiteralAccessor(prop, name, context); break; } @@ -137552,7 +138535,8 @@ function createSyntacticTypeNodeBuilder(options, resolver) { function ensureParameter(p, context) { return factory.updateParameterDeclaration( p, - [], + /*modifiers*/ + void 0, reuseNode(context, p.dotDotDotToken), resolver.serializeNameOfParameter(context, p), resolver.isOptionalParameter(p) ? factory.createToken(58 /* QuestionToken */) : void 0, @@ -137568,18 +138552,17 @@ function createSyntacticTypeNodeBuilder(options, resolver) { ); } function reuseTypeParameters(typeParameters, context) { - return typeParameters == null ? void 0 : typeParameters.map( - (tp) => { - var _a; - return factory.updateTypeParameterDeclaration( - tp, - (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)), - reuseNode(context, tp.name), - serializeExistingTypeNodeWithFallback(tp.constraint, context), - serializeExistingTypeNodeWithFallback(tp.default, context) - ); - } - ); + return typeParameters == null ? void 0 : typeParameters.map((tp) => { + var _a; + const { node: tpName } = resolver.trackExistingEntityName(context, tp.name); + return factory.updateTypeParameterDeclaration( + tp, + (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)), + tpName, + serializeExistingTypeNodeWithFallback(tp.constraint, context), + serializeExistingTypeNodeWithFallback(tp.default, context) + ); + }); } function typeFromObjectLiteralMethod(method, name, context, isConstContext) { const returnType = createReturnFromSignature( @@ -137672,7 +138655,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { function typeFromPrimitiveLiteral(node, baseType, context, preserveLiterals, requiresAddingUndefined) { let result; if (preserveLiterals) { - if (node.kind === 224 /* PrefixUnaryExpression */ && node.operator === 40 /* PlusToken */) { + if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 40 /* PlusToken */) { result = factory.createLiteralTypeNode(reuseNode(context, node.operand)); } result = factory.createLiteralTypeNode(reuseNode(context, node)); @@ -137695,13 +138678,13 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } function canAddUndefined(node) { if (!strictNullChecks) return true; - if (isKeyword(node.kind) || node.kind === 201 /* LiteralType */ || node.kind === 184 /* FunctionType */ || node.kind === 185 /* ConstructorType */ || node.kind === 188 /* ArrayType */ || node.kind === 189 /* TupleType */ || node.kind === 187 /* TypeLiteral */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 197 /* ThisType */) { + if (isKeyword(node.kind) || node.kind === 202 /* LiteralType */ || node.kind === 185 /* FunctionType */ || node.kind === 186 /* ConstructorType */ || node.kind === 189 /* ArrayType */ || node.kind === 190 /* TupleType */ || node.kind === 188 /* TypeLiteral */ || node.kind === 204 /* TemplateLiteralType */ || node.kind === 198 /* ThisType */) { return true; } - if (node.kind === 196 /* ParenthesizedType */) { + if (node.kind === 197 /* ParenthesizedType */) { return canAddUndefined(node.type); } - if (node.kind === 192 /* UnionType */ || node.kind === 193 /* IntersectionType */) { + if (node.kind === 193 /* UnionType */ || node.kind === 194 /* IntersectionType */) { return node.types.every(canAddUndefined); } return false; @@ -137714,7 +138697,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) { } else if (isValueSignatureDeclaration(fn)) { returnType = typeFromSingleReturnExpression(fn, context); } - return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, reportFallback && returnType.reportFallback && !returnTypeNode); + return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, symbol, reportFallback && returnType.reportFallback && !returnTypeNode); } function typeFromSingleReturnExpression(declaration, context) { let candidateExpr; @@ -138380,36 +139363,36 @@ var SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning2) => { })(SemanticMeaning || {}); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 299 /* CatchClause */: - case 291 /* JsxAttribute */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 300 /* CatchClause */: + case 292 /* JsxAttribute */: return 1 /* Value */; - case 168 /* TypeParameter */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 187 /* TypeLiteral */: + case 169 /* TypeParameter */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 188 /* TypeLiteral */: return 2 /* Type */; - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 306 /* EnumMember */: - case 263 /* ClassDeclaration */: + case 307 /* EnumMember */: + case 264 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } else if (getModuleInstanceState(node) === 1 /* Instantiated */) { @@ -138417,16 +139400,16 @@ function getMeaningFromDeclaration(node) { } else { return 4 /* Namespace */; } - case 266 /* EnumDeclaration */: - case 275 /* NamedImports */: - case 276 /* ImportSpecifier */: - case 271 /* ImportEqualsDeclaration */: - case 272 /* ImportDeclaration */: - case 277 /* ExportAssignment */: - case 278 /* ExportDeclaration */: + case 267 /* EnumDeclaration */: + case 276 /* NamedImports */: + case 277 /* ImportSpecifier */: + case 272 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 278 /* ExportAssignment */: + case 279 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 307 /* SourceFile */: + case 308 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -138434,7 +139417,7 @@ function getMeaningFromDeclaration(node) { function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); const parent2 = node.parent; - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { return 1 /* Value */; } else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) { return 7 /* All */; @@ -138458,11 +139441,14 @@ function getMeaningFromLocation(node) { } } function getMeaningFromRightHandSideOfImportEquals(node) { - const name = node.kind === 166 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; - return name && name.parent.kind === 271 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + const name = node.kind === 167 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; + return name && name.parent.kind === 272 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 166 /* QualifiedName */) { + if (!node.parent) { + return false; + } + while (node.parent.kind === 167 /* QualifiedName */) { node = node.parent; } return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -138473,26 +139459,26 @@ function isNamespaceReference(node) { function isQualifiedNameNamespaceReference(node) { let root = node; let isLastClause = true; - if (root.parent.kind === 166 /* QualifiedName */) { - while (root.parent && root.parent.kind === 166 /* QualifiedName */) { + if (root.parent.kind === 167 /* QualifiedName */) { + while (root.parent && root.parent.kind === 167 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 183 /* TypeReference */ && !isLastClause; + return root.parent.kind === 184 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { let root = node; let isLastClause = true; - if (root.parent.kind === 211 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 211 /* PropertyAccessExpression */) { + if (root.parent.kind === 212 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 212 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 233 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 298 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 234 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 299 /* HeritageClause */) { const decl = root.parent.parent.parent; - return decl.kind === 263 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 264 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; + return decl.kind === 264 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 265 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; } return false; } @@ -138503,15 +139489,15 @@ function isTypeReference(node) { switch (node.kind) { case 110 /* ThisKeyword */: return !isExpressionNode(node); - case 197 /* ThisType */: + case 198 /* ThisType */: return true; } switch (node.parent.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return true; - case 205 /* ImportType */: + case 206 /* ImportType */: return !node.parent.isTypeOf; - case 233 /* ExpressionWithTypeArguments */: + case 234 /* ExpressionWithTypeArguments */: return isPartOfTypeNode(node.parent); } return false; @@ -138558,7 +139544,7 @@ function climbPastPropertyOrElementAccess(node) { } function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 256 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 257 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -138608,22 +139594,22 @@ function isNameOfFunctionDeclaration(node) { } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 303 /* PropertyAssignment */: - case 306 /* EnumMember */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 267 /* ModuleDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 304 /* PropertyAssignment */: + case 307 /* EnumMember */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 268 /* ModuleDeclaration */: return getNameOfDeclaration(node.parent) === node; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return true; - case 201 /* LiteralType */: - return node.parent.parent.kind === 199 /* IndexedAccessType */; + case 202 /* LiteralType */: + return node.parent.parent.kind === 200 /* IndexedAccessType */; default: return false; } @@ -138641,83 +139627,83 @@ function getContainerNode(node) { return void 0; } switch (node.kind) { - case 307 /* SourceFile */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: + case 308 /* SourceFile */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: return node; } } } function getNodeKind(node) { switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return "class" /* classElement */; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 265 /* TypeAliasDeclaration */: - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: + case 266 /* TypeAliasDeclaration */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return "enum" /* enumElement */; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getKindOfVariableDeclaration(getRootDeclaration(node)); - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return "function" /* functionElement */; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: const { initializer } = node; return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 179 /* CallSignature */: + case 180 /* CallSignature */: return "call" /* callSignatureElement */; - case 176 /* Constructor */: - case 175 /* ClassStaticBlockDeclaration */: + case 177 /* Constructor */: + case 176 /* ClassStaticBlockDeclaration */: return "constructor" /* constructorImplementationElement */; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 306 /* EnumMember */: + case 307 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 169 /* Parameter */: + case 170 /* Parameter */: return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: - case 274 /* NamespaceImport */: - case 280 /* NamespaceExport */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: + case 275 /* NamespaceImport */: + case 281 /* NamespaceExport */: return "alias" /* alias */; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: const kind = getAssignmentDeclarationKind(node); const { right } = node; switch (kind) { @@ -138746,7 +139732,7 @@ function getNodeKind(node) { } case 80 /* Identifier */: return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: const scriptKind = getNodeKind(node.expression); return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; default: @@ -138761,7 +139747,7 @@ function isThis(node) { case 110 /* ThisKeyword */: return true; case 80 /* Identifier */: - return identifierIsThisKeyword(node) && node.parent.kind === 169 /* Parameter */; + return identifierIsThisKeyword(node) && node.parent.kind === 170 /* Parameter */; default: return false; } @@ -138804,42 +139790,42 @@ function isCompletedNode(n, sourceFile) { return false; } switch (n.kind) { - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 210 /* ObjectLiteralExpression */: - case 206 /* ObjectBindingPattern */: - case 187 /* TypeLiteral */: - case 241 /* Block */: - case 268 /* ModuleBlock */: - case 269 /* CaseBlock */: - case 275 /* NamedImports */: - case 279 /* NamedExports */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 211 /* ObjectLiteralExpression */: + case 207 /* ObjectBindingPattern */: + case 188 /* TypeLiteral */: + case 242 /* Block */: + case 269 /* ModuleBlock */: + case 270 /* CaseBlock */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: return nodeEndsWith(n, 20 /* CloseBraceToken */, sourceFile); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 214 /* NewExpression */: + case 215 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 213 /* CallExpression */: - case 217 /* ParenthesizedExpression */: - case 196 /* ParenthesizedType */: + case 214 /* CallExpression */: + case 218 /* ParenthesizedExpression */: + case 197 /* ParenthesizedType */: return nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile); - case 184 /* FunctionType */: - case 185 /* ConstructorType */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 180 /* ConstructSignature */: - case 179 /* CallSignature */: - case 219 /* ArrowFunction */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 181 /* ConstructSignature */: + case 180 /* CallSignature */: + case 220 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -138847,60 +139833,60 @@ function isCompletedNode(n, sourceFile) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseParenToken */, sourceFile); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 245 /* IfStatement */: + case 246 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 27 /* SemicolonToken */, sourceFile); - case 209 /* ArrayLiteralExpression */: - case 207 /* ArrayBindingPattern */: - case 212 /* ElementAccessExpression */: - case 167 /* ComputedPropertyName */: - case 189 /* TupleType */: + case 210 /* ArrayLiteralExpression */: + case 208 /* ArrayBindingPattern */: + case 213 /* ElementAccessExpression */: + case 168 /* ComputedPropertyName */: + case 190 /* TupleType */: return nodeEndsWith(n, 24 /* CloseBracketToken */, sourceFile); - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 24 /* CloseBracketToken */, sourceFile); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return false; - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 247 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 248 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return hasChildOfKind(n, 117 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 221 /* TypeOfExpression */: - case 220 /* DeleteExpression */: - case 222 /* VoidExpression */: - case 229 /* YieldExpression */: - case 230 /* SpreadElement */: + case 222 /* TypeOfExpression */: + case 221 /* DeleteExpression */: + case 223 /* VoidExpression */: + case 230 /* YieldExpression */: + case 231 /* SpreadElement */: const unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: const lastSpan = lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 239 /* TemplateSpan */: + case 240 /* TemplateSpan */: return nodeIsPresent(n.literal); - case 278 /* ExportDeclaration */: - case 272 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: return nodeIsPresent(n.moduleSpecifier); - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 227 /* ConditionalExpression */: + case 228 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -138996,13 +139982,13 @@ function getContextualTypeFromParentOrAncestorTypeNode(node, checker) { function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return getAdjustedLocationForFunction(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return node; } } @@ -139344,7 +140330,7 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) { } } } - Debug.assert(startNode2 !== void 0 || n.kind === 307 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); + Debug.assert(startNode2 !== void 0 || n.kind === 308 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); const candidate = findRightmostChildNodeWithTokens( children, /*exclusiveStartPosition*/ @@ -139379,7 +140365,7 @@ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sour for (let i = exclusiveStartPosition - 1; i >= 0; i--) { const child = children[i]; if (isWhiteSpaceOnlyJsxText(child)) { - if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 285 /* JsxSelfClosingElement */)) { + if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 286 /* JsxSelfClosingElement */)) { Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); } } else if (nodeHasTokens(children[i], sourceFile)) { @@ -139411,13 +140397,13 @@ function isInsideJsxElementOrAttribute(sourceFile, position) { if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 12 /* JsxText */) { return true; } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 294 /* JsxExpression */) { + if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 295 /* JsxExpression */) { return true; } - if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 294 /* JsxExpression */) { + if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 295 /* JsxExpression */) { return true; } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 287 /* JsxClosingElement */) { + if (token.kind === 31 /* LessThanSlashToken */ && token.parent.kind === 288 /* JsxClosingElement */) { return true; } return false; @@ -139445,9 +140431,9 @@ function isInJSXText(sourceFile, position) { function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 285 /* JsxSelfClosingElement */ && node.kind <= 294 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */) { + if (node.kind >= 286 /* JsxSelfClosingElement */ && node.kind <= 295 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */ || node.kind === 31 /* LessThanSlashToken */) { node = node.parent; - } else if (node.kind === 284 /* JsxElement */) { + } else if (node.kind === 285 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; } else { @@ -139609,14 +140595,14 @@ function getNodeModifiers(node, excludeFlags = 0 /* None */) { if (flags & 32 /* Export */) result.push("export" /* exportedModifier */); if (flags & 65536 /* Deprecated */) result.push("deprecated" /* deprecatedModifier */); if (node.flags & 33554432 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 277 /* ExportAssignment */) result.push("export" /* exportedModifier */); + if (node.kind === 278 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 183 /* TypeReference */ || node.kind === 213 /* CallExpression */) { + if (node.kind === 184 /* TypeReference */ || node.kind === 214 /* CallExpression */) { return node.typeArguments; } - if (isFunctionLike(node) || node.kind === 263 /* ClassDeclaration */ || node.kind === 264 /* InterfaceDeclaration */) { + if (isFunctionLike(node) || node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* InterfaceDeclaration */) { return node.typeParameters; } return void 0; @@ -139658,14 +140644,14 @@ function cloneCompilerOptions(options) { return result; } function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 209 /* ArrayLiteralExpression */ || node.kind === 210 /* ObjectLiteralExpression */) { - if (node.parent.kind === 226 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { + if (node.kind === 210 /* ArrayLiteralExpression */ || node.kind === 211 /* ObjectLiteralExpression */) { + if (node.parent.kind === 227 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { return true; } - if (node.parent.kind === 250 /* ForOfStatement */ && node.parent.initializer === node) { + if (node.parent.kind === 251 /* ForOfStatement */ && node.parent.initializer === node) { return true; } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 303 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 304 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -139784,7 +140770,7 @@ function skipConstraint(type) { return type.isTypeParameter() ? type.getConstraint() || type : type; } function getNameFromPropertyName(name) { - return name.kind === 167 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name); + return name.kind === 168 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name); } function programContainsModules(program) { return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator)); @@ -139809,7 +140795,7 @@ function createModuleSpecifierResolutionHost(program, host) { }, getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), redirectTargetsMap: program.redirectTargetsMap, - getProjectReferenceRedirect: (fileName) => program.getProjectReferenceRedirect(fileName), + getRedirectFromSourceFile: (fileName) => program.getRedirectFromSourceFile(fileName), isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName), getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson), getFileIncludeReasons: () => program.getFileIncludeReasons(), @@ -139831,7 +140817,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc return factory.createImportDeclaration( /*modifiers*/ void 0, - defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, + defaultImport || namedImports ? factory.createImportClause(isTypeOnly ? 156 /* TypeKeyword */ : void 0, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, /*attributes*/ void 0 @@ -139911,7 +140897,7 @@ function findModifier(node, kind) { function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { var _a; const decl = isArray(imports) ? imports[0] : imports; - const importKindPredicate = decl.kind === 243 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; + const importKindPredicate = decl.kind === 244 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; const existingImportStatements = filter(sourceFile.statements, importKindPredicate); const { comparer, isSorted } = ts_OrganizeImports_exports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences); const sortedNewImports = isArray(imports) ? toSorted(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; @@ -140026,9 +141012,16 @@ function isFirstDeclarationOfSymbolParameter(symbol) { const declaration = symbol.declarations ? firstOrUndefined(symbol.declarations) : void 0; return !!findAncestor(declaration, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit"); } -var displayPartWriter = getDisplayPartWriter(); -function getDisplayPartWriter() { - const absoluteMaximumLength = defaultMaximumTruncationLength * 10; +var displayPartWriterCache = /* @__PURE__ */ new Map(); +function getDisplayPartWriter(maximumLength) { + maximumLength = maximumLength || defaultMaximumTruncationLength; + if (!displayPartWriterCache.has(maximumLength)) { + displayPartWriterCache.set(maximumLength, getDisplayPartWriterWorker(maximumLength)); + } + return displayPartWriterCache.get(maximumLength); +} +function getDisplayPartWriterWorker(maximumLength) { + const absoluteMaximumLength = maximumLength * 10; let displayParts; let lineStart; let indent3; @@ -140246,7 +141239,8 @@ function getNewLineOrDefaultFromHost(host, formatSettings) { function lineBreakPart() { return displayPart("\n", 6 /* lineBreak */); } -function mapToDisplayParts(writeDisplayParts) { +function mapToDisplayParts(writeDisplayParts, maximumLength) { + const displayPartWriter = getDisplayPartWriter(maximumLength); try { writeDisplayParts(displayPartWriter); return displayPartWriter.displayParts(); @@ -140254,17 +141248,17 @@ function mapToDisplayParts(writeDisplayParts) { displayPartWriter.clear(); } } -function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */) { +function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags = 0 /* None */, maximumLength, verbosityLevel, out) { return mapToDisplayParts((writer) => { - typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer); - }); + typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer, maximumLength, verbosityLevel, out); + }, maximumLength); } function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags = 0 /* None */) { return mapToDisplayParts((writer) => { typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer); }); } -function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags = 0 /* None */) { +function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags = 0 /* None */, maximumLength, verbosityLevel, out) { flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */; return mapToDisplayParts((writer) => { typechecker.writeSignature( @@ -140273,9 +141267,12 @@ function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, f flags, /*kind*/ void 0, - writer + writer, + maximumLength, + verbosityLevel, + out ); - }); + }, maximumLength); } function isImportOrExportSpecifierName(location) { return !!location.parent && isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; @@ -140312,74 +141309,6 @@ function getPrecedingNonSpaceCharacterPosition(text, position) { } return position + 1; } -function getSynthesizedDeepClone(node, includeTrivia = true) { - const clone2 = node && getSynthesizedDeepCloneWorker(node); - if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); - return setParentRecursive( - clone2, - /*incremental*/ - false - ); -} -function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - let clone2 = replaceNode(node); - if (clone2) { - setOriginalNode(clone2, node); - } else { - clone2 = getSynthesizedDeepCloneWorker(node, replaceNode); - } - if (clone2 && !includeTrivia) suppressLeadingAndTrailingTrivia(clone2); - return clone2; -} -function getSynthesizedDeepCloneWorker(node, replaceNode) { - const nodeClone = replaceNode ? (n) => getSynthesizedDeepCloneWithReplacements( - n, - /*includeTrivia*/ - true, - replaceNode - ) : getSynthesizedDeepClone; - const nodesClone = replaceNode ? (ns) => ns && getSynthesizedDeepClonesWithReplacements( - ns, - /*includeTrivia*/ - true, - replaceNode - ) : (ns) => ns && getSynthesizedDeepClones(ns); - const visited = visitEachChild( - node, - nodeClone, - /*context*/ - void 0, - nodesClone, - nodeClone - ); - if (visited === node) { - const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node); - return setTextRange(clone2, node); - } - visited.parent = void 0; - return visited; -} -function getSynthesizedDeepClones(nodes, includeTrivia = true) { - if (nodes) { - const cloned = factory.createNodeArray(nodes.map((n) => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma); - setTextRange(cloned, nodes); - return cloned; - } - return nodes; -} -function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return factory.createNodeArray(nodes.map((n) => getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode)), nodes.hasTrailingComma); -} -function suppressLeadingAndTrailingTrivia(node) { - suppressLeadingTrivia(node); - suppressTrailingTrivia(node); -} -function suppressLeadingTrivia(node) { - addEmitFlagsRecursively(node, 1024 /* NoLeadingComments */, getFirstChild); -} -function suppressTrailingTrivia(node) { - addEmitFlagsRecursively(node, 2048 /* NoTrailingComments */, getLastChild); -} function copyComments(sourceNode, targetNode) { const sourceFile = sourceNode.getSourceFile(); const text = sourceFile.text; @@ -140398,14 +141327,6 @@ function hasLeadingLineBreak(node, text) { } return false; } -function addEmitFlagsRecursively(node, flag, getChild) { - addEmitFlags(node, flag); - const child = getChild(node); - if (child) addEmitFlagsRecursively(child, flag, getChild); -} -function getFirstChild(node) { - return node.forEachChild((child) => child); -} function getUniqueName(baseName, sourceFile) { let nameText = baseName; for (let i = 1; !isFileLevelUniqueName(sourceFile, nameText); i++) { @@ -140467,13 +141388,13 @@ function needsParentheses(expression) { function getContextualTypeFromParent(node, checker, contextFlags) { const parent2 = walkUpParenthesizedExpressions(node.parent); switch (parent2.kind) { - case 214 /* NewExpression */: + case 215 /* NewExpression */: return checker.getContextualType(parent2, contextFlags); - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const { left, operatorToken, right } = parent2; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); } - case 296 /* CaseClause */: + case 297 /* CaseClause */: return getSwitchedType(parent2, checker); default: return checker.getContextualType(node, contextFlags); @@ -140499,8 +141420,8 @@ function isStringLiteralOrTemplate(node) { switch (node.kind) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: - case 215 /* TaggedTemplateExpression */: + case 229 /* TemplateExpression */: + case 216 /* TaggedTemplateExpression */: return true; default: return false; @@ -140536,16 +141457,16 @@ function getTypeNodeIfAccessible(type, enclosingScope, program, host) { return typeIsAccessible ? res : void 0; } function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 179 /* CallSignature */ || kind === 180 /* ConstructSignature */ || kind === 181 /* IndexSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */; + return kind === 180 /* CallSignature */ || kind === 181 /* ConstructSignature */ || kind === 182 /* IndexSignature */ || kind === 172 /* PropertySignature */ || kind === 174 /* MethodSignature */; } function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 262 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; + return kind === 263 /* FunctionDeclaration */ || kind === 177 /* Constructor */ || kind === 175 /* MethodDeclaration */ || kind === 178 /* GetAccessor */ || kind === 179 /* SetAccessor */; } function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 267 /* ModuleDeclaration */; + return kind === 268 /* ModuleDeclaration */; } function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 243 /* VariableStatement */ || kind === 244 /* ExpressionStatement */ || kind === 246 /* DoStatement */ || kind === 251 /* ContinueStatement */ || kind === 252 /* BreakStatement */ || kind === 253 /* ReturnStatement */ || kind === 257 /* ThrowStatement */ || kind === 259 /* DebuggerStatement */ || kind === 172 /* PropertyDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 277 /* ExportAssignment */; + return kind === 244 /* VariableStatement */ || kind === 245 /* ExpressionStatement */ || kind === 247 /* DoStatement */ || kind === 252 /* ContinueStatement */ || kind === 253 /* BreakStatement */ || kind === 254 /* ReturnStatement */ || kind === 258 /* ThrowStatement */ || kind === 260 /* DebuggerStatement */ || kind === 173 /* PropertyDeclaration */ || kind === 266 /* TypeAliasDeclaration */ || kind === 273 /* ImportDeclaration */ || kind === 272 /* ImportEqualsDeclaration */ || kind === 279 /* ExportDeclaration */ || kind === 271 /* NamespaceExportDeclaration */ || kind === 278 /* ExportAssignment */; } var syntaxMayBeASICandidate = or( syntaxRequiresTrailingCommaOrSemicolonOrASI, @@ -140575,7 +141496,7 @@ function nodeIsASICandidate(node, sourceFile) { } else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) { return false; } - if (node.kind === 246 /* DoStatement */) { + if (node.kind === 247 /* DoStatement */) { return true; } const topNode = findAncestor(node, (ancestor) => !ancestor.parent); @@ -141133,10 +142054,10 @@ function fileShouldUseJavaScriptRequire(file, program, host, preferRequire) { } function isBlockLike(node) { switch (node.kind) { - case 241 /* Block */: - case 307 /* SourceFile */: - case 268 /* ModuleBlock */: - case 296 /* CaseClause */: + case 242 /* Block */: + case 308 /* SourceFile */: + case 269 /* ModuleBlock */: + case 297 /* CaseClause */: return true; default: return false; @@ -141995,13 +142916,13 @@ function getSemanticClassifications(typeChecker, cancellationToken, sourceFile, } function checkForClassificationCancellation(cancellationToken, kind) { switch (kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -142217,49 +143138,49 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) pos = tag.tagName.end; let commentStart = tag.tagName.end; switch (tag.kind) { - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: const param = tag; processJSDocParameterTag(param); commentStart = param.isNameFirst && ((_a = param.typeExpression) == null ? void 0 : _a.end) || param.name.end; break; - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: const prop = tag; commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end; break; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; commentStart = tag.typeParameters.end; break; - case 346 /* JSDocTypedefTag */: + case 347 /* JSDocTypedefTag */: const type = tag; - commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 309 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; + commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 310 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; break; - case 338 /* JSDocCallbackTag */: + case 339 /* JSDocCallbackTag */: commentStart = tag.typeExpression.end; break; - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = tag.typeExpression.end; break; - case 343 /* JSDocThisTag */: - case 340 /* JSDocEnumTag */: + case 344 /* JSDocThisTag */: + case 341 /* JSDocEnumTag */: commentStart = tag.typeExpression.end; break; - case 342 /* JSDocReturnTag */: + case 343 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart; break; - case 347 /* JSDocSeeTag */: + case 348 /* JSDocSeeTag */: commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart; break; - case 328 /* JSDocAugmentsTag */: - case 329 /* JSDocImplementsTag */: + case 329 /* JSDocAugmentsTag */: + case 330 /* JSDocImplementsTag */: commentStart = tag.class.end; break; - case 349 /* JSDocThrowsTag */: + case 350 /* JSDocThrowsTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = ((_h = tag.typeExpression) == null ? void 0 : _h.end) || commentStart; @@ -142404,22 +143325,22 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 286 /* JsxOpeningElement */: + case 287 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 287 /* JsxClosingElement */: + case 288 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 285 /* JsxSelfClosingElement */: + case 286 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -142440,11 +143361,11 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) if (token) { const parent2 = token.parent; if (tokenKind === 64 /* EqualsToken */) { - if (parent2.kind === 260 /* VariableDeclaration */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 169 /* Parameter */ || parent2.kind === 291 /* JsxAttribute */) { + if (parent2.kind === 261 /* VariableDeclaration */ || parent2.kind === 173 /* PropertyDeclaration */ || parent2.kind === 170 /* Parameter */ || parent2.kind === 292 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent2.kind === 226 /* BinaryExpression */ || parent2.kind === 224 /* PrefixUnaryExpression */ || parent2.kind === 225 /* PostfixUnaryExpression */ || parent2.kind === 227 /* ConditionalExpression */) { + if (parent2.kind === 227 /* BinaryExpression */ || parent2.kind === 225 /* PrefixUnaryExpression */ || parent2.kind === 226 /* PostfixUnaryExpression */ || parent2.kind === 228 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -142454,7 +143375,7 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) } else if (tokenKind === 10 /* BigIntLiteral */) { return 25 /* bigintLiteral */; } else if (tokenKind === 11 /* StringLiteral */) { - return token && token.parent.kind === 291 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 292 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 14 /* RegularExpressionLiteral */) { return 6 /* stringLiteral */; } else if (isTemplateLiteralKind(tokenKind)) { @@ -142464,32 +143385,32 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) } else if (tokenKind === 80 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 169 /* Parameter */: + case 170 /* Parameter */: if (token.parent.name === token) { return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -142648,7 +143569,7 @@ var DocumentHighlights; let child = throwStatement; while (child.parent) { const parent2 = child.parent; - if (isFunctionBlock(parent2) || parent2.kind === 307 /* SourceFile */) { + if (isFunctionBlock(parent2) || parent2.kind === 308 /* SourceFile */) { return parent2; } if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) { @@ -142678,16 +143599,16 @@ var DocumentHighlights; function getBreakOrContinueOwner(statement) { return findAncestor(statement, (node) => { switch (node.kind) { - case 255 /* SwitchStatement */: - if (statement.kind === 251 /* ContinueStatement */) { + case 256 /* SwitchStatement */: + if (statement.kind === 252 /* ContinueStatement */) { return false; } // falls through - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 247 /* WhileStatement */: - case 246 /* DoStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 248 /* WhileStatement */: + case 247 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: return isFunctionLike(node) && "quit"; @@ -142700,24 +143621,24 @@ var DocumentHighlights; function getNodesToSearchForModifier(declaration, modifierFlag) { const container = declaration.parent; switch (container.kind) { - case 268 /* ModuleBlock */: - case 307 /* SourceFile */: - case 241 /* Block */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 269 /* ModuleBlock */: + case 308 /* SourceFile */: + case 242 /* Block */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) { return [...declaration.members, declaration]; } else { return container.statements; } - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 262 /* FunctionDeclaration */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []]; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 187 /* TypeLiteral */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 188 /* TypeLiteral */: const nodes = container.members; if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) { const constructor = find(container.members, isConstructorDeclaration); @@ -142743,7 +143664,7 @@ var DocumentHighlights; function getLoopBreakContinueOccurrences(loopNode) { const keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 99 /* ForKeyword */, 117 /* WhileKeyword */, 92 /* DoKeyword */)) { - if (loopNode.kind === 246 /* DoStatement */) { + if (loopNode.kind === 247 /* DoStatement */) { const loopTokens = loopNode.getChildren(); for (let i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 117 /* WhileKeyword */)) { @@ -142763,13 +143684,13 @@ var DocumentHighlights; const owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -144165,6 +145086,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) { for (const moduleSpecifier of sourceFile.imports) { const importNode = importFromModuleSpecifier(moduleSpecifier); + if (isImportEqualsDeclaration(importNode) && hasSyntacticModifier(importNode, 32 /* Export */)) continue; const name = importNameForConvertToDefaultImport(importNode); if (!name) continue; const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == null ? void 0 : _a.resolvedModule; @@ -144211,13 +145133,13 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some((statement) => { switch (statement.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall( propertyAccessLeftHandSide(decl.initializer), /*requireStringLiteralLikeArgument*/ true )); - case 244 /* ExpressionStatement */: { + case 245 /* ExpressionStatement */: { const { expression } = statement; if (!isBinaryExpression(expression)) return isRequireCall( expression, @@ -144237,10 +145159,10 @@ function propertyAccessLeftHandSide(node) { } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: const { importClause, moduleSpecifier } = node; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 274 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; - case 271 /* ImportEqualsDeclaration */: + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 275 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; + case 272 /* ImportEqualsDeclaration */: return node.name; default: return void 0; @@ -144302,20 +145224,20 @@ function hasSupportedNumberOfArguments(node) { } function isFixablePromiseArgument(arg, checker) { switch (arg.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: const functionFlags = getFunctionFlags(arg); if (functionFlags & 1 /* Generator */) { return false; } // falls through - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 106 /* NullKeyword */: return true; case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: { + case 212 /* PropertyAccessExpression */: { const symbol = checker.getSymbolAtLocation(arg); if (!symbol) { return false; @@ -144349,10 +145271,10 @@ function canBeConvertedToClass(node, checker) { } function canBeConvertedToAsync(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return true; default: return false; @@ -144587,9 +145509,9 @@ function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checke function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile) { var _a; switch (declaration.kind) { - case 273 /* ImportClause */: - case 276 /* ImportSpecifier */: - case 271 /* ImportEqualsDeclaration */: + case 274 /* ImportClause */: + case 277 /* ImportSpecifier */: + case 272 /* ImportEqualsDeclaration */: const importer = checker.getSymbolAtLocation(declaration.name); const imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName && !((_a = imported.declarations) == null ? void 0 : _a.every((d) => shouldExcludeFile(d.getSourceFile(), excludeLibFiles, singleCurrentFile))); @@ -144599,7 +145521,7 @@ function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile } function tryAddSingleDeclarationName(declaration, containers) { const name = getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 167 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 168 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } function tryAddComputedPropertyName(expression, containers) { return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers); @@ -144610,7 +145532,7 @@ function pushLiteral(node, containers) { function getContainers(declaration) { const containers = []; const name = getNameOfDeclaration(declaration); - if (name && name.kind === 167 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 168 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return emptyArray; } containers.shift(); @@ -144794,7 +145716,7 @@ function addChildrenRecursively(node) { return; } switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: const ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); for (const param of ctr.parameters) { @@ -144803,32 +145725,32 @@ function addChildrenRecursively(node) { } } break; - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 174 /* MethodSignature */: if (hasNavigationBarName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: if (hasNavigationBarName(node)) { addNodeWithRecursiveInitializer(node); } break; - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: if (hasNavigationBarName(node)) { addLeafNode(node); } break; - case 273 /* ImportClause */: + case 274 /* ImportClause */: const importClause = node; if (importClause.name) { addLeafNode(importClause.name); } const { namedBindings } = importClause; if (namedBindings) { - if (namedBindings.kind === 274 /* NamespaceImport */) { + if (namedBindings.kind === 275 /* NamespaceImport */) { addLeafNode(namedBindings); } else { for (const element of namedBindings.elements) { @@ -144837,16 +145759,16 @@ function addChildrenRecursively(node) { } } break; - case 304 /* ShorthandPropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 305 /* SpreadAssignment */: + case 306 /* SpreadAssignment */: const { expression } = node; isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 208 /* BindingElement */: - case 303 /* PropertyAssignment */: - case 260 /* VariableDeclaration */: { + case 209 /* BindingElement */: + case 304 /* PropertyAssignment */: + case 261 /* VariableDeclaration */: { const child = node; if (isBindingPattern(child.name)) { addChildrenRecursively(child.name); @@ -144855,18 +145777,18 @@ function addChildrenRecursively(node) { } break; } - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: const nameNode = node.name; if (nameNode && isIdentifier(nameNode)) { addTrackedEs5Class(nameNode.text); } addNodeWithRecursiveChild(node, node.body); break; - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: startNode(node); for (const member of node.members) { if (!isComputedProperty(member)) { @@ -144875,19 +145797,19 @@ function addChildrenRecursively(node) { } endNode(); break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: startNode(node); for (const member of node.members) { addChildrenRecursively(member); } endNode(); break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { const expression2 = node.expression; const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0; if (child) { @@ -144899,16 +145821,16 @@ function addChildrenRecursively(node) { } break; } - case 281 /* ExportSpecifier */: - case 271 /* ImportEqualsDeclaration */: - case 181 /* IndexSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 265 /* TypeAliasDeclaration */: + case 282 /* ExportSpecifier */: + case 272 /* ImportEqualsDeclaration */: + case 182 /* IndexSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 266 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 213 /* CallExpression */: - case 226 /* BinaryExpression */: { + case 214 /* CallExpression */: + case 227 /* BinaryExpression */: { const special = getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -145132,12 +146054,12 @@ function shouldReallyMerge(a, b, parent2) { return false; } switch (a.kind) { - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return isStatic(a) === isStatic(b); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b); default: return true; @@ -145155,7 +146077,7 @@ function areSameModule(a, b) { if (!a.body || !b.body) { return a.body === b.body; } - return a.body.kind === b.body.kind && (a.body.kind !== 267 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 268 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } function merge(target, source) { target.additionalNodes = target.additionalNodes || []; @@ -145176,7 +146098,7 @@ function compareChildren(child1, child2) { return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); } function tryGetName(node) { - if (node.kind === 267 /* ModuleDeclaration */) { + if (node.kind === 268 /* ModuleDeclaration */) { return getModuleName(node); } const declName = getNameOfDeclaration(node); @@ -145185,16 +146107,16 @@ function tryGetName(node) { return propertyName && unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 231 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 232 /* ClassExpression */: return getFunctionOrClassName(node); default: return void 0; } } function getItemName(node, name) { - if (node.kind === 267 /* ModuleDeclaration */) { + if (node.kind === 268 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -145204,27 +146126,27 @@ function getItemName(node, name) { } } switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: const sourceFile = node; return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : ""; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: if (getSyntacticModifierFlags(node) & 2048 /* Default */) { return "default"; } return getFunctionOrClassName(node); - case 176 /* Constructor */: + case 177 /* Constructor */: return "constructor"; - case 180 /* ConstructSignature */: + case 181 /* ConstructSignature */: return "new()"; - case 179 /* CallSignature */: + case 180 /* CallSignature */: return "()"; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: return "[]"; default: return ""; @@ -145249,19 +146171,19 @@ function primaryNavBarMenuItems(root) { return true; } switch (navigationBarNodeKind(item)) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 266 /* EnumDeclaration */: - case 264 /* InterfaceDeclaration */: - case 267 /* ModuleDeclaration */: - case 307 /* SourceFile */: - case 265 /* TypeAliasDeclaration */: - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 267 /* EnumDeclaration */: + case 265 /* InterfaceDeclaration */: + case 268 /* ModuleDeclaration */: + case 308 /* SourceFile */: + case 266 /* TypeAliasDeclaration */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: return true; - case 219 /* ArrowFunction */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -145271,10 +146193,10 @@ function primaryNavBarMenuItems(root) { return false; } switch (navigationBarNodeKind(item2.parent)) { - case 268 /* ModuleBlock */: - case 307 /* SourceFile */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: + case 269 /* ModuleBlock */: + case 308 /* SourceFile */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: return true; default: return false; @@ -145333,7 +146255,7 @@ function getModuleName(moduleDeclaration) { } function getFullyQualifiedModuleName(moduleDeclaration) { const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 267 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 268 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -145343,13 +146265,13 @@ function getInteriorModule(decl) { return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 167 /* ComputedPropertyName */; + return !member.name || member.name.kind === 168 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 307 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); + return node.kind === 308 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); } function getModifiers2(node) { - if (node.parent && node.parent.kind === 260 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 261 /* VariableDeclaration */) { node = node.parent; } return getNodeModifiers(node); @@ -145394,9 +146316,9 @@ function getCalledExpressionName(expr) { } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 231 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 232 /* ClassExpression */: return true; default: return false; @@ -145517,17 +146439,17 @@ function getInfo2(context, considerPartialSpans = true) { } const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) }; switch (exportNode.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 267 /* ModuleDeclaration */: { + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 268 /* ModuleDeclaration */: { const node = exportNode; if (!node.name) return void 0; return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol }; } - case 243 /* VariableStatement */: { + case 244 /* VariableStatement */: { const vs = exportNode; if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { return void 0; @@ -145537,7 +146459,7 @@ function getInfo2(context, considerPartialSpans = true) { Debug.assert(!wasDefault, "Can't have a default flag here"); return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol }; } - case 277 /* ExportAssignment */: { + case 278 /* ExportAssignment */: { const node = exportNode; if (node.isExportEquals) return void 0; return noSymbolError(node.expression) || { exportNode: node, exportName: node.expression, wasDefault, exportingModuleSymbol }; @@ -145568,21 +146490,21 @@ function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName } else { const exportKeyword = Debug.checkDefined(findModifier(exportNode, 95 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(90 /* DefaultKeyword */)); break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: const decl = first(exportNode.declarationList.declarations); if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); break; } // falls through - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 267 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 268 /* ModuleDeclaration */: changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text))); break; @@ -145607,23 +146529,23 @@ function changeImports(program, { wasDefault, exportName, exportingModuleSymbol function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { const { parent: parent2 } = ref; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName)); break; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: { + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: { const spec = parent2; changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 273 /* ImportClause */: { + case 274 /* ImportClause */: { const clause = parent2; Debug.assert(clause.name === ref, "Import clause name should match provided ref"); const spec = makeImportSpecifier(exportName, ref.text); const { namedBindings } = clause; if (!namedBindings) { changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec])); - } else if (namedBindings.kind === 274 /* NamespaceImport */) { + } else if (namedBindings.kind === 275 /* NamespaceImport */) { changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; const newImport = makeImport( @@ -145640,7 +146562,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam } break; } - case 205 /* ImportType */: + case 206 /* ImportType */: const importTypeNode = parent2; changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); break; @@ -145651,10 +146573,10 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam function changeNamedToDefaultImport(importingSourceFile, ref, changes) { const parent2 = ref.parent; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default")); break; - case 276 /* ImportSpecifier */: { + case 277 /* ImportSpecifier */: { const defaultImport = factory.createIdentifier(parent2.name.text); if (parent2.parent.elements.length === 1) { changes.replaceNode(importingSourceFile, parent2.parent, defaultImport); @@ -145664,7 +146586,7 @@ function changeNamedToDefaultImport(importingSourceFile, ref, changes) { } break; } - case 281 /* ExportSpecifier */: { + case 282 /* ExportSpecifier */: { changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text)); break; } @@ -145760,7 +146682,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) { if (!importClause.namedBindings) { return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) }; } - if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { return { convertTo: 0 /* Named */, import: importClause.namedBindings }; } const shouldUseDefault = getShouldUseDefault(context.program, importClause); @@ -145915,8 +146837,8 @@ function createImport(node, defaultImportName, elements) { } function createImportClause(defaultImportName, elements) { return factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, defaultImportName, elements && elements.length ? factory.createNamedImports(elements) : void 0 ); @@ -146450,11 +147372,11 @@ function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols } function getNamespaceLikeImport(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 274 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 275 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; + case 272 /* ImportEqualsDeclaration */: return node.name; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return tryCast(node.name, isIdentifier); default: return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); @@ -146489,13 +147411,13 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie const newNamespaceId = factory.createIdentifier(newNamespaceName); const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference); switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, /*name*/ void 0, factory.createNamespaceImport(newNamespaceId) @@ -146504,7 +147426,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie /*attributes*/ void 0 ); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return factory.createImportEqualsDeclaration( /*modifiers*/ void 0, @@ -146513,7 +147435,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie newNamespaceId, factory.createExternalModuleReference(newModuleString) ); - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return factory.createVariableDeclaration( newNamespaceId, /*exclamationToken*/ @@ -146535,7 +147457,7 @@ function createRequireCall(moduleSpecifier) { ); } function moduleSpecifierFromImport(i) { - return i.kind === 272 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 271 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; + return i.kind === 273 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 272 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; } function forEachImportInStatement(statement, cb) { if (isImportDeclaration(statement)) { @@ -146558,24 +147480,24 @@ function forEachImportInStatement(statement, cb) { } function forEachAliasDeclarationInImportOrRequire(importOrRequire, cb) { var _a, _b, _c, _d, _e; - if (importOrRequire.kind === 272 /* ImportDeclaration */) { + if (importOrRequire.kind === 273 /* ImportDeclaration */) { if ((_a = importOrRequire.importClause) == null ? void 0 : _a.name) { cb(importOrRequire.importClause); } - if (((_c = (_b = importOrRequire.importClause) == null ? void 0 : _b.namedBindings) == null ? void 0 : _c.kind) === 274 /* NamespaceImport */) { + if (((_c = (_b = importOrRequire.importClause) == null ? void 0 : _b.namedBindings) == null ? void 0 : _c.kind) === 275 /* NamespaceImport */) { cb(importOrRequire.importClause.namedBindings); } - if (((_e = (_d = importOrRequire.importClause) == null ? void 0 : _d.namedBindings) == null ? void 0 : _e.kind) === 275 /* NamedImports */) { + if (((_e = (_d = importOrRequire.importClause) == null ? void 0 : _d.namedBindings) == null ? void 0 : _e.kind) === 276 /* NamedImports */) { for (const element of importOrRequire.importClause.namedBindings.elements) { cb(element); } } - } else if (importOrRequire.kind === 271 /* ImportEqualsDeclaration */) { + } else if (importOrRequire.kind === 272 /* ImportEqualsDeclaration */) { cb(importOrRequire); - } else if (importOrRequire.kind === 260 /* VariableDeclaration */) { + } else if (importOrRequire.kind === 261 /* VariableDeclaration */) { if (importOrRequire.name.kind === 80 /* Identifier */) { cb(importOrRequire); - } else if (importOrRequire.name.kind === 206 /* ObjectBindingPattern */) { + } else if (importOrRequire.name.kind === 207 /* ObjectBindingPattern */) { for (const element of importOrRequire.name.elements) { if (isIdentifier(element.name)) { cb(element); @@ -146624,9 +147546,9 @@ function isExported(sourceFile, decl, useEs6Exports, name) { return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name2) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name2))); } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { - if (importDecl.kind === 272 /* ImportDeclaration */ && importDecl.importClause) { + if (importDecl.kind === 273 /* ImportDeclaration */ && importDecl.importClause) { const { name, namedBindings } = importDecl.importClause; - if ((!name || isUnused(name)) && (!namedBindings || namedBindings.kind === 275 /* NamedImports */ && namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)))) { + if ((!name || isUnused(name)) && (!namedBindings || namedBindings.kind === 276 /* NamedImports */ && namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)))) { return changes.delete(sourceFile, importDecl); } } @@ -146646,24 +147568,24 @@ function addExport(decl, useEs6Exports) { function addEs6Export(d) { const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(95 /* ExportKeyword */)], getModifiers(d)) : void 0; switch (d.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const decorators = canHaveDecorators(d) ? getDecorators(d) : void 0; return factory.updateClassDeclaration(d, concatenate(decorators, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return factory.updateVariableStatement(d, modifiers, d.declarationList); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return factory.updateModuleDeclaration(d, modifiers, d.name, d.body); - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: return factory.updateEnumDeclaration(d, modifiers, d.name, d.members); - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type); - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return Debug.fail(); default: return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`); @@ -146683,19 +147605,19 @@ function createExportAssignment(name) { } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0); - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 272 /* ImportEqualsDeclaration */: return emptyArray; - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return Debug.fail("Can't export an ExpressionStatement"); default: return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`); @@ -146703,7 +147625,7 @@ function getNamesToExportInCommonJS(decl) { } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 272 /* ImportDeclaration */: { + case 273 /* ImportDeclaration */: { const clause = i.importClause; if (!clause) return void 0; const defaultImport = clause.name && keep(clause.name) ? clause.name : void 0; @@ -146711,15 +147633,15 @@ function filterImport(i, moduleSpecifier, keep) { return defaultImport || namedBindings ? factory.createImportDeclaration( /*modifiers*/ void 0, - factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), + factory.createImportClause(clause.phaseModifier, defaultImport, namedBindings), getSynthesizedDeepClone(moduleSpecifier), /*attributes*/ void 0 ) : void 0; } - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return keep(i.name) ? i : void 0; - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { const name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0; } @@ -146728,7 +147650,7 @@ function filterImport(i, moduleSpecifier, keep) { } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 274 /* NamespaceImport */) { + if (namedBindings.kind === 275 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : void 0; } else { const newElements = namedBindings.elements.filter((e) => keep(e.name)); @@ -146739,9 +147661,9 @@ function filterBindingName(name, keep) { switch (name.kind) { case 80 /* Identifier */: return keep(name) ? name : void 0; - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: return name; - case 206 /* ObjectBindingPattern */: { + case 207 /* ObjectBindingPattern */: { const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name)); return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0; } @@ -146752,9 +147674,9 @@ function nameOfTopLevelDeclaration(d) { } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return d.parent.parent; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getTopLevelDeclarationStatement( cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p)) ); @@ -146837,11 +147759,11 @@ function isAllowedStatementToMove(statement) { } function isPureImport(node) { switch (node.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return true; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return !hasSyntacticModifier(node, 32 /* Export */); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall( d.initializer, /*requireStringLiteralLikeArgument*/ @@ -146943,17 +147865,17 @@ function forEachReference(node, checker, enclosingRange, onReference) { } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 272 /* ImportEqualsDeclaration */: return cb(statement); - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb)); - case 244 /* ExpressionStatement */: { + case 245 /* ExpressionStatement */: { const { expression } = statement; return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0; } @@ -146961,14 +147883,14 @@ function forEachTopLevelDeclaration(statement, cb) { } function isInImport(decl) { switch (decl.kind) { - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: return true; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -146991,8 +147913,8 @@ function forEachTopLevelDeclarationInBindingName(name, cb) { switch (name.kind) { case 80 /* Identifier */: return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x))); - case 207 /* ArrayBindingPattern */: - case 206 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb)); default: return Debug.assertNever(name, `Unexpected name kind ${name.kind}`); @@ -147000,13 +147922,13 @@ function forEachTopLevelDeclarationInBindingName(name, cb) { } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 264 /* InterfaceDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 272 /* ImportEqualsDeclaration */: return true; default: return false; @@ -147395,7 +148317,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { const lastDeclaration = signatureDecls[signatureDecls.length - 1]; let updated = lastDeclaration; switch (lastDeclaration.kind) { - case 173 /* MethodSignature */: { + case 174 /* MethodSignature */: { updated = factory.updateMethodSignature( lastDeclaration, lastDeclaration.modifiers, @@ -147407,7 +148329,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 174 /* MethodDeclaration */: { + case 175 /* MethodDeclaration */: { updated = factory.updateMethodDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -147421,7 +148343,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 179 /* CallSignature */: { + case 180 /* CallSignature */: { updated = factory.updateCallSignature( lastDeclaration, lastDeclaration.typeParameters, @@ -147430,7 +148352,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 176 /* Constructor */: { + case 177 /* Constructor */: { updated = factory.updateConstructorDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -147439,7 +148361,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 180 /* ConstructSignature */: { + case 181 /* ConstructSignature */: { updated = factory.updateConstructSignature( lastDeclaration, lastDeclaration.typeParameters, @@ -147448,7 +148370,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) { ); break; } - case 262 /* FunctionDeclaration */: { + case 263 /* FunctionDeclaration */: { updated = factory.updateFunctionDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -147524,12 +148446,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 173 /* MethodSignature */: - case 174 /* MethodDeclaration */: - case 179 /* CallSignature */: - case 176 /* Constructor */: - case 180 /* ConstructSignature */: - case 262 /* FunctionDeclaration */: + case 174 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 180 /* CallSignature */: + case 177 /* Constructor */: + case 181 /* ConstructSignature */: + case 263 /* FunctionDeclaration */: return true; } return false; @@ -148142,15 +149064,15 @@ function entryToFunctionCall(entry) { const parent2 = functionReference.parent; switch (parent2.kind) { // foo(...) or super(...) or new Foo(...) - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: const callOrNewExpression = tryCast(parent2, isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression); @@ -148160,7 +149082,7 @@ function entryToFunctionCall(entry) { } break; // x["foo"](...) - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const elementAccessExpression = tryCast(parent2, isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression); @@ -148179,14 +149101,14 @@ function entryToAccessExpression(entry) { const parent2 = reference.parent; switch (parent2.kind) { // `C.foo` - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: const elementAccessExpression = tryCast(parent2, isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -148225,22 +149147,22 @@ function isValidFunctionDeclaration(functionDeclaration, checker) { var _a; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: if (isObjectLiteralExpression(functionDeclaration.parent)) { const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker); return ((_a = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a.length) === 1 && isSingleImplementation(functionDeclaration, checker); } return isSingleImplementation(functionDeclaration, checker); - case 176 /* Constructor */: + case 177 /* Constructor */: if (isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } else { return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -148415,7 +149337,7 @@ function getParameterName(paramDeclaration) { } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; const defaultModifier = Debug.checkDefined( @@ -148423,7 +149345,7 @@ function getClassNames(constructorDeclaration) { "Nameless class declaration should be a default export" ); return [defaultModifier]; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: const classExpression = constructorDeclaration.parent; const variableDeclaration = constructorDeclaration.parent.parent; const className = classExpression.name; @@ -148433,28 +149355,28 @@ function getClassNames(constructorDeclaration) { } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; const defaultModifier = Debug.checkDefined( findModifier(functionDeclaration, 90 /* DefaultKeyword */), "Nameless function declaration should be a default export" ); return [defaultModifier]; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return [functionDeclaration.name]; - case 176 /* Constructor */: + case 177 /* Constructor */: const ctrKeyword = Debug.checkDefined( findChildOfKind(functionDeclaration, 137 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword" ); - if (functionDeclaration.parent.kind === 231 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 232 /* ClassExpression */) { const variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 218 /* FunctionExpression */: + case 219 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; default: @@ -148537,11 +149459,11 @@ function isNotEqualsOperator(node) { function getParentBinaryExpression(expr) { const container = findAncestor(expr.parent, (n) => { switch (n.kind) { - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: return false; - case 228 /* TemplateExpression */: - case 226 /* BinaryExpression */: + case 229 /* TemplateExpression */: + case 227 /* BinaryExpression */: return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); default: return "quit"; @@ -149181,18 +150103,18 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { function checkForStaticContext(nodeToCheck, containingClass) { let current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 172 /* PropertyDeclaration */) { + if (current.kind === 173 /* PropertyDeclaration */) { if (isStatic(current)) { rangeFacts |= 32 /* InStaticRegion */; } break; - } else if (current.kind === 169 /* Parameter */) { + } else if (current.kind === 170 /* Parameter */) { const ctorOrMethod = getContainingFunction(current); - if (ctorOrMethod.kind === 176 /* Constructor */) { + if (ctorOrMethod.kind === 177 /* Constructor */) { rangeFacts |= 32 /* InStaticRegion */; } break; - } else if (current.kind === 174 /* MethodDeclaration */) { + } else if (current.kind === 175 /* MethodDeclaration */) { if (isStatic(current)) { rangeFacts |= 32 /* InStaticRegion */; } @@ -149232,7 +150154,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { /*includeClassComputedPropertyName*/ false ); - if (container.kind === 262 /* FunctionDeclaration */ || container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ || container.kind === 218 /* FunctionExpression */) { + if (container.kind === 263 /* FunctionDeclaration */ || container.kind === 175 /* MethodDeclaration */ && container.parent.kind === 211 /* ObjectLiteralExpression */ || container.kind === 219 /* FunctionExpression */) { rangeFacts |= 16 /* UsesThisInFunction */; } } @@ -149242,21 +150164,21 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { return true; } if (isDeclaration(node2)) { - const declaringNode = node2.kind === 260 /* VariableDeclaration */ ? node2.parent.parent : node2; + const declaringNode = node2.kind === 261 /* VariableDeclaration */ ? node2.parent.parent : node2; if (hasSyntacticModifier(declaringNode, 32 /* Export */)) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); return true; } } switch (node2.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport)); return true; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); return true; case 108 /* SuperKeyword */: - if (node2.parent.kind === 213 /* CallExpression */) { + if (node2.parent.kind === 214 /* CallExpression */) { const containingClass2 = getContainingClass(node2); if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractSuper)); @@ -149267,7 +150189,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { thisNode = node2; } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: forEachChild(node2, function check(n) { if (isThis(n)) { rangeFacts |= 8 /* UsesThis */; @@ -149279,35 +150201,35 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { } }); // falls through - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope)); } // falls through - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return false; } const savedPermittedJumps = permittedJumps; switch (node2.kind) { - case 245 /* IfStatement */: + case 246 /* IfStatement */: permittedJumps &= ~4 /* Return */; break; - case 258 /* TryStatement */: + case 259 /* TryStatement */: permittedJumps = 0 /* None */; break; - case 241 /* Block */: - if (node2.parent && node2.parent.kind === 258 /* TryStatement */ && node2.parent.finallyBlock === node2) { + case 242 /* Block */: + if (node2.parent && node2.parent.kind === 259 /* TryStatement */ && node2.parent.finallyBlock === node2) { permittedJumps = 4 /* Return */; } break; - case 297 /* DefaultClause */: - case 296 /* CaseClause */: + case 298 /* DefaultClause */: + case 297 /* CaseClause */: permittedJumps |= 1 /* Break */; break; default: @@ -149321,39 +150243,39 @@ function getRangeToExtract2(sourceFile, span, invoked = true) { break; } switch (node2.kind) { - case 197 /* ThisType */: + case 198 /* ThisType */: case 110 /* ThisKeyword */: rangeFacts |= 8 /* UsesThis */; thisNode = node2; break; - case 256 /* LabeledStatement */: { + case 257 /* LabeledStatement */: { const label = node2.label; (seenLabels || (seenLabels = [])).push(label.escapedText); forEachChild(node2, visit); seenLabels.pop(); break; } - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: { + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: { const label = node2.label; if (label) { if (!contains(seenLabels, label.escapedText)) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); } } else { - if (!(permittedJumps & (node2.kind === 252 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node2.kind === 253 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 223 /* AwaitExpression */: + case 224 /* AwaitExpression */: rangeFacts |= 4 /* IsAsyncFunction */; break; - case 229 /* YieldExpression */: + case 230 /* YieldExpression */: rangeFacts |= 2 /* IsGenerator */; break; - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= 1 /* HasReturn */; } else { @@ -149403,12 +150325,12 @@ function collectEnclosingScopes(range) { const scopes = []; while (true) { current = current.parent; - if (current.kind === 169 /* Parameter */) { + if (current.kind === 170 /* Parameter */) { current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent; } if (isScope(current)) { scopes.push(current); - if (current.kind === 307 /* SourceFile */) { + if (current.kind === 308 /* SourceFile */) { return scopes; } } @@ -149484,28 +150406,28 @@ function getDescriptionForConstantInScope(scope) { } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: return "constructor"; - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: return scope.name ? `function '${scope.name.text}'` : ANONYMOUS; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return "arrow function"; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return `method '${scope.name.getText()}'`; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return `'get ${scope.name.getText()}'`; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return `'set ${scope.name.getText()}'`; default: Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 263 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; + return scope.kind === 264 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 268 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; + return scope.kind === 269 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range, context) { const checker = context.program.getTypeChecker(); @@ -149878,7 +150800,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); const localReference = factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); - } else if (node.parent.kind === 244 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { + } else if (node.parent.kind === 245 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { const newVariableStatement = factory.createVariableStatement( /*modifiers*/ void 0, @@ -149908,7 +150830,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont false ); } - if (node.parent.kind === 244 /* ExpressionStatement */) { + if (node.parent.kind === 245 /* ExpressionStatement */) { changeTracker.delete(context.file, node.parent); } else { let localReference = factory.createIdentifier(localNameText); @@ -150442,18 +151364,18 @@ function getExtractableParent(node) { function isExtractableExpression(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 306 /* EnumMember */: + case 307 /* EnumMember */: return false; } switch (node.kind) { case 11 /* StringLiteral */: - return parent2.kind !== 272 /* ImportDeclaration */ && parent2.kind !== 276 /* ImportSpecifier */; - case 230 /* SpreadElement */: - case 206 /* ObjectBindingPattern */: - case 208 /* BindingElement */: + return parent2.kind !== 273 /* ImportDeclaration */ && parent2.kind !== 277 /* ImportSpecifier */; + case 231 /* SpreadElement */: + case 207 /* ObjectBindingPattern */: + case 209 /* BindingElement */: return false; case 80 /* Identifier */: - return parent2.kind !== 208 /* BindingElement */ && parent2.kind !== 276 /* ImportSpecifier */ && parent2.kind !== 281 /* ExportSpecifier */; + return parent2.kind !== 209 /* BindingElement */ && parent2.kind !== 277 /* ImportSpecifier */ && parent2.kind !== 282 /* ExportSpecifier */; } return true; } @@ -150611,10 +151533,10 @@ function getInfo4(context) { } function isConvertibleDeclaration(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: return true; default: return false; @@ -150685,13 +151607,13 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken) let inJSXElement = false; function visit(node) { switch (node.kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { @@ -150828,25 +151750,25 @@ function isRightSideOfQualifiedNameOrPropertyAccess2(node) { return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node; } var tokenFromDeclarationMapping = /* @__PURE__ */ new Map([ - [260 /* VariableDeclaration */, 7 /* variable */], - [169 /* Parameter */, 6 /* parameter */], - [172 /* PropertyDeclaration */, 9 /* property */], - [267 /* ModuleDeclaration */, 3 /* namespace */], - [266 /* EnumDeclaration */, 1 /* enum */], - [306 /* EnumMember */, 8 /* enumMember */], - [263 /* ClassDeclaration */, 0 /* class */], - [174 /* MethodDeclaration */, 11 /* member */], - [262 /* FunctionDeclaration */, 10 /* function */], - [218 /* FunctionExpression */, 10 /* function */], - [173 /* MethodSignature */, 11 /* member */], - [177 /* GetAccessor */, 9 /* property */], - [178 /* SetAccessor */, 9 /* property */], - [171 /* PropertySignature */, 9 /* property */], - [264 /* InterfaceDeclaration */, 2 /* interface */], - [265 /* TypeAliasDeclaration */, 5 /* type */], - [168 /* TypeParameter */, 4 /* typeParameter */], - [303 /* PropertyAssignment */, 9 /* property */], - [304 /* ShorthandPropertyAssignment */, 9 /* property */] + [261 /* VariableDeclaration */, 7 /* variable */], + [170 /* Parameter */, 6 /* parameter */], + [173 /* PropertyDeclaration */, 9 /* property */], + [268 /* ModuleDeclaration */, 3 /* namespace */], + [267 /* EnumDeclaration */, 1 /* enum */], + [307 /* EnumMember */, 8 /* enumMember */], + [264 /* ClassDeclaration */, 0 /* class */], + [175 /* MethodDeclaration */, 11 /* member */], + [263 /* FunctionDeclaration */, 10 /* function */], + [219 /* FunctionExpression */, 10 /* function */], + [174 /* MethodSignature */, 11 /* member */], + [178 /* GetAccessor */, 9 /* property */], + [179 /* SetAccessor */, 9 /* property */], + [172 /* PropertySignature */, 9 /* property */], + [265 /* InterfaceDeclaration */, 2 /* interface */], + [266 /* TypeAliasDeclaration */, 5 /* type */], + [169 /* TypeParameter */, 4 /* typeParameter */], + [304 /* PropertyAssignment */, 9 /* property */], + [305 /* ShorthandPropertyAssignment */, 9 /* property */] ]); // src/services/services.ts @@ -150927,8 +151849,8 @@ var NodeObject = class { if (!children.length) { return void 0; } - const child = find(children, (kid) => kid.kind < 309 /* FirstJSDocNode */ || kid.kind > 351 /* LastJSDocNode */); - return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + const child = find(children, (kid) => kid.kind < 310 /* FirstJSDocNode */ || kid.kind > 352 /* LastJSDocNode */); + return child.kind < 167 /* FirstNode */ ? child : child.getFirstToken(sourceFile); } getLastToken(sourceFile) { this.assertHasRealPosition(); @@ -150937,7 +151859,7 @@ var NodeObject = class { if (!child) { return void 0; } - return child.kind < 166 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 167 /* FirstNode */ ? child : child.getLastToken(sourceFile); } forEachChild(cbNode, cbNodeArray) { return forEachChild(this, cbNode, cbNodeArray); @@ -150951,7 +151873,9 @@ function createChildren(node, sourceFile) { }); return children; } + const languageVariant = (sourceFile == null ? void 0 : sourceFile.languageVariant) ?? 0 /* Standard */; scanner.setText((sourceFile || node.getSourceFile()).text); + scanner.setLanguageVariant(languageVariant); let pos = node.pos; const processNode = (child) => { addSyntheticNodes(children, pos, child.pos, node); @@ -150968,6 +151892,7 @@ function createChildren(node, sourceFile) { node.forEachChild(processNode, processNodes); addSyntheticNodes(children, pos, node.end, node); scanner.setText(void 0); + scanner.setLanguageVariant(0 /* Standard */); return children; } function addSyntheticNodes(nodes, pos, end, parent2) { @@ -150991,7 +151916,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) { } } function createSyntaxList(nodes, parent2) { - const list = createNode(352 /* SyntaxList */, nodes.pos, nodes.end, parent2); + const list = createNode(353 /* SyntaxList */, nodes.pos, nodes.end, parent2); const children = []; let pos = nodes.pos; for (const node of nodes) { @@ -151320,7 +152245,7 @@ function getJsDocTagsOfDeclarations(declarations, checker) { var _a; if (!seenSymbols.has(symbol)) { seenSymbols.add(symbol); - if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) { + if (declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) { return symbol.getContextualJsDocTags(declaration, checker); } return ((_a = symbol.declarations) == null ? void 0 : _a.length) === 1 ? symbol.getJsDocTags(checker) : void 0; @@ -151342,7 +152267,7 @@ function getDocumentationComment(declarations, checker) { const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => { if (!seenSymbols.has(symbol)) { seenSymbols.add(symbol); - if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) { + if (declaration.kind === 178 /* GetAccessor */ || declaration.kind === 179 /* SetAccessor */) { return symbol.getContextualDocumentationComment(declaration, checker); } return symbol.getDocumentationComment(checker); @@ -151355,7 +152280,7 @@ function getDocumentationComment(declarations, checker) { } function findBaseOfDeclaration(checker, declaration, cb) { var _a; - const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 176 /* Constructor */ ? declaration.parent.parent : declaration.parent; + const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 177 /* Constructor */ ? declaration.parent.parent : declaration.parent; if (!classOrInterfaceDeclaration) return; const isStaticMember = hasStaticModifier(declaration); return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), (superTypeNode) => { @@ -151423,10 +152348,10 @@ var SourceFileObject = class extends NodeObject { } function visit(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: const functionDeclaration = node; const declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -151442,30 +152367,30 @@ var SourceFileObject = class extends NodeObject { } forEachChild(node, visit); break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 266 /* EnumDeclaration */: - case 267 /* ModuleDeclaration */: - case 271 /* ImportEqualsDeclaration */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 187 /* TypeLiteral */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 267 /* EnumDeclaration */: + case 268 /* ModuleDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 188 /* TypeLiteral */: addDeclaration(node); forEachChild(node, visit); break; - case 169 /* Parameter */: + case 170 /* Parameter */: if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) { break; } // falls through - case 260 /* VariableDeclaration */: - case 208 /* BindingElement */: { + case 261 /* VariableDeclaration */: + case 209 /* BindingElement */: { const decl = node; if (isBindingPattern(decl.name)) { forEachChild(decl.name, visit); @@ -151476,12 +152401,12 @@ var SourceFileObject = class extends NodeObject { } } // falls through - case 306 /* EnumMember */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 307 /* EnumMember */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: addDeclaration(node); break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: const exportDeclaration = node; if (exportDeclaration.exportClause) { if (isNamedExports(exportDeclaration.exportClause)) { @@ -151491,14 +152416,14 @@ var SourceFileObject = class extends NodeObject { } } break; - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: const importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause.name); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 275 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { forEach(importClause.namedBindings.elements, visit); @@ -151506,7 +152431,7 @@ var SourceFileObject = class extends NodeObject { } } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -152221,7 +153146,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h synchronizeHostData(); return ts_Completions_exports.getCompletionEntrySymbol(program, log, getValidSourceFile(fileName), position, { name, source }, host, preferences); } - function getQuickInfoAtPosition(fileName, position) { + function getQuickInfoAtPosition(fileName, position, maximumLength, verbosityLevel) { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); const node = getTouchingPropertyName(sourceFile, position); @@ -152237,19 +153162,42 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h kind: "" /* unknown */, kindModifiers: "" /* none */, textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), - displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts(typeChecker2, type, getContainerNode(nodeForQuickInfo))), + displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts( + typeChecker2, + type, + getContainerNode(nodeForQuickInfo), + /*flags*/ + void 0, + verbosityLevel + )), documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : void 0, tags: type.symbol ? type.symbol.getJsDocTags(typeChecker) : void 0 }; } - const { symbolKind, displayParts, documentation, tags } = typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, getContainerNode(nodeForQuickInfo), nodeForQuickInfo)); + const { symbolKind, displayParts, documentation, tags, canIncreaseVerbosityLevel } = typeChecker.runWithCancellationToken( + cancellationToken, + (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind( + typeChecker2, + symbol, + sourceFile, + getContainerNode(nodeForQuickInfo), + nodeForQuickInfo, + /*semanticMeaning*/ + void 0, + /*alias*/ + void 0, + maximumLength ?? defaultHoverMaximumTruncationLength, + verbosityLevel + ) + ); return { kind: symbolKind, kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), displayParts, documentation, - tags + tags, + canIncreaseVerbosityLevel }; } function preparePasteEditsForFile(fileName, copiedTextRange) { @@ -152291,19 +153239,19 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h function shouldGetType(sourceFile, node, position) { switch (node.kind) { case 80 /* Identifier */: - if (node.flags & 16777216 /* JSDoc */ && !isInJSFile(node) && (node.parent.kind === 171 /* PropertySignature */ && node.parent.name === node || findAncestor(node, (n) => n.kind === 169 /* Parameter */))) { + if (node.flags & 16777216 /* JSDoc */ && !isInJSFile(node) && (node.parent.kind === 172 /* PropertySignature */ && node.parent.name === node || findAncestor(node, (n) => n.kind === 170 /* Parameter */))) { return false; } return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent); - case 211 /* PropertyAccessExpression */: - case 166 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: return !isInComment(sourceFile, position); case 110 /* ThisKeyword */: - case 197 /* ThisType */: + case 198 /* ThisType */: case 108 /* SuperKeyword */: - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: return true; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: return isImportMeta(node); default: return false; @@ -152397,15 +153345,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h return void 0; } switch (node.kind) { - case 211 /* PropertyAccessExpression */: - case 166 /* QualifiedName */: + case 212 /* PropertyAccessExpression */: + case 167 /* QualifiedName */: case 11 /* StringLiteral */: case 97 /* FalseKeyword */: case 112 /* TrueKeyword */: case 106 /* NullKeyword */: case 108 /* SuperKeyword */: case 110 /* ThisKeyword */: - case 197 /* ThisType */: + case 198 /* ThisType */: case 80 /* Identifier */: break; // Cant create the text span @@ -152417,7 +153365,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 267 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 268 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { break; @@ -152594,7 +153542,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h function getLinkedEditingRangeAtPosition(fileName, position) { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); const token = findPrecedingToken(position, sourceFile); - if (!token || token.parent.kind === 307 /* SourceFile */) return void 0; + if (!token || token.parent.kind === 308 /* SourceFile */) return void 0; const jsxTagWordPattern = "[a-zA-Z0-9:\\-\\._$]*"; if (isJsxFragment(token.parent.parent)) { const openFragment = token.parent.parent.openingFragment; @@ -153113,7 +154061,7 @@ function initializeNameTable(sourceFile) { }); } function literalIsName(node) { - return isDeclarationName(node) || node.parent.kind === 283 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); + return isDeclarationName(node) || node.parent.kind === 284 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); } function getContainingObjectLiteralElement(node) { const element = getContainingObjectLiteralElementWorker(node); @@ -153124,12 +154072,13 @@ function getContainingObjectLiteralElementWorker(node) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: - if (node.parent.kind === 167 /* ComputedPropertyName */) { + if (node.parent.kind === 168 /* ComputedPropertyName */) { return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0; } // falls through case 80 /* Identifier */: - return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 292 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; + case 296 /* JsxNamespacedName */: + return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.parent.kind === 293 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; } return void 0; } @@ -153169,7 +154118,7 @@ function getPropertySymbolsFromContextualType(node, checker, contextualType, uni return deduplicate(discriminatedPropertySymbols, equateValues); } function isArgumentOfElementAccessExpression(node) { - return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node; + return node && node.parent && node.parent.kind === 213 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } function getDefaultLibFilePath(options) { if (sys) { @@ -153261,92 +154210,92 @@ function spanInSourceFileAtLocation(sourceFile, position) { if (node) { const { parent: parent2 } = node; switch (node.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 260 /* VariableDeclaration */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 261 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return spanInVariableDeclaration(node); - case 169 /* Parameter */: + case 170 /* Parameter */: return spanInParameterDeclaration(node); - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 241 /* Block */: + case 242 /* Block */: if (isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return spanInBlock(node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return spanInBlock(node.block); - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: return textSpan(node.expression); - case 253 /* ReturnStatement */: + case 254 /* ReturnStatement */: return textSpan(node.getChildAt(0), node.expression); - case 247 /* WhileStatement */: + case 248 /* WhileStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 246 /* DoStatement */: + case 247 /* DoStatement */: return spanInNode(node.statement); - case 259 /* DebuggerStatement */: + case 260 /* DebuggerStatement */: return textSpan(node.getChildAt(0)); - case 245 /* IfStatement */: + case 246 /* IfStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 256 /* LabeledStatement */: + case 257 /* LabeledStatement */: return spanInNode(node.statement); - case 252 /* BreakStatement */: - case 251 /* ContinueStatement */: + case 253 /* BreakStatement */: + case 252 /* ContinueStatement */: return textSpan(node.getChildAt(0), node.label); - case 248 /* ForStatement */: + case 249 /* ForStatement */: return spanInForStatement(node); - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return spanInInitializerOfForLike(node); - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return spanInNode(node.statements[0]); - case 258 /* TryStatement */: + case 259 /* TryStatement */: return spanInBlock(node.tryBlock); - case 257 /* ThrowStatement */: + case 258 /* ThrowStatement */: return textSpan(node, node.expression); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return textSpan(node, node.expression); - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return textSpan(node, node.moduleReference); - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return textSpan(node, node.moduleSpecifier); - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: return textSpan(node, node.moduleSpecifier); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (getModuleInstanceState(node) !== 1 /* Instantiated */) { return void 0; } // falls through - case 263 /* ClassDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 208 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 209 /* BindingElement */: return textSpan(node); - case 254 /* WithStatement */: + case 255 /* WithStatement */: return spanInNode(node.statement); - case 170 /* Decorator */: + case 171 /* Decorator */: return spanInNodeArray(parent2.modifiers, node, isDecorator); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return void 0; // Tokens: case 27 /* SemicolonToken */: @@ -153382,10 +154331,10 @@ function spanInSourceFileAtLocation(sourceFile, position) { if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } - if ((node.kind === 80 /* Identifier */ || node.kind === 230 /* SpreadElement */ || node.kind === 303 /* PropertyAssignment */ || node.kind === 304 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { + if ((node.kind === 80 /* Identifier */ || node.kind === 231 /* SpreadElement */ || node.kind === 304 /* PropertyAssignment */ || node.kind === 305 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { return textSpan(node); } - if (node.kind === 226 /* BinaryExpression */) { + if (node.kind === 227 /* BinaryExpression */) { const { left, operatorToken } = node; if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern( @@ -153401,19 +154350,19 @@ function spanInSourceFileAtLocation(sourceFile, position) { } if (isExpressionNode(node)) { switch (parent2.kind) { - case 246 /* DoStatement */: + case 247 /* DoStatement */: return spanInPreviousNode(node); - case 170 /* Decorator */: + case 171 /* Decorator */: return spanInNode(node.parent); - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: return textSpan(node); - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (node.parent.operatorToken.kind === 28 /* CommaToken */) { return textSpan(node); } break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: if (node.parent.body === node) { return textSpan(node); } @@ -153421,25 +154370,25 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } switch (node.parent.kind) { - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 216 /* TypeAssertionExpression */: + case 217 /* TypeAssertionExpression */: if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: { + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: { const { initializer, type } = node.parent; if (initializer === node || type === node || isAssignmentOperator(node.kind)) { return spanInPreviousNode(node); } break; } - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const { left } = node.parent; if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { return spanInPreviousNode(node); @@ -153462,14 +154411,14 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 249 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 250 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } const parent2 = variableDeclaration.parent; if (isBindingPattern(variableDeclaration.name)) { return spanInBindingPattern(variableDeclaration.name); } - if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 250 /* ForOfStatement */) { + if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 251 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { @@ -153496,7 +154445,7 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 263 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */; + return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 264 /* ClassDeclaration */ && functionDeclaration.kind !== 177 /* Constructor */; } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -153516,25 +154465,25 @@ function spanInSourceFileAtLocation(sourceFile, position) { } function spanInBlock(block) { switch (block.parent.kind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return void 0; } // Set on parent if on same line otherwise on first statement // falls through - case 247 /* WhileStatement */: - case 245 /* IfStatement */: - case 249 /* ForInStatement */: + case 248 /* WhileStatement */: + case 246 /* IfStatement */: + case 250 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 261 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 262 /* VariableDeclarationList */) { const variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -153555,62 +154504,62 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInBindingPattern(bindingPattern) { - const firstBindingElement = forEach(bindingPattern.elements, (element) => element.kind !== 232 /* OmittedExpression */ ? element : void 0); + const firstBindingElement = forEach(bindingPattern.elements, (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0); if (firstBindingElement) { return spanInNode(firstBindingElement); } - if (bindingPattern.parent.kind === 208 /* BindingElement */) { + if (bindingPattern.parent.kind === 209 /* BindingElement */) { return textSpan(bindingPattern.parent); } return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) { - Debug.assert(node2.kind !== 207 /* ArrayBindingPattern */ && node2.kind !== 206 /* ObjectBindingPattern */); - const elements = node2.kind === 209 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; - const firstBindingElement = forEach(elements, (element) => element.kind !== 232 /* OmittedExpression */ ? element : void 0); + Debug.assert(node2.kind !== 208 /* ArrayBindingPattern */ && node2.kind !== 207 /* ObjectBindingPattern */); + const elements = node2.kind === 210 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; + const firstBindingElement = forEach(elements, (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0); if (firstBindingElement) { return spanInNode(firstBindingElement); } - return textSpan(node2.parent.kind === 226 /* BinaryExpression */ ? node2.parent : node2); + return textSpan(node2.parent.kind === 227 /* BinaryExpression */ ? node2.parent : node2); } function spanInOpenBraceToken(node2) { switch (node2.parent.kind) { - case 266 /* EnumDeclaration */: + case 267 /* EnumDeclaration */: const enumDeclaration = node2.parent; return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: const classDeclaration = node2.parent; return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]); } return spanInNode(node2.parent); } function spanInCloseBraceToken(node2) { switch (node2.parent.kind) { - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) { return void 0; } // falls through - case 266 /* EnumDeclaration */: - case 263 /* ClassDeclaration */: + case 267 /* EnumDeclaration */: + case 264 /* ClassDeclaration */: return textSpan(node2); - case 241 /* Block */: + case 242 /* Block */: if (isFunctionBlock(node2.parent)) { return textSpan(node2); } // falls through - case 299 /* CatchClause */: + case 300 /* CatchClause */: return spanInNode(lastOrUndefined(node2.parent.statements)); - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: const caseBlock = node2.parent; const lastClause = lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(lastOrUndefined(lastClause.statements)); } return void 0; - case 206 /* ObjectBindingPattern */: + case 207 /* ObjectBindingPattern */: const bindingPattern = node2.parent; return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); // Default to parent node @@ -153624,7 +154573,7 @@ function spanInSourceFileAtLocation(sourceFile, position) { } function spanInCloseBracketToken(node2) { switch (node2.parent.kind) { - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: const bindingPattern = node2.parent; return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -153636,32 +154585,32 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInOpenParenToken(node2) { - if (node2.parent.kind === 246 /* DoStatement */ || // Go to while keyword and do action instead - node2.parent.kind === 213 /* CallExpression */ || node2.parent.kind === 214 /* NewExpression */) { + if (node2.parent.kind === 247 /* DoStatement */ || // Go to while keyword and do action instead + node2.parent.kind === 214 /* CallExpression */ || node2.parent.kind === 215 /* NewExpression */) { return spanInPreviousNode(node2); } - if (node2.parent.kind === 217 /* ParenthesizedExpression */) { + if (node2.parent.kind === 218 /* ParenthesizedExpression */) { return spanInNextNode(node2); } return spanInNode(node2.parent); } function spanInCloseParenToken(node2) { switch (node2.parent.kind) { - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 176 /* Constructor */: - case 247 /* WhileStatement */: - case 246 /* DoStatement */: - case 248 /* ForStatement */: - case 250 /* ForOfStatement */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 217 /* ParenthesizedExpression */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 177 /* Constructor */: + case 248 /* WhileStatement */: + case 247 /* DoStatement */: + case 249 /* ForStatement */: + case 251 /* ForOfStatement */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 218 /* ParenthesizedExpression */: return spanInPreviousNode(node2); // Default to parent node default: @@ -153669,25 +154618,25 @@ function spanInSourceFileAtLocation(sourceFile, position) { } } function spanInColonToken(node2) { - if (isFunctionLike(node2.parent) || node2.parent.kind === 303 /* PropertyAssignment */ || node2.parent.kind === 169 /* Parameter */) { + if (isFunctionLike(node2.parent) || node2.parent.kind === 304 /* PropertyAssignment */ || node2.parent.kind === 170 /* Parameter */) { return spanInPreviousNode(node2); } return spanInNode(node2.parent); } function spanInGreaterThanOrLessThanToken(node2) { - if (node2.parent.kind === 216 /* TypeAssertionExpression */) { + if (node2.parent.kind === 217 /* TypeAssertionExpression */) { return spanInNextNode(node2); } return spanInNode(node2.parent); } function spanInWhileKeyword(node2) { - if (node2.parent.kind === 246 /* DoStatement */) { + if (node2.parent.kind === 247 /* DoStatement */) { return textSpanEndingAtNextToken(node2, node2.parent.expression); } return spanInNode(node2.parent); } function spanInOfKeyword(node2) { - if (node2.parent.kind === 250 /* ForOfStatement */) { + if (node2.parent.kind === 251 /* ForOfStatement */) { return spanInNextNode(node2); } return spanInNode(node2.parent); @@ -153779,16 +154728,16 @@ function getCallHierarchItemContainerName(node) { return; } switch (node.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: - if (node.parent.kind === 210 /* ObjectLiteralExpression */) { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: + if (node.parent.kind === 211 /* ObjectLiteralExpression */) { return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText(); } return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText(); - case 262 /* FunctionDeclaration */: - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: + case 263 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -154004,55 +154953,55 @@ function createCallSiteCollector(program, callSites) { } switch (node.kind) { case 80 /* Identifier */: - case 271 /* ImportEqualsDeclaration */: - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 272 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: return; - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: recordCallSite(node); return; - case 216 /* TypeAssertionExpression */: - case 234 /* AsExpression */: + case 217 /* TypeAssertionExpression */: + case 235 /* AsExpression */: collect(node.expression); return; - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: collect(node.name); collect(node.initializer); return; - case 213 /* CallExpression */: + case 214 /* CallExpression */: recordCallSite(node); collect(node.expression); forEach(node.arguments, collect); return; - case 214 /* NewExpression */: + case 215 /* NewExpression */: recordCallSite(node); collect(node.expression); forEach(node.arguments, collect); return; - case 215 /* TaggedTemplateExpression */: + case 216 /* TaggedTemplateExpression */: recordCallSite(node); collect(node.tag); collect(node.template); return; - case 286 /* JsxOpeningElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 170 /* Decorator */: + case 171 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 211 /* PropertyAccessExpression */: - case 212 /* ElementAccessExpression */: + case 212 /* PropertyAccessExpression */: + case 213 /* ElementAccessExpression */: recordCallSite(node); forEachChild(node, collect); break; - case 238 /* SatisfiesExpression */: + case 239 /* SatisfiesExpression */: collect(node.expression); return; } @@ -154105,25 +155054,25 @@ function collectCallSites(program, node) { const callSites = []; const collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; - case 175 /* ClassStaticBlockDeclaration */: + case 176 /* ClassStaticBlockDeclaration */: collectCallSitesOfClassStaticBlockDeclaration(node, collect); break; default: @@ -154182,7 +155131,6 @@ __export(ts_codefix_exports, { generateAccessorFromProperty: () => generateAccessorFromProperty, getAccessorConvertiblePropertyAtPosition: () => getAccessorConvertiblePropertyAtPosition, getAllFixes: () => getAllFixes, - getAllSupers: () => getAllSupers, getFixes: () => getFixes, getImportCompletionAction: () => getImportCompletionAction, getImportKind: () => getImportKind, @@ -154522,7 +155470,7 @@ function findAwaitableInitializers(expression, sourceFile, cancellationToken, pr } const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration); const variableName = declaration && tryCast(declaration.name, isIdentifier); - const variableStatement = getAncestor(declaration, 243 /* VariableStatement */); + const variableStatement = getAncestor(declaration, 244 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { isCompleteFix = false; continue; @@ -154581,7 +155529,7 @@ function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, c checker.getTypeAtLocation(errorNode).flags & 1 /* Any */; } function isInsideAwaitableBody(node) { - return node.flags & 65536 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 262 /* FunctionDeclaration */ || ancestor.parent.kind === 218 /* FunctionExpression */ || ancestor.parent.kind === 219 /* ArrowFunction */ || ancestor.parent.kind === 174 /* MethodDeclaration */)); + return node.flags & 65536 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 263 /* FunctionDeclaration */ || ancestor.parent.kind === 219 /* FunctionExpression */ || ancestor.parent.kind === 220 /* ArrowFunction */ || ancestor.parent.kind === 175 /* MethodDeclaration */)); } function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) { @@ -154696,10 +155644,10 @@ function applyChange(changeTracker, initializer, sourceFile, fixedNodes) { function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 80 /* Identifier */: - case 209 /* ArrayLiteralExpression */: - case 210 /* ObjectLiteralExpression */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 210 /* ArrayLiteralExpression */: + case 211 /* ObjectLiteralExpression */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -154716,7 +155664,7 @@ function arrayElementCouldBeVariableDeclaration(expression, checker) { function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 80 /* Identifier */: - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: case 28 /* CommaToken */: return true; default: @@ -154758,7 +155706,7 @@ function makeChange5(changeTracker, sourceFile, pos, fixedNodes) { return; } const declaration = token.parent; - if (declaration.kind === 172 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { + if (declaration.kind === 173 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 138 /* DeclareKeyword */, declaration); } } @@ -154842,7 +155790,7 @@ function makeChange7(changeTracker, sourceFile, pos, program, host, preferences) ) ]) ); - if (importNode.kind === 272 /* ImportDeclaration */) { + if (importNode.kind === 273 /* ImportDeclaration */) { changeTracker.replaceNode( sourceFile, importNode, @@ -154990,7 +155938,7 @@ function addUndefinedToOptionalProperty(changes, toAdd) { const d = add.valueDeclaration; if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) { const t = factory.createUnionTypeNode([ - ...d.type.kind === 192 /* UnionType */ ? d.type.types : [d.type], + ...d.type.kind === 193 /* UnionType */ ? d.type.types : [d.type], factory.createTypeReferenceNode("undefined") ]); changes.replaceNode(d.getSourceFile(), d.type, t); @@ -155051,26 +155999,26 @@ function doChange8(changes, sourceFile, decl) { } } function isDeclarationWithType(node) { - return isFunctionLikeDeclaration(node) || node.kind === 260 /* VariableDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 172 /* PropertyDeclaration */; + return isFunctionLikeDeclaration(node) || node.kind === 261 /* VariableDeclaration */ || node.kind === 172 /* PropertySignature */ || node.kind === 173 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 312 /* JSDocAllType */: - case 313 /* JSDocUnknownType */: + case 313 /* JSDocAllType */: + case 314 /* JSDocUnknownType */: return factory.createTypeReferenceNode("any", emptyArray); - case 316 /* JSDocOptionalType */: + case 317 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 315 /* JSDocNonNullableType */: + case 316 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 314 /* JSDocNullableType */: + case 315 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 318 /* JSDocVariadicType */: + case 319 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 317 /* JSDocFunctionType */: + case 318 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 183 /* TypeReference */: + case 184 /* TypeReference */: return transformJSDocTypeReference(node); - case 322 /* JSDocTypeLiteral */: + case 323 /* JSDocTypeLiteral */: return transformJSDocTypeLiteral(node); default: const visited = visitEachChild( @@ -155108,7 +156056,7 @@ function transformJSDocFunctionType(node) { } function transformJSDocParameter(node) { const index = node.parent.parameters.indexOf(node); - const isRest = node.type.kind === 318 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + const isRest = node.type.kind === 319 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; const name = node.name || (isRest ? "rest" : "arg" + index); const dotdotdot = isRest ? factory.createToken(26 /* DotDotDotToken */) : node.dotDotDotToken; return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); @@ -155271,7 +156219,7 @@ function doChange9(changes, sourceFile, position, checker, preferences, compiler })) { return; } - const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 244 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 245 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { members.push(factory.createPropertyDeclaration( @@ -155351,7 +156299,7 @@ function doChange9(changes, sourceFile, position, checker, preferences, compiler function createArrowFunctionExpressionMember(members2, arrowFunction, name) { const arrowFunctionBody = arrowFunction.body; let bodyBlock; - if (arrowFunctionBody.kind === 241 /* Block */) { + if (arrowFunctionBody.kind === 242 /* Block */) { bodyBlock = arrowFunctionBody; } else { bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]); @@ -155890,7 +156838,7 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i switch (func.kind) { case 106 /* NullKeyword */: break; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: case 80 /* Identifier */: if (!inputArgName) { break; @@ -155915,8 +156863,8 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType); } return varDeclOrAssignment; - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: { + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: { const funcBody = func.body; const returnType2 = (_a = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a.getReturnType(); if (isBlock(funcBody)) { @@ -156151,7 +157099,7 @@ function fixImportOfModuleExports(importingFile, exportingFile, program, changes } const importNode = importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, makeImport( importNode.name, /*namedImports*/ @@ -156160,7 +157108,7 @@ function fixImportOfModuleExports(importingFile, exportingFile, program, changes quotePreference )); break; - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (isRequireCall( importNode, /*requireStringLiteralLikeArgument*/ @@ -156229,13 +157177,13 @@ function forEachExportReference(sourceFile, cb) { } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports2, useSitesToUnqualify, quotePreference) { switch (statement.kind) { - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 244 /* ExpressionStatement */: { + case 245 /* ExpressionStatement */: { const { expression } = statement; switch (expression.kind) { - case 213 /* CallExpression */: { + case 214 /* CallExpression */: { if (isRequireCall( expression, /*requireStringLiteralLikeArgument*/ @@ -156252,7 +157200,7 @@ function convertStatement(sourceFile, statement, checker, changes, identifiers, } return false; } - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const { operatorToken } = expression; return operatorToken.kind === 64 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports2, useSitesToUnqualify); } @@ -156307,8 +157255,8 @@ function convertVariableStatement(sourceFile, statement, changes, checker, ident } function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: { + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: { const tmp = makeUniqueName(propertyName, identifiers); return convertedImports([ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), @@ -156356,16 +157304,16 @@ function convertAssignment(sourceFile, checker, assignment, changes, exports2, u function tryChangeModuleExportsObject(object, useSitesToUnqualify) { const statements = mapAllOrFail(object.properties, (prop) => { switch (prop.kind) { - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 304 /* ShorthandPropertyAssignment */: - case 305 /* SpreadAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 306 /* SpreadAssignment */: return void 0; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken(95 /* ExportKeyword */)], prop, useSitesToUnqualify); default: Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`); @@ -156435,16 +157383,16 @@ function convertExportsPropertyAssignment({ left, right, parent: parent2 }, sour function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { const modifiers = [factory.createToken(95 /* ExportKeyword */)]; switch (exported.kind) { - case 218 /* FunctionExpression */: { + case 219 /* FunctionExpression */: { const { name: expressionName } = exported; if (expressionName && expressionName.text !== name) { return exportConst(); } } // falls through - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); default: return exportConst(); @@ -156469,7 +157417,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { replaceNode ); function replaceNode(original) { - if (original.kind === 211 /* PropertyAccessExpression */) { + if (original.kind === 212 /* PropertyAccessExpression */) { const replacement = useSitesToUnqualify.get(original); useSitesToUnqualify.delete(original); return replacement; @@ -156478,7 +157426,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { } function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 206 /* ObjectBindingPattern */: { + case 207 /* ObjectBindingPattern */: { const importSpecifiers = mapAllOrFail(name.elements, (e) => e.dotDotDotToken || e.initializer || e.propertyName && !isIdentifier(e.propertyName) || !isIdentifier(e.name) ? void 0 : makeImportSpecifier2(e.propertyName && e.propertyName.text, e.name.text)); if (importSpecifiers) { return convertedImports([makeImport( @@ -156491,7 +157439,7 @@ function convertSingleImport(name, moduleSpecifier, checker, identifiers, target } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 207 /* ArrayBindingPattern */: { + case 208 /* ArrayBindingPattern */: { const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); return convertedImports([ makeImport( @@ -156577,11 +157525,11 @@ function forEachFreeIdentifier(node, cb) { function isFreeIdentifier(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return parent2.name !== node; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return parent2.propertyName !== node; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return parent2.propertyName !== node; default: return true; @@ -156791,11 +157739,11 @@ registerCodeFix({ const declaration = getDeclaration2(context.sourceFile, context.span.start); if (declaration) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration)); - const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0; + const importDeclarationChanges = declaration.kind === 277 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0; const mainAction = createCodeFixAction( fixId14, changes, - declaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Use_type_0, ((_a = declaration.propertyName) == null ? void 0 : _a.text) ?? declaration.name.text] : Diagnostics.Use_import_type, + declaration.kind === 277 /* ImportSpecifier */ ? [Diagnostics.Use_type_0, ((_a = declaration.propertyName) == null ? void 0 : _a.text) ?? declaration.name.text] : Diagnostics.Use_import_type, fixId14, Diagnostics.Fix_all_with_type_only_imports ); @@ -156814,13 +157762,13 @@ registerCodeFix({ const fixedImportDeclarations = /* @__PURE__ */ new Set(); return codeFixAll(context, errorCodes15, (changes, diag2) => { const errorDeclaration = getDeclaration2(diag2.file, diag2.start); - if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) { + if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 273 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) { doChange11(changes, diag2.file, errorDeclaration); fixedImportDeclarations.add(errorDeclaration); - } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) { + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 277 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) { doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent); fixedImportDeclarations.add(errorDeclaration.parent.parent.parent); - } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */) { + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 277 /* ImportSpecifier */) { doChange11(changes, diag2.file, errorDeclaration); } }); @@ -156871,8 +157819,7 @@ function doChange11(changes, sourceFile, declaration) { true ), factory.createImportClause( - /*isTypeOnly*/ - true, + 156 /* TypeKeyword */, getSynthesizedDeepClone( importClause.name, /*includeTrivia*/ @@ -156899,8 +157846,7 @@ function doChange11(changes, sourceFile, declaration) { true ), factory.createImportClause( - /*isTypeOnly*/ - true, + 156 /* TypeKeyword */, /*name*/ void 0, getSynthesizedDeepClone( @@ -156922,7 +157868,7 @@ function doChange11(changes, sourceFile, declaration) { ) ]); } else { - const newNamedBindings = ((_a = importClause.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */ ? factory.updateNamedImports( + const newNamedBindings = ((_a = importClause.namedBindings) == null ? void 0 : _a.kind) === 276 /* NamedImports */ ? factory.updateNamedImports( importClause.namedBindings, sameMap(importClause.namedBindings.elements, (e) => factory.updateImportSpecifier( e, @@ -156932,13 +157878,7 @@ function doChange11(changes, sourceFile, declaration) { e.name )) ) : importClause.namedBindings; - const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause( - importClause, - /*isTypeOnly*/ - true, - importClause.name, - newNamedBindings - ), declaration.moduleSpecifier, declaration.attributes); + const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause(importClause, 156 /* TypeKeyword */, importClause.name, newNamedBindings), declaration.moduleSpecifier, declaration.attributes); changes.replaceNode(sourceFile, declaration, importDeclaration); } } @@ -157040,10 +157980,10 @@ function createDeclaration(tag) { if (!typeExpression) return; const typeName = (_a = tag.name) == null ? void 0 : _a.getText(); if (!typeName) return; - if (typeExpression.kind === 322 /* JSDocTypeLiteral */) { + if (typeExpression.kind === 323 /* JSDocTypeLiteral */) { return createInterfaceForTypeLiteral(typeName, typeExpression); } - if (typeExpression.kind === 309 /* JSDocTypeExpression */) { + if (typeExpression.kind === 310 /* JSDocTypeExpression */) { return createTypeAliasForTypeExpression(typeName, typeExpression); } } @@ -157460,7 +158400,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre preferences ); let fix; - if (existingFix && importKind !== 2 /* Namespace */) { + if (existingFix && importKind !== 2 /* Namespace */ && existingFix.kind !== 0 /* UseNamespace */ && existingFix.kind !== 1 /* JsdocTypeImport */) { fix = { ...existingFix, addAsTypeOnly, @@ -157534,7 +158474,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre } } function removeExistingImport(declaration) { - if (declaration.kind === 273 /* ImportClause */) { + if (declaration.kind === 274 /* ImportClause */) { Debug.assertIsDefined(declaration.name, "ImportClause should have a name if it's being removed"); } removeExisting.add(declaration); @@ -157675,8 +158615,8 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre const emptyVariableDeclarations = [...variableDeclarationsWithRemovals].filter( (d) => ( // no binding elements being added to the variable declaration - (d.name.kind !== 206 /* ObjectBindingPattern */ || !addToExisting.has(d.name)) && // no binding elements, or all binding elements are being removed - (d.name.kind !== 206 /* ObjectBindingPattern */ || every(d.name.elements, (e) => removeExisting.has(e))) + (d.name.kind !== 207 /* ObjectBindingPattern */ || !addToExisting.has(d.name)) && // no binding elements, or all binding elements are being removed + (d.name.kind !== 207 /* ObjectBindingPattern */ || every(d.name.elements, (e) => removeExisting.has(e))) ) ); const namedBindingsToDelete = [...importDeclarationsWithRemovals].filter( @@ -157687,7 +158627,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre ((_a2 = d.importClause) == null ? void 0 : _a2.namedBindings) && // is not being fully removed emptyImportDeclarations.indexOf(d) === -1 && // is not gaining named imports !((_b2 = addToExisting.get(d.importClause)) == null ? void 0 : _b2.namedImports) && // all named imports are being removed - (d.importClause.namedBindings.kind === 274 /* NamespaceImport */ || every(d.importClause.namedBindings.elements, (e) => removeExisting.has(e))) + (d.importClause.namedBindings.kind === 275 /* NamespaceImport */ || every(d.importClause.namedBindings.elements, (e) => removeExisting.has(e))) ); } ); @@ -157700,7 +158640,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre declaration.importClause, factory.updateImportClause( declaration.importClause, - declaration.importClause.isTypeOnly, + declaration.importClause.phaseModifier, declaration.importClause.name, /*namedBindings*/ void 0 @@ -157710,23 +158650,23 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre for (const declaration of removeExisting) { const importDeclaration = findAncestor(declaration, isImportDeclaration); if (importDeclaration && emptyImportDeclarations.indexOf(importDeclaration) === -1 && namedBindingsToDelete.indexOf(importDeclaration) === -1) { - if (declaration.kind === 273 /* ImportClause */) { + if (declaration.kind === 274 /* ImportClause */) { changeTracker.delete(sourceFile, declaration.name); } else { - Debug.assert(declaration.kind === 276 /* ImportSpecifier */, "NamespaceImport should have been handled earlier"); + Debug.assert(declaration.kind === 277 /* ImportSpecifier */, "NamespaceImport should have been handled earlier"); if ((_a = addToExisting.get(importDeclaration.importClause)) == null ? void 0 : _a.namedImports) { (importSpecifiersToRemoveWhileAdding ?? (importSpecifiersToRemoveWhileAdding = /* @__PURE__ */ new Set())).add(declaration); } else { changeTracker.delete(sourceFile, declaration); } } - } else if (declaration.kind === 208 /* BindingElement */) { + } else if (declaration.kind === 209 /* BindingElement */) { if ((_b = addToExisting.get(declaration.parent)) == null ? void 0 : _b.namedImports) { (importSpecifiersToRemoveWhileAdding ?? (importSpecifiersToRemoveWhileAdding = /* @__PURE__ */ new Set())).add(declaration); } else { changeTracker.delete(sourceFile, declaration); } - } else if (declaration.kind === 271 /* ImportEqualsDeclaration */) { + } else if (declaration.kind === 272 /* ImportEqualsDeclaration */) { changeTracker.delete(sourceFile, declaration); } } @@ -157774,7 +158714,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre const importDeclarations = new Set(mapDefined([...verbatimImports], (d) => findAncestor(d, isImportDeclaration))); const requireStatements = new Set(mapDefined([...verbatimImports], (d) => findAncestor(d, isRequireVariableStatement))); return [ - ...mapDefined([...verbatimImports], (d) => d.kind === 271 /* ImportEqualsDeclaration */ ? getSynthesizedDeepClone( + ...mapDefined([...verbatimImports], (d) => d.kind === 272 /* ImportEqualsDeclaration */ ? getSynthesizedDeepClone( d, /*includeTrivia*/ true @@ -157794,7 +158734,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre d.modifiers, d.importClause && factory.updateImportClause( d.importClause, - d.importClause.isTypeOnly, + d.importClause.phaseModifier, verbatimImports.has(d.importClause) ? d.importClause.name : void 0, verbatimImports.has(d.importClause.namedBindings) ? d.importClause.namedBindings : ((_a = tryCast(d.importClause.namedBindings, isNamedImports)) == null ? void 0 : _a.elements.some((e) => verbatimImports.has(e))) ? factory.updateNamedImports( d.importClause.namedBindings, @@ -157828,7 +158768,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre } return factory.updateVariableDeclaration( d, - d.name.kind === 206 /* ObjectBindingPattern */ ? factory.updateObjectBindingPattern( + d.name.kind === 207 /* ObjectBindingPattern */ ? factory.updateObjectBindingPattern( d.name, d.name.elements.filter((e) => verbatimImports.has(e)) ) : d.name, @@ -157923,7 +158863,7 @@ function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSym const getChecker = createGetChecker(program, host); const isFileExcluded = preferences.autoImportFileExcludePatterns && getIsFileExcluded(host, preferences); const mergedModuleSymbol = program.getTypeChecker().getMergedSymbol(moduleSymbol); - const moduleSourceFile = isFileExcluded && mergedModuleSymbol.declarations && getDeclarationOfKind(mergedModuleSymbol, 307 /* SourceFile */); + const moduleSourceFile = isFileExcluded && mergedModuleSymbol.declarations && getDeclarationOfKind(mergedModuleSymbol, 308 /* SourceFile */); const moduleSymbolExcluded = moduleSourceFile && isFileExcluded(moduleSourceFile); return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => { const checker = getChecker(info[0].isFromPackageJson); @@ -158001,12 +158941,12 @@ function tryUseExistingNamespaceImport(existingImports, position) { function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return (_a = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a.text; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return declaration.name.text; - case 351 /* JSDocImportTag */: - case 272 /* ImportDeclaration */: + case 352 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text; default: return Debug.assertNever(declaration); @@ -158034,11 +158974,11 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker } return best; function getAddToExistingImportFix({ declaration, importKind, symbol, targetFlags }) { - if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 271 /* ImportEqualsDeclaration */) { + if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 272 /* ImportEqualsDeclaration */) { return void 0; } - if (declaration.kind === 260 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 206 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifierKind: void 0, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; + if (declaration.kind === 261 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 207 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifierKind: void 0, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; } const { importClause } = declaration; if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier)) { @@ -158061,7 +159001,7 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker addAsTypeOnly === 2 /* Required */ && namedBindings)) { return void 0; } - if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 274 /* NamespaceImport */) { + if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 275 /* NamespaceImport */) { return void 0; } return { @@ -158084,7 +159024,7 @@ function createExistingImportMap(importingFile, program) { if (moduleSymbol) { (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent); } - } else if (i.kind === 272 /* ImportDeclaration */ || i.kind === 271 /* ImportEqualsDeclaration */ || i.kind === 351 /* JSDocImportTag */) { + } else if (i.kind === 273 /* ImportDeclaration */ || i.kind === 272 /* ImportEqualsDeclaration */ || i.kind === 352 /* JSDocImportTag */) { const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); if (moduleSymbol) { (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i); @@ -158385,6 +159325,7 @@ function getUmdImportKind(importingFile, program, forceImportKeyword) { return 2 /* Namespace */; case 100 /* Node16 */: case 101 /* Node18 */: + case 102 /* Node20 */: case 199 /* NodeNext */: return getImpliedNodeFormatForEmit(importingFile, program) === 99 /* ESNext */ ? 2 /* Namespace */ : 3 /* CommonJS */; default: @@ -158556,7 +159497,7 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy case 4 /* PromoteTypeOnly */: { const { typeOnlyAliasDeclaration } = fix; const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, program, sourceFile, preferences); - return promotedDeclaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; + return promotedDeclaration.kind === 277 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; } default: return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`); @@ -158564,13 +159505,13 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy } function getModuleSpecifierText(promotedDeclaration) { var _a, _b; - return promotedDeclaration.kind === 271 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; + return promotedDeclaration.kind === 272 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, preferences) { const compilerOptions = program.getCompilerOptions(); const convertExistingToTypeOnly = compilerOptions.verbatimModuleSyntax; switch (aliasDeclaration.kind) { - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { if (aliasDeclaration.parent.elements.length > 1) { const newSpecifier = factory.updateImportSpecifier( @@ -158595,13 +159536,13 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre promoteImportClause(aliasDeclaration.parent.parent); return aliasDeclaration.parent.parent; } - case 273 /* ImportClause */: + case 274 /* ImportClause */: promoteImportClause(aliasDeclaration); return aliasDeclaration; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: promoteImportClause(aliasDeclaration.parent); return aliasDeclaration.parent; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1)); return aliasDeclaration; default: @@ -158622,7 +159563,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre const namedImports = tryCast(importClause.namedBindings, isNamedImports); if (namedImports && namedImports.elements.length > 1) { const sortState = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(importClause.parent, preferences, sourceFile); - if (sortState.isSorted !== false && aliasDeclaration.kind === 276 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + if (sortState.isSorted !== false && aliasDeclaration.kind === 277 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { changes.delete(sourceFile, aliasDeclaration); changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); } @@ -158637,7 +159578,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, removeExistingImportSpecifiers, preferences) { var _a; - if (clause.kind === 206 /* ObjectBindingPattern */) { + if (clause.kind === 207 /* ObjectBindingPattern */) { if (removeExistingImportSpecifiers && clause.elements.some((e) => removeExistingImportSpecifiers.has(e))) { changes.replaceNode( sourceFile, @@ -158797,7 +159738,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp /*modifiers*/ void 0, factory.createImportClause( - shouldUseTypeOnly(namespaceLikeImport, preferences), + shouldUseTypeOnly(namespaceLikeImport, preferences) ? 156 /* TypeKeyword */ : void 0, /*name*/ void 0, factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name)) @@ -159107,13 +160048,13 @@ function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) { } function isClassElementLikeHasJSDoc(node) { switch (node.kind) { - case 176 /* Constructor */: - case 172 /* PropertyDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 173 /* PropertyDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return true; - case 169 /* Parameter */: + case 170 /* Parameter */: return isParameterPropertyDeclaration(node, node.parent); default: return false; @@ -159392,7 +160333,7 @@ registerCodeFix({ }); function getNamedTupleMember(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); - return findAncestor(token, (t) => t.kind === 202 /* NamedTupleMember */); + return findAncestor(token, (t) => t.kind === 203 /* NamedTupleMember */); } function doChange17(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -159401,10 +160342,10 @@ function doChange17(changes, sourceFile, namedTupleMember) { let unwrappedType = namedTupleMember.type; let sawOptional = false; let sawRest = false; - while (unwrappedType.kind === 190 /* OptionalType */ || unwrappedType.kind === 191 /* RestType */ || unwrappedType.kind === 196 /* ParenthesizedType */) { - if (unwrappedType.kind === 190 /* OptionalType */) { + while (unwrappedType.kind === 191 /* OptionalType */ || unwrappedType.kind === 192 /* RestType */ || unwrappedType.kind === 197 /* ParenthesizedType */) { + if (unwrappedType.kind === 191 /* OptionalType */) { sawOptional = true; - } else if (unwrappedType.kind === 191 /* RestType */) { + } else if (unwrappedType.kind === 192 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -159729,19 +160670,19 @@ function getInfo9(checker, sourceFile, position, errorCode) { } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 260 /* VariableDeclaration */: - case 169 /* Parameter */: - case 208 /* BindingElement */: - case 172 /* PropertyDeclaration */: - case 303 /* PropertyAssignment */: + case 261 /* VariableDeclaration */: + case 170 /* Parameter */: + case 209 /* BindingElement */: + case 173 /* PropertyDeclaration */: + case 304 /* PropertyAssignment */: return declaration.initializer; - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0); - case 304 /* ShorthandPropertyAssignment */: - case 171 /* PropertySignature */: - case 306 /* EnumMember */: - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: + case 305 /* ShorthandPropertyAssignment */: + case 172 /* PropertySignature */: + case 307 /* EnumMember */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: return void 0; } } @@ -160000,7 +160941,7 @@ function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclar function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) { const tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 231 /* ClassExpression */) { + if (classDeclaration.kind === 232 /* ClassExpression */) { return; } const className = classDeclaration.name.getText(); @@ -160053,7 +160994,7 @@ function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDecla } function getTypeNode2(checker, node, token) { let typeNode; - if (token.parent.parent.kind === 226 /* BinaryExpression */) { + if (token.parent.parent.kind === 227 /* BinaryExpression */) { const binaryExpression = token.parent.parent; const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -160141,7 +161082,7 @@ function getActionsForMissingMethodDeclaration(context, info) { } function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) { const importAdder = createImportAdder(sourceFile, context.program, context.preferences, context.host); - const kind = isClassLike(parentDeclaration) ? 174 /* MethodDeclaration */ : 173 /* MethodSignature */; + const kind = isClassLike(parentDeclaration) ? 175 /* MethodDeclaration */ : 174 /* MethodSignature */; const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration); const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression); if (containingMethodDeclaration) { @@ -160168,8 +161109,8 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration } function addFunctionDeclaration(changes, context, info) { const quotePreference = getQuotePreference(context.sourceFile, context.preferences); const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); - const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(262 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( - 262 /* FunctionDeclaration */, + const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(263 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( + 263 /* FunctionDeclaration */, context, quotePreference, info.signature, @@ -160317,7 +161258,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ const signature = checker.getSignaturesOfType(type, 0 /* Call */); if (signature === void 0) return createUndefined(); const func = createSignatureDeclarationFromSignature( - 218 /* FunctionExpression */, + 219 /* FunctionExpression */, context, quotePreference, signature[0], @@ -160411,6 +161352,20 @@ function findScope(node) { } return getSourceFileOfNode(node); } +function getAllSupers(decl, checker) { + const res = []; + while (decl) { + const superElement = getClassExtendsHeritageElement(decl); + const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); + if (!superSymbol) break; + const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol; + const superDecl = symbol.declarations && find(symbol.declarations, isClassLike); + if (!superDecl) break; + res.push(superDecl); + decl = superDecl; + } + return res; +} // src/services/codefixes/fixAddMissingNewOperator.ts var fixId25 = "addMissingNewOperator"; @@ -160597,10 +161552,10 @@ function doChange19(changes, program, preferences, host, declarations, newParame } function isConvertibleSignatureDeclaration(node) { switch (node.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 220 /* ArrowFunction */: return true; default: return false; @@ -160942,9 +161897,9 @@ function getSuggestion(messageText) { // src/services/codefixes/fixModuleAndTargetOptions.ts registerCodeFix({ errorCodes: [ - Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code + Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code ], getCodeActions: function getCodeActionsToFixModuleAndTarget(context) { const compilerOptions = context.program.getCompilerOptions(); @@ -161224,7 +162179,7 @@ registerCodeFix({ getCodeActions: (context) => { const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start); if (!importDeclaration) return; - const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 276 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program)); + const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 277 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program)); const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program)); let actions2; if (namespaceChanges.length) { @@ -161239,17 +162194,17 @@ registerCodeFix({ }); function getImportDeclaration(sourceFile, program, start) { const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier); - if (!identifier || identifier.parent.kind !== 183 /* TypeReference */) return; + if (!identifier || identifier.parent.kind !== 184 /* TypeReference */) return; const checker = program.getTypeChecker(); const symbol = checker.getSymbolAtLocation(identifier); return find((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration)); } function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) { - if (importDeclaration.kind === 271 /* ImportEqualsDeclaration */) { + if (importDeclaration.kind === 272 /* ImportEqualsDeclaration */) { changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, importDeclaration.name); return; } - const importClause = importDeclaration.kind === 273 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; + const importClause = importDeclaration.kind === 274 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; if (importClause.name && importClause.namedBindings) { return; } @@ -161451,7 +162406,7 @@ function deleteTypeParameters(changes, sourceFile, token) { changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist")); } function isImport(token) { - return token.kind === 102 /* ImportKeyword */ || token.kind === 80 /* Identifier */ && (token.parent.kind === 276 /* ImportSpecifier */ || token.parent.kind === 273 /* ImportClause */); + return token.kind === 102 /* ImportKeyword */ || token.kind === 80 /* Identifier */ && (token.parent.kind === 277 /* ImportSpecifier */ || token.parent.kind === 274 /* ImportClause */); } function tryGetFullImport(token) { return token.kind === 102 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0; @@ -161460,7 +162415,7 @@ function canDeleteEntireVariableStatement(sourceFile, token) { return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 243 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 244 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { forEach(node.elements, (n) => changes.delete(sourceFile, n)); @@ -161501,14 +162456,14 @@ function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { } function canPrefix(token) { switch (token.parent.kind) { - case 169 /* Parameter */: - case 168 /* TypeParameter */: + case 170 /* Parameter */: + case 169 /* TypeParameter */: return true; - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { const varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: return true; } } @@ -161556,8 +162511,8 @@ function isNotProvidedArguments(parameter, checker, sourceFiles) { function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) { const { parent: parent2 } = parameter; switch (parent2.kind) { - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: const index = parent2.parameters.indexOf(parameter); const referent = isMethodDeclaration(parent2) ? parent2.name : parent2; const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken); @@ -161574,18 +162529,18 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program } } return true; - case 262 /* FunctionDeclaration */: { + case 263 /* FunctionDeclaration */: { if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) { return isLastParameter(parent2, parameter, isFixAll); } return true; } - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return isLastParameter(parent2, parameter, isFixAll); - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return false; - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return true; default: return Debug.failBadSyntaxKind(parent2); @@ -161642,7 +162597,7 @@ function doChange27(changes, sourceFile, start, length2, errorCode) { const container = (isBlock(statement.parent) ? statement.parent : statement).parent; if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) { switch (container.kind) { - case 245 /* IfStatement */: + case 246 /* IfStatement */: if (container.elseStatement) { if (isBlock(statement.parent)) { break; @@ -161652,8 +162607,8 @@ function doChange27(changes, sourceFile, start, length2, errorCode) { return; } // falls through - case 247 /* WhileStatement */: - case 248 /* ForStatement */: + case 248 /* WhileStatement */: + case 249 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -161719,7 +162674,7 @@ registerCodeFix({ const { typeNode, type } = info; const original = typeNode.getText(sourceFile); const actions2 = [fix(type, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 314 /* JSDocNullableType */) { + if (typeNode.kind === 315 /* JSDocNullableType */) { actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); } return actions2; @@ -161736,7 +162691,7 @@ registerCodeFix({ const info = getInfo15(err.file, err.start, checker); if (!info) return; const { typeNode, type } = info; - const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId56 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + const fixedType = typeNode.kind === 315 /* JSDocNullableType */ && fixId56 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange29(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -161757,22 +162712,22 @@ function getInfo15(sourceFile, pos, checker) { } function isTypeContainer(node) { switch (node.kind) { - case 234 /* AsExpression */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 262 /* FunctionDeclaration */: - case 177 /* GetAccessor */: - case 181 /* IndexSignature */: - case 200 /* MappedType */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 178 /* SetAccessor */: - case 265 /* TypeAliasDeclaration */: - case 216 /* TypeAssertionExpression */: - case 260 /* VariableDeclaration */: + case 235 /* AsExpression */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 263 /* FunctionDeclaration */: + case 178 /* GetAccessor */: + case 182 /* IndexSignature */: + case 201 /* MappedType */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 179 /* SetAccessor */: + case 266 /* TypeAliasDeclaration */: + case 217 /* TypeAssertionExpression */: + case 261 /* VariableDeclaration */: return true; default: return false; @@ -161858,18 +162813,18 @@ var errorCodes48 = [ Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code ]; var canHaveTypeAnnotation = /* @__PURE__ */ new Set([ - 177 /* GetAccessor */, - 174 /* MethodDeclaration */, - 172 /* PropertyDeclaration */, - 262 /* FunctionDeclaration */, - 218 /* FunctionExpression */, - 219 /* ArrowFunction */, - 260 /* VariableDeclaration */, - 169 /* Parameter */, - 277 /* ExportAssignment */, - 263 /* ClassDeclaration */, - 206 /* ObjectBindingPattern */, - 207 /* ArrayBindingPattern */ + 178 /* GetAccessor */, + 175 /* MethodDeclaration */, + 173 /* PropertyDeclaration */, + 263 /* FunctionDeclaration */, + 219 /* FunctionExpression */, + 220 /* ArrowFunction */, + 261 /* VariableDeclaration */, + 170 /* Parameter */, + 278 /* ExportAssignment */, + 264 /* ClassDeclaration */, + 207 /* ObjectBindingPattern */, + 208 /* ArrayBindingPattern */ ]); var declarationEmitNodeBuilderFlags2 = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; var declarationEmitInternalNodeBuilderFlags2 = 1 /* WriteComputedProps */; @@ -162151,22 +163106,22 @@ function withContext(context, typePrintMode, cb) { if (fixedNodes == null ? void 0 : fixedNodes.has(node)) return void 0; fixedNodes == null ? void 0 : fixedNodes.add(node); switch (node.kind) { - case 169 /* Parameter */: - case 172 /* PropertyDeclaration */: - case 260 /* VariableDeclaration */: + case 170 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: return addTypeToVariableLike(node); - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: return addTypeToSignatureDeclaration(node, sourceFile); - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: return transformExportAssignment(node); - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return transformExtendsClauseWithExpression(node); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return transformDestructuringPatterns(node); default: throw new Error(`Cannot find a fix for the given node ${node.kind}`); @@ -162769,14 +163724,14 @@ function getNodes3(sourceFile, start) { } let insertBefore; switch (containingFunction.kind) { - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: insertBefore = findChildOfKind(containingFunction, 100 /* FunctionKeyword */, sourceFile); break; - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: const kind = containingFunction.typeParameters ? 30 /* LessThanToken */ : 21 /* OpenParenToken */; insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters); break; @@ -162831,14 +163786,20 @@ function doChange32(file, start, length2, code, context) { } else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) { const checker = context.program.getTypeChecker(); const node = getTokenAtPosition(file, start).parent; + if (isComputedPropertyName(node)) { + return; + } Debug.assert(isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor"); const containingClass = node.parent; Debug.assert(isClassLike(containingClass), "erroneous accessors should only be inside classes"); - const base = singleOrUndefined(getAllSupers(containingClass, checker)); - if (!base) return []; - const name = unescapeLeadingUnderscores(getTextOfPropertyName(node.name)); - const baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name); - if (!baseProp || !baseProp.valueDeclaration) return []; + const baseTypeNode = getEffectiveBaseTypeNode(containingClass); + if (!baseTypeNode) return; + const expression = skipParentheses(baseTypeNode.expression); + const base = isClassExpression(expression) ? expression.symbol : checker.getSymbolAtLocation(expression); + if (!base) return; + const baseType = checker.getDeclaredTypeOfSymbol(base); + const baseProp = checker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(node.name))); + if (!baseProp || !baseProp.valueDeclaration) return; startPosition = baseProp.valueDeclaration.pos; endPosition = baseProp.valueDeclaration.end; file = getSourceFileOfNode(baseProp.valueDeclaration); @@ -163109,7 +164070,7 @@ function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclar function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { const typeNode = getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (isInJSFile(sourceFile) && declaration.kind !== 171 /* PropertySignature */) { + if (isInJSFile(sourceFile) && declaration.kind !== 172 /* PropertySignature */) { const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration; if (!parent2) { return; @@ -163220,17 +164181,17 @@ function inferTypeForParametersFromUsage(func, sourceFile, program, cancellation function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { let searchToken; switch (containingFunction.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: searchToken = findChildOfKind(containingFunction, 137 /* ConstructorKeyword */, sourceFile); break; - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: const parent2 = containingFunction.parent; searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name; break; - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: searchToken = containingFunction.name; break; } @@ -163366,44 +164327,44 @@ function inferTypeFromReferences(program, references, cancellationToken) { node = node.parent; } switch (node.parent.kind) { - case 244 /* ExpressionStatement */: + case 245 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 225 /* PostfixUnaryExpression */: + case 226 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } else { inferTypeFromContextualType(node, usage); } break; - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 212 /* ElementAccessExpression */: + case 213 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 260 /* VariableDeclaration */: { + case 261 /* VariableDeclaration */: { const { name, initializer } = node.parent; if (node === name) { if (initializer) { @@ -163519,7 +164480,7 @@ function inferTypeFromReferences(program, references, cancellationToken) { // LogicalOperator Or NullishCoalescing case 57 /* BarBarToken */: case 61 /* QuestionQuestionToken */: - if (node === parent2.left && (node.parent.parent.kind === 260 /* VariableDeclaration */ || isAssignmentExpression( + if (node === parent2.left && (node.parent.parent.kind === 261 /* VariableDeclaration */ || isAssignmentExpression( node.parent.parent, /*excludeCompoundAssignment*/ true @@ -163547,7 +164508,7 @@ function inferTypeFromReferences(program, references, cancellationToken) { } } calculateUsageOfNode(parent2, call.return_); - if (parent2.kind === 213 /* CallExpression */) { + if (parent2.kind === 214 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { (usage.constructs || (usage.constructs = [])).push(call); @@ -164008,7 +164969,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con const declaration = firstOrUndefined(declarations); const checker = context.program.getTypeChecker(); const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */; + const kind = (declaration == null ? void 0 : declaration.kind) ?? 172 /* PropertySignature */; const declarationName = createDeclarationName(symbol, declaration); const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */; let modifierFlags = effectiveModifierFlags & 256 /* Static */; @@ -164023,8 +164984,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con const quotePreference = getQuotePreference(sourceFile, preferences); const flags = 1 /* NoTruncation */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); switch (kind) { - case 171 /* PropertySignature */: - case 172 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 173 /* PropertyDeclaration */: let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, 8 /* AllowUnresolvedNames */, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); @@ -164042,8 +165003,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con void 0 )); break; - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: { + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: { Debug.assertIsDefined(declarations); let typeNode2 = checker.typeToTypeNode( type, @@ -164092,8 +165053,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con } break; } - case 173 /* MethodSignature */: - case 174 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 175 /* MethodDeclaration */: Debug.assertIsDefined(declarations); const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures(); if (!some(signatures)) { @@ -164123,7 +165084,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con break; } function outputMethod(quotePreference2, signature, modifiers2, name, body2) { - const method = createSignatureDeclarationFromSignature(174 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); + const method = createSignatureDeclarationFromSignature(175 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); if (method) addClassElement(method); } function createModifiers() { @@ -164308,7 +165269,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder tracker ); switch (kind) { - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: return factory.createMethodDeclaration( modifiers, asteriskToken, @@ -164320,7 +165281,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder type, createStubbedMethodBody(quotePreference) ); - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: return factory.createMethodSignature( modifiers, name, @@ -164330,7 +165291,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder parameters, type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type ); - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name"); return factory.createFunctionDeclaration( modifiers, @@ -164390,10 +165351,14 @@ function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) { return getSynthesizedDeepClone(typeNode); } function endOfRequiredTypeParameters(checker, type) { + var _a; Debug.assert(type.typeArguments); const fullTypeArguments = type.typeArguments; const target = type.target; for (let cutoff = 0; cutoff < fullTypeArguments.length; cutoff++) { + if (((_a = target.localTypeParameters) == null ? void 0 : _a[cutoff].constraint) === void 0) { + continue; + } const typeArguments = fullTypeArguments.slice(0, cutoff); const filledIn = checker.fillMissingTypeArguments( typeArguments, @@ -164789,7 +165754,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start, end, con isStatic: hasStaticModifier(declaration), isReadonly: hasEffectiveReadonlyModifier(declaration), type: getDeclarationType(declaration, program), - container: declaration.kind === 169 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 170 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration, fieldName, @@ -164901,20 +165866,6 @@ function getDeclarationType(declaration, program) { } return typeNode; } -function getAllSupers(decl, checker) { - const res = []; - while (decl) { - const superElement = getClassExtendsHeritageElement(decl); - const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); - if (!superSymbol) break; - const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol; - const superDecl = symbol.declarations && find(symbol.declarations, isClassLike); - if (!superDecl) break; - res.push(superDecl); - decl = superDecl; - } - return res; -} // src/services/codefixes/fixInvalidImportSyntax.ts var fixName5 = "invalidImportSyntax"; @@ -164960,7 +165911,7 @@ registerCodeFix({ }); function getActionsForUsageOfInvalidImport(context) { const sourceFile = context.sourceFile; - const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 213 /* CallExpression */ : 214 /* NewExpression */; + const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 214 /* CallExpression */ : 215 /* NewExpression */; const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind); if (!node) { return []; @@ -165189,8 +166140,8 @@ function doChange35(changes, sourceFile, info) { /*modifiers*/ void 0, factory.createImportClause( - /*isTypeOnly*/ - false, + /*phaseModifier*/ + void 0, defaultImportName, namedImports ), @@ -165326,7 +166277,7 @@ registerCodeFix({ function getImportTypeNode(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); Debug.assert(token.kind === 102 /* ImportKeyword */, "This token should be an ImportKeyword"); - Debug.assert(token.parent.kind === 205 /* ImportType */, "Token parent should be an ImportType"); + Debug.assert(token.parent.kind === 206 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange37(changes, sourceFile, importType) { @@ -165567,7 +166518,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) { importDeclaration.modifiers, factory.updateImportClause( importClause, - importClause.isTypeOnly, + importClause.phaseModifier, importClause.name, /*namedBindings*/ void 0 @@ -165584,7 +166535,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) { void 0, factory.updateImportClause( importClause, - importClause.isTypeOnly, + importClause.phaseModifier, /*name*/ void 0, importClause.namedBindings @@ -166597,14 +167548,14 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, } function typeNodeToExpression(typeNode, languageVersion, quotePreference) { switch (typeNode.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: const typeName = typeNode.typeName; return entityNameToExpression(typeName, languageVersion, quotePreference); - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: const objectExpression = typeNodeToExpression(typeNode.objectType, languageVersion, quotePreference); const indexExpression = typeNodeToExpression(typeNode.indexType, languageVersion, quotePreference); return objectExpression && indexExpression && factory.createElementAccessExpression(objectExpression, indexExpression); - case 201 /* LiteralType */: + case 202 /* LiteralType */: const literal = typeNode.literal; switch (literal.kind) { case 11 /* StringLiteral */: @@ -166613,12 +167564,12 @@ function typeNodeToExpression(typeNode, languageVersion, quotePreference) { return factory.createNumericLiteral(literal.text, literal.numericLiteralFlags); } return void 0; - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: const exp = typeNodeToExpression(typeNode.type, languageVersion, quotePreference); return exp && (isIdentifier(exp) ? exp : factory.createParenthesizedExpression(exp)); - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: return entityNameToExpression(typeNode.exprName, languageVersion, quotePreference); - case 205 /* ImportType */: + case 206 /* ImportType */: Debug.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`); } return void 0; @@ -166653,12 +167604,12 @@ function isMemberCompletionKind(kind) { function getJsxClosingTagCompletion(location, sourceFile) { const jsxClosingElement = findAncestor(location, (node) => { switch (node.kind) { - case 287 /* JsxClosingElement */: + case 288 /* JsxClosingElement */: return true; - case 44 /* SlashToken */: + case 31 /* LessThanSlashToken */: case 32 /* GreaterThanToken */: case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: return false; default: return "quit"; @@ -166846,14 +167797,14 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, const languageVersion = getEmitScriptTarget(host.getCompilationSettings()); if (!isIdentifierText(name, languageVersion)) { insertText = quotePropertyName(sourceFile, preferences, name); - if (parentNamedImportOrExport.kind === 275 /* NamedImports */) { + if (parentNamedImportOrExport.kind === 276 /* NamedImports */) { scanner.setText(sourceFile.text); scanner.resetTokenState(position); if (!(scanner.scan() === 130 /* AsKeyword */ && scanner.scan() === 80 /* Identifier */)) { insertText += " as " + generateIdentifierForArbitraryString(name, languageVersion); } } - } else if (parentNamedImportOrExport.kind === 275 /* NamedImports */) { + } else if (parentNamedImportOrExport.kind === 276 /* NamedImports */) { const possibleToken = stringToToken(name); if (possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) { insertText = `${name} as ${name}_`; @@ -167125,10 +168076,10 @@ function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, pro const quotePreference = getQuotePreference(sourceFile, preferences); const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); switch (declaration.kind) { - case 171 /* PropertySignature */: - case 172 /* PropertyDeclaration */: - case 173 /* MethodSignature */: - case 174 /* MethodDeclaration */: { + case 172 /* PropertySignature */: + case 173 /* PropertyDeclaration */: + case 174 /* MethodSignature */: + case 175 /* MethodDeclaration */: { let effectiveType = type.flags & 1048576 /* Union */ && type.types.length < 10 ? checker.getUnionType(type.types, 2 /* Subtype */) : type; if (effectiveType.flags & 1048576 /* Union */) { const functionTypes = filter(effectiveType.types, (type2) => checker.getSignaturesOfType(type2, 0 /* Call */).length > 0); @@ -167479,43 +168430,46 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con function shouldIncludeSymbol(symbol, symbolToSortTextMap2) { var _a; let allFlags = symbol.flags; - if (!isSourceFile(location)) { - if (isExportAssignment(location.parent)) { - return true; + if (location.parent && isExportAssignment(location.parent)) { + return true; + } + if (closestSymbolDeclaration && tryCast(closestSymbolDeclaration, isVariableDeclaration)) { + if (symbol.valueDeclaration === closestSymbolDeclaration) { + return false; } - if (tryCast(closestSymbolDeclaration, isVariableDeclaration) && symbol.valueDeclaration === closestSymbolDeclaration) { + if (isBindingPattern(closestSymbolDeclaration.name) && closestSymbolDeclaration.name.elements.some((e) => e === symbol.valueDeclaration)) { return false; } - const symbolDeclaration = symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); - if (closestSymbolDeclaration && symbolDeclaration) { - if (isParameter(closestSymbolDeclaration) && isParameter(symbolDeclaration)) { - const parameters = closestSymbolDeclaration.parent.parameters; - if (symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < parameters.end) { - return false; - } - } else if (isTypeParameterDeclaration(closestSymbolDeclaration) && isTypeParameterDeclaration(symbolDeclaration)) { - if (closestSymbolDeclaration === symbolDeclaration && (contextToken == null ? void 0 : contextToken.kind) === 96 /* ExtendsKeyword */) { + } + const symbolDeclaration = symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]); + if (closestSymbolDeclaration && symbolDeclaration) { + if (isParameter(closestSymbolDeclaration) && isParameter(symbolDeclaration)) { + const parameters = closestSymbolDeclaration.parent.parameters; + if (symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < parameters.end) { + return false; + } + } else if (isTypeParameterDeclaration(closestSymbolDeclaration) && isTypeParameterDeclaration(symbolDeclaration)) { + if (closestSymbolDeclaration === symbolDeclaration && (contextToken == null ? void 0 : contextToken.kind) === 96 /* ExtendsKeyword */) { + return false; + } + if (isInTypeParameterDefault(contextToken) && !isInferTypeNode(closestSymbolDeclaration.parent)) { + const typeParameters = closestSymbolDeclaration.parent.typeParameters; + if (typeParameters && symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < typeParameters.end) { return false; } - if (isInTypeParameterDefault(contextToken) && !isInferTypeNode(closestSymbolDeclaration.parent)) { - const typeParameters = closestSymbolDeclaration.parent.typeParameters; - if (typeParameters && symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < typeParameters.end) { - return false; - } - } } } - const symbolOrigin = skipAlias(symbol, typeChecker); - if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[getSymbolId(symbol)] === SortText.GlobalsOrKeywords && (symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions || symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.LocationPriority)) { - return false; - } - allFlags |= getCombinedLocalAndExportSymbolFlags(symbolOrigin); - if (isInRightSideOfInternalImportEqualsDeclaration(location)) { - return !!(allFlags & 1920 /* Namespace */); - } - if (isTypeOnlyLocation) { - return symbolCanBeReferencedAtTypeLocation(symbol, typeChecker); - } + } + const symbolOrigin = skipAlias(symbol, typeChecker); + if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[getSymbolId(symbol)] === SortText.GlobalsOrKeywords && (symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions || symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.LocationPriority)) { + return false; + } + allFlags |= getCombinedLocalAndExportSymbolFlags(symbolOrigin); + if (isInRightSideOfInternalImportEqualsDeclaration(location)) { + return !!(allFlags & 1920 /* Namespace */); + } + if (isTypeOnlyLocation) { + return symbolCanBeReferencedAtTypeLocation(symbol, typeChecker); } return !!(allFlags & 111551 /* Value */); } @@ -167817,12 +168771,12 @@ function getContextualType(previousToken, position, sourceFile, checker) { return getContextualTypeFromParent(previousToken, checker); case 64 /* EqualsToken */: switch (parent2.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return checker.getContextualType(parent2.initializer); // TODO: GH#18217 - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return checker.getTypeAtLocation(parent2.left); - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent2); default: return void 0; @@ -167856,7 +168810,7 @@ function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { } function isModuleSymbol(symbol) { var _a; - return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 307 /* SourceFile */)); + return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 308 /* SourceFile */)); } function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) { const typeChecker = program.getTypeChecker(); @@ -167892,7 +168846,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const typeExpression = tryGetTypeExpressionFromTag(tag); if (typeExpression) { currentToken = getTokenAtPosition(sourceFile, position); - if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 348 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { + if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 349 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression); } } @@ -167952,7 +168906,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, isRightOfDot = contextToken.kind === 25 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 29 /* QuestionDotToken */; switch (parent2.kind) { - case 211 /* PropertyAccessExpression */: + case 212 /* PropertyAccessExpression */: propertyAccessToConvert = parent2; node = propertyAccessToConvert.expression; const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert); @@ -167960,16 +168914,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return void 0; } break; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: node = parent2.left; break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: node = parent2.name; break; - case 205 /* ImportType */: + case 206 /* ImportType */: node = parent2; break; - case 236 /* MetaProperty */: + case 237 /* MetaProperty */: node = parent2.getFirstToken(sourceFile); Debug.assert(node.kind === 102 /* ImportKeyword */ || node.kind === 105 /* NewKeyword */); break; @@ -167977,52 +168931,52 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return void 0; } } else if (!importStatementCompletion) { - if (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) { + if (parent2 && parent2.kind === 212 /* PropertyAccessExpression */) { contextToken = parent2; parent2 = parent2.parent; } if (currentToken.parent === location) { switch (currentToken.kind) { case 32 /* GreaterThanToken */: - if (currentToken.parent.kind === 284 /* JsxElement */ || currentToken.parent.kind === 286 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 285 /* JsxElement */ || currentToken.parent.kind === 287 /* JsxOpeningElement */) { location = currentToken; } break; - case 44 /* SlashToken */: - if (currentToken.parent.kind === 285 /* JsxSelfClosingElement */) { + case 31 /* LessThanSlashToken */: + if (currentToken.parent.kind === 286 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent2.kind) { - case 287 /* JsxClosingElement */: - if (contextToken.kind === 44 /* SlashToken */) { + case 288 /* JsxClosingElement */: + if (contextToken.kind === 31 /* LessThanSlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent2)) { break; } // falls through - case 285 /* JsxSelfClosingElement */: - case 284 /* JsxElement */: - case 286 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: + case 285 /* JsxElement */: + case 287 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 30 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 294 /* JsxExpression */: - case 293 /* JsxSpreadAttribute */: - if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 291 /* JsxAttribute */) { + case 295 /* JsxExpression */: + case 294 /* JsxSpreadAttribute */: + if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 292 /* JsxAttribute */) { isJsxIdentifierExpected = true; } break; - case 291 /* JsxAttribute */: + case 292 /* JsxAttribute */: if (parent2.initializer === previousToken && previousToken.end < position) { isJsxIdentifierExpected = true; break; @@ -168110,15 +169064,15 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: - case 342 /* JSDocReturnTag */: - case 344 /* JSDocTypeTag */: - case 346 /* JSDocTypedefTag */: - case 349 /* JSDocThrowsTag */: - case 350 /* JSDocSatisfiesTag */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: + case 343 /* JSDocReturnTag */: + case 345 /* JSDocTypeTag */: + case 347 /* JSDocTypedefTag */: + case 350 /* JSDocThrowsTag */: + case 351 /* JSDocSatisfiesTag */: return true; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return !!tag.constraint; default: return false; @@ -168127,7 +169081,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, function tryGetTypeExpressionFromTag(tag) { if (isTagWithTypeExpression(tag)) { const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression; - return typeExpression && typeExpression.kind === 309 /* JSDocTypeExpression */ ? typeExpression : void 0; + return typeExpression && typeExpression.kind === 310 /* JSDocTypeExpression */ ? typeExpression : void 0; } if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) { return tag.class; @@ -168165,7 +169119,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, symbols.push(exportedSymbol); } } - if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 307 /* SourceFile */ && d.kind !== 267 /* ModuleDeclaration */ && d.kind !== 266 /* EnumDeclaration */)) { + if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 268 /* ModuleDeclaration */ && d.kind !== 267 /* EnumDeclaration */)) { let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); let insertQuestionDot = false; if (type.isNullableType()) { @@ -168222,7 +169176,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, isNewIdentifierLocation = true; defaultCommitCharacters ?? (defaultCommitCharacters = allCommitCharacters); } - const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent; + const propertyAccess = node.kind === 206 /* ImportType */ ? node : node.parent; if (inCheckedFile) { for (const symbol of type.getApparentProperties()) { if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { @@ -168264,6 +169218,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) { const index = symbols.length; symbols.push(firstAccessibleSymbol); + symbolToSortTextMap[getSymbolId(firstAccessibleSymbol)] = SortText.GlobalsOrKeywords; const moduleSymbol = firstAccessibleSymbol.parent; if (!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) || typeChecker.tryGetMemberInModuleExportsAndProperties(firstAccessibleSymbol.name, moduleSymbol) !== firstAccessibleSymbol) { symbolToOriginInfoMap[index] = { kind: getNullableSymbolOriginInfoKind(2 /* SymbolMemberNoExport */) }; @@ -168383,7 +169338,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } } } - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 307 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 308 /* SourceFile */) { const thisType = typeChecker.tryGetThisTypeAt( scopeNode, /*includeGlobalThis*/ @@ -168413,10 +169368,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 307 /* SourceFile */: - case 228 /* TemplateExpression */: - case 294 /* JsxExpression */: - case 241 /* Block */: + case 308 /* SourceFile */: + case 229 /* TemplateExpression */: + case 295 /* JsxExpression */: + case 242 /* Block */: return true; default: return isStatement(scopeNode); @@ -168426,24 +169381,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return insideJsDocTagTypeExpression || insideJsDocImportTag || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); } function isContextTokenValueLocation(contextToken2) { - return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */); + return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 187 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 183 /* TypePredicate */); } function isContextTokenTypeLocation(contextToken2) { if (contextToken2) { const parentKind = contextToken2.parent.kind; switch (contextToken2.kind) { case 59 /* ColonToken */: - return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); + return parentKind === 173 /* PropertyDeclaration */ || parentKind === 172 /* PropertySignature */ || parentKind === 170 /* Parameter */ || parentKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); case 64 /* EqualsToken */: - return parentKind === 265 /* TypeAliasDeclaration */ || parentKind === 168 /* TypeParameter */; + return parentKind === 266 /* TypeAliasDeclaration */ || parentKind === 169 /* TypeParameter */; case 130 /* AsKeyword */: - return parentKind === 234 /* AsExpression */; + return parentKind === 235 /* AsExpression */; case 30 /* LessThanToken */: - return parentKind === 183 /* TypeReference */ || parentKind === 216 /* TypeAssertionExpression */; + return parentKind === 184 /* TypeReference */ || parentKind === 217 /* TypeAssertionExpression */; case 96 /* ExtendsKeyword */: - return parentKind === 168 /* TypeParameter */; + return parentKind === 169 /* TypeParameter */; case 152 /* SatisfiesKeyword */: - return parentKind === 238 /* SatisfiesExpression */; + return parentKind === 239 /* SatisfiesExpression */; } } return false; @@ -168606,14 +169561,14 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return true; } if (contextToken2.kind === 32 /* GreaterThanToken */ && contextToken2.parent) { - if (location === contextToken2.parent && (location.kind === 286 /* JsxOpeningElement */ || location.kind === 285 /* JsxSelfClosingElement */)) { + if (location === contextToken2.parent && (location.kind === 287 /* JsxOpeningElement */ || location.kind === 286 /* JsxSelfClosingElement */)) { return false; } - if (contextToken2.parent.kind === 286 /* JsxOpeningElement */) { - return location.parent.kind !== 286 /* JsxOpeningElement */; + if (contextToken2.parent.kind === 287 /* JsxOpeningElement */) { + return location.parent.kind !== 287 /* JsxOpeningElement */; } - if (contextToken2.parent.kind === 287 /* JsxClosingElement */ || contextToken2.parent.kind === 285 /* JsxSelfClosingElement */) { - return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 284 /* JsxElement */; + if (contextToken2.parent.kind === 288 /* JsxClosingElement */ || contextToken2.parent.kind === 286 /* JsxSelfClosingElement */) { + return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 285 /* JsxElement */; } } return false; @@ -168625,57 +169580,57 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, switch (tokenKind) { case 28 /* CommaToken */: switch (containingNodeKind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: // func( a, | - case 214 /* NewExpression */: { + case 215 /* NewExpression */: { const expression = contextToken.parent.expression; if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; } return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; } - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - case 176 /* Constructor */: + case 177 /* Constructor */: // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - case 184 /* FunctionType */: + case 185 /* FunctionType */: // var x: (s: string, list| - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 21 /* OpenParenToken */: switch (containingNodeKind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: // func( | - case 214 /* NewExpression */: { + case 215 /* NewExpression */: { const expression = contextToken.parent.expression; if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; } return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; } - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true }; - case 176 /* Constructor */: + case 177 /* Constructor */: // constructor( | - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 23 /* OpenBracketToken */: switch (containingNodeKind) { - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: // [ | - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: // [ | : string ] - case 189 /* TupleType */: + case 190 /* TupleType */: // [ | : string ] - case 167 /* ComputedPropertyName */: + case 168 /* ComputedPropertyName */: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; @@ -168688,25 +169643,25 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; case 25 /* DotToken */: switch (containingNodeKind) { - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 19 /* OpenBraceToken */: switch (containingNodeKind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: // class A { | - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } case 64 /* EqualsToken */: switch (containingNodeKind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: // const x = a| - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true }; default: return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; @@ -168714,19 +169669,19 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 16 /* TemplateHead */: return { defaultCommitCharacters: allCommitCharacters, - isNewIdentifierLocation: containingNodeKind === 228 /* TemplateExpression */ + isNewIdentifierLocation: containingNodeKind === 229 /* TemplateExpression */ // `aa ${| }; case 17 /* TemplateMiddle */: return { defaultCommitCharacters: allCommitCharacters, - isNewIdentifierLocation: containingNodeKind === 239 /* TemplateSpan */ + isNewIdentifierLocation: containingNodeKind === 240 /* TemplateSpan */ // `aa ${10} dd ${| }; case 134 /* AsyncKeyword */: - return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; + return containingNodeKind === 175 /* MethodDeclaration */ || containingNodeKind === 305 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; case 42 /* AsteriskToken */: - return containingNodeKind === 174 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; + return containingNodeKind === 175 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false }; } if (isClassMemberCompletionKeyword(tokenKind)) { return { defaultCommitCharacters: [], isNewIdentifierLocation: true }; @@ -168762,7 +169717,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, completionKind = 0 /* ObjectPropertyDeclaration */; let typeMembers; let existingMembers; - if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 211 /* ObjectLiteralExpression */) { const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); if (instantiatedType === void 0) { if (objectLikeContainer.flags & 67108864 /* InWithStatement */) { @@ -168782,15 +169737,15 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } } } else { - Debug.assert(objectLikeContainer.kind === 206 /* ObjectBindingPattern */); + Debug.assert(objectLikeContainer.kind === 207 /* ObjectBindingPattern */); isNewIdentifierLocation = false; const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); if (!isVariableLike(rootDeclaration)) return Debug.fail("Root declaration is not variable-like."); - let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 250 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 169 /* Parameter */) { + let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 251 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 170 /* Parameter */) { if (isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); - } else if (rootDeclaration.parent.kind === 174 /* MethodDeclaration */ || rootDeclaration.parent.kind === 178 /* SetAccessor */) { + } else if (rootDeclaration.parent.kind === 175 /* MethodDeclaration */ || rootDeclaration.parent.kind === 179 /* SetAccessor */) { canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -168815,7 +169770,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers)); symbols = concatenate(symbols, filteredMembers); setSortTextToOptionalMember(); - if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { + if (objectLikeContainer.kind === 211 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { transformObjectLiteralMembersSortText(symbolsStartIndex); collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer); } @@ -168829,10 +169784,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (!isTypeKeywordTokenOrIdentifier(contextToken)) { keywordFilters = 8 /* TypeKeyword */; } - const { moduleSpecifier } = namedImportsOrExports.kind === 275 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; + const { moduleSpecifier } = namedImportsOrExports.kind === 276 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; if (!moduleSpecifier) { isNewIdentifierLocation = true; - return namedImportsOrExports.kind === 275 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 276 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; } const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -168964,11 +169919,11 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 31 /* LessThanSlashToken */: case 44 /* SlashToken */: case 80 /* Identifier */: - case 211 /* PropertyAccessExpression */: - case 292 /* JsxAttributes */: - case 291 /* JsxAttribute */: - case 293 /* JsxSpreadAttribute */: - if (parent2 && (parent2.kind === 285 /* JsxSelfClosingElement */ || parent2.kind === 286 /* JsxOpeningElement */)) { + case 212 /* PropertyAccessExpression */: + case 293 /* JsxAttributes */: + case 292 /* JsxAttribute */: + case 294 /* JsxSpreadAttribute */: + if (parent2 && (parent2.kind === 286 /* JsxSelfClosingElement */ || parent2.kind === 287 /* JsxOpeningElement */)) { if (contextToken2.kind === 32 /* GreaterThanToken */) { const precedingToken = findPrecedingToken( contextToken2.pos, @@ -168979,7 +169934,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (!parent2.typeArguments || precedingToken && precedingToken.kind === 44 /* SlashToken */) break; } return parent2; - } else if (parent2.kind === 291 /* JsxAttribute */) { + } else if (parent2.kind === 292 /* JsxAttribute */) { return parent2.parent.parent; } break; @@ -168987,15 +169942,15 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 11 /* StringLiteral */: - if (parent2 && (parent2.kind === 291 /* JsxAttribute */ || parent2.kind === 293 /* JsxSpreadAttribute */)) { + if (parent2 && (parent2.kind === 292 /* JsxAttribute */ || parent2.kind === 294 /* JsxSpreadAttribute */)) { return parent2.parent.parent; } break; case 20 /* CloseBraceToken */: - if (parent2 && parent2.kind === 294 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 291 /* JsxAttribute */) { + if (parent2 && parent2.kind === 295 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 292 /* JsxAttribute */) { return parent2.parent.parent.parent; } - if (parent2 && parent2.kind === 293 /* JsxSpreadAttribute */) { + if (parent2 && parent2.kind === 294 /* JsxSpreadAttribute */) { return parent2.parent.parent; } break; @@ -169011,49 +169966,49 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const containingNodeKind = parent2.kind; switch (contextToken2.kind) { case 28 /* CommaToken */: - return containingNodeKind === 260 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 243 /* VariableStatement */ || containingNodeKind === 266 /* EnumDeclaration */ || // enum a { foo, | - isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 264 /* InterfaceDeclaration */ || // interface A= contextToken2.pos; case 25 /* DotToken */: - return containingNodeKind === 207 /* ArrayBindingPattern */; + return containingNodeKind === 208 /* ArrayBindingPattern */; // var [.| case 59 /* ColonToken */: - return containingNodeKind === 208 /* BindingElement */; + return containingNodeKind === 209 /* BindingElement */; // var {x :html| case 23 /* OpenBracketToken */: - return containingNodeKind === 207 /* ArrayBindingPattern */; + return containingNodeKind === 208 /* ArrayBindingPattern */; // var [x| case 21 /* OpenParenToken */: - return containingNodeKind === 299 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); + return containingNodeKind === 300 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 19 /* OpenBraceToken */: - return containingNodeKind === 266 /* EnumDeclaration */; + return containingNodeKind === 267 /* EnumDeclaration */; // enum a { | case 30 /* LessThanToken */: - return containingNodeKind === 263 /* ClassDeclaration */ || // class A< | - containingNodeKind === 231 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 264 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 265 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 264 /* ClassDeclaration */ || // class A< | + containingNodeKind === 232 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 265 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 266 /* TypeAliasDeclaration */ || // type List< | isFunctionLikeKind(containingNodeKind); case 126 /* StaticKeyword */: - return containingNodeKind === 172 /* PropertyDeclaration */ && !isClassLike(parent2.parent); + return containingNodeKind === 173 /* PropertyDeclaration */ && !isClassLike(parent2.parent); case 26 /* DotDotDotToken */: - return containingNodeKind === 169 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 207 /* ArrayBindingPattern */; + return containingNodeKind === 170 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 208 /* ArrayBindingPattern */; // var [...z| case 125 /* PublicKeyword */: case 123 /* PrivateKeyword */: case 124 /* ProtectedKeyword */: - return containingNodeKind === 169 /* Parameter */ && !isConstructorDeclaration(parent2.parent); + return containingNodeKind === 170 /* Parameter */ && !isConstructorDeclaration(parent2.parent); case 130 /* AsKeyword */: - return containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */ || containingNodeKind === 274 /* NamespaceImport */; + return containingNodeKind === 277 /* ImportSpecifier */ || containingNodeKind === 282 /* ExportSpecifier */ || containingNodeKind === 275 /* NamespaceImport */; case 139 /* GetKeyword */: case 153 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken2); case 80 /* Identifier */: { - if ((containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */) && contextToken2 === parent2.name && contextToken2.text === "type") { + if ((containingNodeKind === 277 /* ImportSpecifier */ || containingNodeKind === 282 /* ExportSpecifier */) && contextToken2 === parent2.name && contextToken2.text === "type") { return false; } const ancestorVariableDeclaration = findAncestor( @@ -169076,7 +170031,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, case 140 /* InferKeyword */: return true; case 156 /* TypeKeyword */: - return containingNodeKind !== 276 /* ImportSpecifier */; + return containingNodeKind !== 277 /* ImportSpecifier */; case 42 /* AsteriskToken */: return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent); } @@ -169110,7 +170065,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) { return false; } - const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 172 /* PropertyDeclaration */); + const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 173 /* PropertyDeclaration */); if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) { if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) { return false; @@ -169124,7 +170079,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile)); } function isFunctionLikeButNotConstructor(kind) { - return isFunctionLikeKind(kind) && kind !== 176 /* Constructor */; + return isFunctionLikeKind(kind) && kind !== 177 /* Constructor */; } function isDotOfNumericLiteral(contextToken2) { if (contextToken2.kind === 9 /* NumericLiteral */) { @@ -169134,7 +170089,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, return false; } function isVariableDeclarationListButNotTypeArgument(node2) { - return node2.parent.kind === 261 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); + return node2.parent.kind === 262 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); } function filterObjectMembersList(contextualMemberSymbols, existingMembers) { if (existingMembers.length === 0) { @@ -169143,7 +170098,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); const existingMemberNames = /* @__PURE__ */ new Set(); for (const m of existingMembers) { - if (m.kind !== 303 /* PropertyAssignment */ && m.kind !== 304 /* ShorthandPropertyAssignment */ && m.kind !== 208 /* BindingElement */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */ && m.kind !== 305 /* SpreadAssignment */) { + if (m.kind !== 304 /* PropertyAssignment */ && m.kind !== 305 /* ShorthandPropertyAssignment */ && m.kind !== 209 /* BindingElement */ && m.kind !== 175 /* MethodDeclaration */ && m.kind !== 178 /* GetAccessor */ && m.kind !== 179 /* SetAccessor */ && m.kind !== 306 /* SpreadAssignment */) { continue; } if (isCurrentlyEditingNode(m)) { @@ -169221,7 +170176,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) { const existingMemberNames = /* @__PURE__ */ new Set(); for (const m of existingMembers) { - if (m.kind !== 172 /* PropertyDeclaration */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */) { + if (m.kind !== 173 /* PropertyDeclaration */ && m.kind !== 175 /* MethodDeclaration */ && m.kind !== 178 /* GetAccessor */ && m.kind !== 179 /* SetAccessor */) { continue; } if (isCurrentlyEditingNode(m)) { @@ -169249,7 +170204,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 291 /* JsxAttribute */) { + if (attr.kind === 292 /* JsxAttribute */) { seenNames.add(getEscapedTextOfJsxAttributeName(attr.name)); } else if (isJsxSpreadAttribute(attr)) { setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); @@ -169364,7 +170319,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js var _keywordCompletions = []; var allKeywordsCompletions = memoize(() => { const res = []; - for (let i = 83 /* FirstKeyword */; i <= 165 /* LastKeyword */; i++) { + for (let i = 83 /* FirstKeyword */; i <= 166 /* LastKeyword */; i++) { res.push({ name: tokenToString(i), kind: "keyword" /* keyword */, @@ -169513,7 +170468,7 @@ function getPropertiesForCompletion(type, checker) { } function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { switch (location.kind) { - case 352 /* SyntaxList */: + case 353 /* SyntaxList */: return tryCast(location.parent, isObjectTypeDeclaration); case 1 /* EndOfFileToken */: const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); @@ -169577,7 +170532,7 @@ function tryGetTypeLiteralNode(node) { case 27 /* SemicolonToken */: case 28 /* CommaToken */: case 80 /* Identifier */: - if (parent2.kind === 171 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { + if (parent2.kind === 172 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { return parent2.parent; } break; @@ -169592,11 +170547,11 @@ function getConstraintOfTypeArgumentProperty(node, checker) { const t = getConstraintOfTypeArgumentProperty(node.parent, checker); if (!t) return void 0; switch (node.kind) { - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName); - case 193 /* IntersectionType */: - case 187 /* TypeLiteral */: - case 192 /* UnionType */: + case 194 /* IntersectionType */: + case 188 /* TypeLiteral */: + case 193 /* UnionType */: return t; } } @@ -169617,9 +170572,9 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) { case "<": return !!contextToken && contextToken.kind === 30 /* LessThanToken */ && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); case "/": - return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 44 /* SlashToken */ && isJsxClosingElement(contextToken.parent)); + return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 31 /* LessThanSlashToken */ && isJsxClosingElement(contextToken.parent)); case " ": - return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 307 /* SourceFile */; + return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 308 /* SourceFile */; default: return Debug.assertNever(triggerCharacter); } @@ -169746,8 +170701,8 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) { if (rangeIsOnSingleLine(top, sourceFile)) { return createTextSpanFromNode(top, sourceFile); } - Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 276 /* ImportSpecifier */); - const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ || top.kind === 351 /* JSDocImportTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; + Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 277 /* ImportSpecifier */); + const potentialSplitPoint = top.kind === 273 /* ImportDeclaration */ || top.kind === 352 /* JSDocImportTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; const withoutModuleSpecifier = { pos: top.getFirstToken().getStart(), end: potentialSplitPoint.pos @@ -170048,39 +171003,39 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, const typeChecker = program.getTypeChecker(); const parent2 = walkUpParentheses(node.parent); switch (parent2.kind) { - case 201 /* LiteralType */: { + case 202 /* LiteralType */: { const grandParent = walkUpParentheses(parent2.parent); - if (grandParent.kind === 205 /* ImportType */) { + if (grandParent.kind === 206 /* ImportType */) { return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; } return fromUnionableLiteralType(grandParent); } - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); } return fromContextualType() || fromContextualType(0 /* None */); - case 212 /* ElementAccessExpression */: { + case 213 /* ElementAccessExpression */: { const { expression, argumentExpression } = parent2; if (node === skipParentheses(argumentExpression)) { return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression)); } return void 0; } - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 291 /* JsxAttribute */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 292 /* JsxAttribute */: if (!isRequireCallArgument(node) && !isImportCall(parent2)) { - const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile, typeChecker); + const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 292 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile, typeChecker); return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */); } // falls through (is `require("")` or `require(""` or `import("")`) - case 272 /* ImportDeclaration */: - case 278 /* ExportDeclaration */: - case 283 /* ExternalModuleReference */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 279 /* ExportDeclaration */: + case 284 /* ExternalModuleReference */: + case 352 /* JSDocImportTag */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; - case 296 /* CaseClause */: + case 297 /* CaseClause */: const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); const contextualTypes = fromContextualType(); if (!contextualTypes) { @@ -170088,14 +171043,14 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, } const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); return { kind: 2 /* Types */, types: literals, isNewIdentifier: false }; - case 276 /* ImportSpecifier */: - case 281 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 282 /* ExportSpecifier */: const specifier = parent2; if (specifier.propertyName && node !== specifier.propertyName) { return; } const namedImportsOrExports = specifier.parent; - const { moduleSpecifier } = namedImportsOrExports.kind === 275 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; + const { moduleSpecifier } = namedImportsOrExports.kind === 276 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; if (!moduleSpecifier) return; const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) return; @@ -170103,26 +171058,37 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name))); const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName)); return { kind: 1 /* Properties */, symbols: uniques, hasIndexSignature: false }; + case 227 /* BinaryExpression */: + if (parent2.operatorToken.kind === 103 /* InKeyword */) { + const type = typeChecker.getTypeAtLocation(parent2.right); + const properties = type.isUnion() ? typeChecker.getAllPossiblePropertiesOfTypes(type.types) : type.getApparentProperties(); + return { + kind: 1 /* Properties */, + symbols: properties.filter((prop) => !prop.valueDeclaration || !isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration)), + hasIndexSignature: false + }; + } + return fromContextualType(0 /* None */); default: return fromContextualType() || fromContextualType(0 /* None */); } function fromUnionableLiteralType(grandParent) { switch (grandParent.kind) { - case 233 /* ExpressionWithTypeArguments */: - case 183 /* TypeReference */: { + case 234 /* ExpressionWithTypeArguments */: + case 184 /* TypeReference */: { const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent); if (typeArgument) { return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; } return void 0; } - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: const { indexType, objectType } = grandParent; if (!rangeContainsPosition(indexType, position)) { return void 0; } return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 192 /* UnionType */: { + case 193 /* UnionType */: { const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent)); if (!result) { return void 0; @@ -170147,9 +171113,9 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program, } function walkUpParentheses(node) { switch (node.kind) { - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: return walkUpParenthesizedTypes(node); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return walkUpParenthesizedExpressions(node); default: return node; @@ -170948,14 +171914,14 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { } if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 213 /* CallExpression */: + case 214 /* CallExpression */: if (isImportCall(direct)) { handleImportCall(direct); break; } if (!isAvailableThroughGlobal) { const parent2 = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent2.kind === 260 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent2.kind === 261 /* VariableDeclaration */) { const { name } = parent2; if (name.kind === 80 /* Identifier */) { directImports.push(name); @@ -170967,7 +171933,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { case 80 /* Identifier */: break; // TODO: GH#23879 - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: handleNamespaceImport( direct, direct.name, @@ -170976,11 +171942,11 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { false ); break; - case 272 /* ImportDeclaration */: - case 351 /* JSDocImportTag */: + case 273 /* ImportDeclaration */: + case 352 /* JSDocImportTag */: directImports.push(direct); const namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 274 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 275 /* NamespaceImport */) { handleNamespaceImport( direct, namedBindings.name, @@ -170993,10 +171959,10 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); } break; - case 278 /* ExportDeclaration */: + case 279 /* ExportDeclaration */: if (!direct.exportClause) { handleDirectImports(getContainingModuleSymbol(direct, checker)); - } else if (direct.exportClause.kind === 280 /* NamespaceExport */) { + } else if (direct.exportClause.kind === 281 /* NamespaceExport */) { addIndirectUser( getSourceFileLikeForImportDeclaration(direct), /*addTransitiveDependencies*/ @@ -171006,7 +171972,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { directImports.push(direct); } break; - case 205 /* ImportType */: + case 206 /* ImportType */: if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) { addIndirectUser( direct.getSourceFile(), @@ -171045,7 +172011,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { if (!alreadyAddedDirect) directImports.push(importDeclaration); } else if (!isAvailableThroughGlobal) { const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - Debug.assert(sourceFileLike.kind === 307 /* SourceFile */ || sourceFileLike.kind === 267 /* ModuleDeclaration */); + Debug.assert(sourceFileLike.kind === 308 /* SourceFile */ || sourceFileLike.kind === 268 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUser( sourceFileLike, @@ -171096,7 +172062,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c } return { importSearches, singleReferences }; function handleImport(decl) { - if (decl.kind === 271 /* ImportEqualsDeclaration */) { + if (decl.kind === 272 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -171106,7 +172072,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c handleNamespaceImportLike(decl); return; } - if (decl.kind === 205 /* ImportType */) { + if (decl.kind === 206 /* ImportType */) { if (decl.qualifier) { const firstIdentifier = getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === symbolName(exportSymbol)) { @@ -171120,7 +172086,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c if (decl.moduleSpecifier.kind !== 11 /* StringLiteral */) { return; } - if (decl.kind === 278 /* ExportDeclaration */) { + if (decl.kind === 279 /* ExportDeclaration */) { if (decl.exportClause && isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -171129,10 +172095,10 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 }; if (namedBindings) { switch (namedBindings.kind) { - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 275 /* NamedImports */: + case 276 /* NamedImports */: if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); } @@ -171166,7 +172132,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c addSearch(name, checker.getSymbolAtLocation(name)); } } else { - const localSymbol = element.kind === 281 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); + const localSymbol = element.kind === 282 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); } } @@ -171189,7 +172155,7 @@ function findModuleReferences(program, sourceFiles, searchModuleSymbol) { const checker = program.getTypeChecker(); for (const referencingFile of sourceFiles) { const searchSourceFile = searchModuleSymbol.valueDeclaration; - if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 307 /* SourceFile */) { + if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 308 /* SourceFile */) { for (const ref of referencingFile.referencedFiles) { if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { refs.push({ kind: "reference", referencingFile, ref }); @@ -171230,7 +172196,7 @@ function getDirectImportsMap(sourceFiles, checker, cancellationToken) { return map2; } function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return forEach(sourceFileLike.kind === 307 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( + return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( // TODO: GH#18217 action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action) )); @@ -171243,15 +172209,15 @@ function forEachImport(sourceFile, action) { } else { forEachPossibleImportOrExportStatement(sourceFile, (statement) => { switch (statement.kind) { - case 278 /* ExportDeclaration */: - case 272 /* ImportDeclaration */: { + case 279 /* ExportDeclaration */: + case 273 /* ImportDeclaration */: { const decl = statement; if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 271 /* ImportEqualsDeclaration */: { + case 272 /* ImportEqualsDeclaration */: { const decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -171269,7 +172235,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { const { parent: parent2 } = node; const grandparent = parent2.parent; if (symbol.exportSymbol) { - if (parent2.kind === 211 /* PropertyAccessExpression */) { + if (parent2.kind === 212 /* PropertyAccessExpression */) { return ((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport( grandparent, /*useLhsSymbol*/ @@ -171382,15 +172348,15 @@ function getExportNode(parent2, node) { function isNodeImport(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return parent2.name === node && isExternalModuleImportEquals(parent2); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return !parent2.propertyName; - case 273 /* ImportClause */: - case 274 /* NamespaceImport */: + case 274 /* ImportClause */: + case 275 /* NamespaceImport */: Debug.assert(parent2.name === node); return true; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent); default: return false; @@ -171420,21 +172386,21 @@ function getContainingModuleSymbol(importer, checker) { return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 213 /* CallExpression */ || node.kind === 351 /* JSDocImportTag */) { + if (node.kind === 214 /* CallExpression */ || node.kind === 352 /* JSDocImportTag */) { return node.getSourceFile(); } const { parent: parent2 } = node; - if (parent2.kind === 307 /* SourceFile */) { + if (parent2.kind === 308 /* SourceFile */) { return parent2; } - Debug.assert(parent2.kind === 268 /* ModuleBlock */); + Debug.assert(parent2.kind === 269 /* ModuleBlock */); return cast(parent2.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 267 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; + return node.kind === 268 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 283 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; + return eq.moduleReference.kind === 284 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; } // src/services/findAllReferences.ts @@ -171502,32 +172468,32 @@ function getContextNodeForNodeEntry(node) { function getContextNode(node) { if (!node) return void 0; switch (node.kind) { - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 208 /* BindingElement */: + case 209 /* BindingElement */: return getContextNode(node.parent.parent); - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: return node.parent.parent.parent; - case 281 /* ExportSpecifier */: - case 274 /* NamespaceImport */: + case 282 /* ExportSpecifier */: + case 275 /* NamespaceImport */: return node.parent.parent; - case 273 /* ImportClause */: - case 280 /* NamespaceExport */: + case 274 /* ImportClause */: + case 281 /* NamespaceExport */: return node.parent; - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return isExpressionStatement(node.parent) ? node.parent : node; - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode( findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2)) ) : node; - case 255 /* SwitchStatement */: + case 256 /* SwitchStatement */: return { start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */), end: node.caseBlock @@ -171569,7 +172535,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s const node = getTouchingPropertyName(sourceFile, position); let referenceEntries; const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 211 /* PropertyAccessExpression */ || node.parent.kind === 208 /* BindingElement */ || node.parent.kind === 212 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { + if (node.parent.kind === 212 /* PropertyAccessExpression */ || node.parent.kind === 209 /* BindingElement */ || node.parent.kind === 213 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { referenceEntries = entries && [...entries]; } else if (entries) { const queue = createQueue(entries); @@ -171590,11 +172556,11 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s return map(referenceEntries, (entry) => toImplementationLocation(entry, checker)); } function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 307 /* SourceFile */) { + if (node.kind === 308 /* SourceFile */) { return void 0; } const checker = program.getTypeChecker(); - if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { const result = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2))); return result; @@ -171788,12 +172754,12 @@ function implementationKindDisplayParts(node, checker) { const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); - } else if (node.kind === 210 /* ObjectLiteralExpression */) { + } else if (node.kind === 211 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("object literal"), punctuationPart(22 /* CloseParenToken */)] }; - } else if (node.kind === 231 /* ClassExpression */) { + } else if (node.kind === 232 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(22 /* CloseParenToken */)] @@ -171830,7 +172796,7 @@ function getTextSpan(node, sourceFile, endNode2) { start += 1; end -= 1; } - if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) { + if ((endNode2 == null ? void 0 : endNode2.kind) === 270 /* CaseBlock */) { end = endNode2.getFullStart(); } return createTextSpanFromBounds(start, end); @@ -171852,47 +172818,47 @@ function isDeclarationOfSymbol(node, target) { function declarationIsWriteAccess(decl) { if (!!(decl.flags & 33554432 /* Ambient */)) return true; switch (decl.kind) { - case 226 /* BinaryExpression */: - case 208 /* BindingElement */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: + case 227 /* BinaryExpression */: + case 209 /* BindingElement */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: case 90 /* DefaultKeyword */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 281 /* ExportSpecifier */: - case 273 /* ImportClause */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 282 /* ExportSpecifier */: + case 274 /* ImportClause */: // default import - case 271 /* ImportEqualsDeclaration */: - case 276 /* ImportSpecifier */: - case 264 /* InterfaceDeclaration */: - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: - case 291 /* JsxAttribute */: - case 267 /* ModuleDeclaration */: - case 270 /* NamespaceExportDeclaration */: - case 274 /* NamespaceImport */: - case 280 /* NamespaceExport */: - case 169 /* Parameter */: - case 304 /* ShorthandPropertyAssignment */: - case 265 /* TypeAliasDeclaration */: - case 168 /* TypeParameter */: + case 272 /* ImportEqualsDeclaration */: + case 277 /* ImportSpecifier */: + case 265 /* InterfaceDeclaration */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 292 /* JsxAttribute */: + case 268 /* ModuleDeclaration */: + case 271 /* NamespaceExportDeclaration */: + case 275 /* NamespaceImport */: + case 281 /* NamespaceExport */: + case 170 /* Parameter */: + case 305 /* ShorthandPropertyAssignment */: + case 266 /* TypeAliasDeclaration */: + case 169 /* TypeParameter */: return true; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 176 /* Constructor */: - case 174 /* MethodDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 177 /* Constructor */: + case 175 /* MethodDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: return !!decl.body; - case 260 /* VariableDeclaration */: - case 172 /* PropertyDeclaration */: + case 261 /* VariableDeclaration */: + case 173 /* PropertyDeclaration */: return !!decl.initializer || isCatchClause(decl.parent); - case 173 /* MethodSignature */: - case 171 /* PropertySignature */: - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: + case 174 /* MethodSignature */: + case 172 /* PropertySignature */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: return false; default: return Debug.failBadSyntaxKind(decl); @@ -172114,9 +173080,9 @@ var Core; if (symbol.declarations) { for (const decl of symbol.declarations) { switch (decl.kind) { - case 307 /* SourceFile */: + case 308 /* SourceFile */: break; - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -172184,7 +173150,7 @@ var Core; /*useLocalSymbolForExportSpecifier*/ !isForRenameWithPrefixAndSuffixText(options) ) || originalSymbol; - const searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; + const searchMeaning = node && options.use !== 2 /* Rename */ ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; const result = []; const state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); const exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) || !symbol.declarations ? void 0 : find(symbol.declarations, isExportSpecifier); @@ -172240,7 +173206,7 @@ var Core; } function getSpecialSearchKind(node) { switch (node.kind) { - case 176 /* Constructor */: + case 177 /* Constructor */: case 137 /* ConstructorKeyword */: return 1 /* Constructor */; case 80 /* Identifier */: @@ -172442,7 +173408,7 @@ var Core; } function getSymbolScope(symbol) { const { declarations, flags, parent: parent2, valueDeclaration } = symbol; - if (valueDeclaration && (valueDeclaration.kind === 218 /* FunctionExpression */ || valueDeclaration.kind === 231 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 219 /* FunctionExpression */ || valueDeclaration.kind === 232 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -172451,7 +173417,7 @@ var Core; if (flags & (4 /* Property */ | 8192 /* Method */)) { const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d)); if (privateDeclaration) { - return getAncestor(privateDeclaration, 263 /* ClassDeclaration */); + return getAncestor(privateDeclaration, 264 /* ClassDeclaration */); } return void 0; } @@ -172468,7 +173434,7 @@ var Core; if (scope && scope !== container) { return void 0; } - if (!container || container.kind === 307 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 308 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { return void 0; } scope = container; @@ -172819,14 +173785,14 @@ var Core; if (constructorSymbol && constructorSymbol.declarations) { for (const decl of constructorSymbol.declarations) { const ctrKeyword = findChildOfKind(decl, 137 /* ConstructorKeyword */, sourceFile); - Debug.assert(decl.kind === 176 /* Constructor */ && !!ctrKeyword); + Debug.assert(decl.kind === 177 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach((member) => { const decl = member.valueDeclaration; - if (decl && decl.kind === 174 /* MethodDeclaration */) { + if (decl && decl.kind === 175 /* MethodDeclaration */) { const body = decl.body; if (body) { forEachDescendantOfKind(body, 110 /* ThisKeyword */, (thisKeyword) => { @@ -172848,7 +173814,7 @@ var Core; return; } for (const decl of constructor.declarations) { - Debug.assert(decl.kind === 176 /* Constructor */); + Debug.assert(decl.kind === 177 /* Constructor */); const body = decl.body; if (body) { forEachDescendantOfKind(body, 108 /* SuperKeyword */, (node) => { @@ -172882,7 +173848,7 @@ var Core; if (refNode.kind !== 80 /* Identifier */) { return; } - if (refNode.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 305 /* ShorthandPropertyAssignment */) { getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2); } const containingNode = getContainingNodeIfInHeritageClause(refNode); @@ -172897,7 +173863,7 @@ var Core; addIfImplementation(typeHavingNode.initializer); } else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) { const body = typeHavingNode.body; - if (body.kind === 241 /* Block */) { + if (body.kind === 242 /* Block */) { forEachReturnStatement(body, (returnStatement) => { if (returnStatement.expression) addIfImplementation(returnStatement.expression); }); @@ -172917,13 +173883,13 @@ var Core; } function isImplementationExpression(node) { switch (node.kind) { - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: - case 210 /* ObjectLiteralExpression */: - case 231 /* ClassExpression */: - case 209 /* ArrayLiteralExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 211 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 210 /* ArrayLiteralExpression */: return true; default: return false; @@ -172959,13 +173925,13 @@ var Core; } let staticFlag = 256 /* Static */; switch (searchSpaceNode.kind) { - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; @@ -172987,7 +173953,7 @@ var Core; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }]; } function isParameterName(node) { - return node.kind === 80 /* Identifier */ && node.parent.kind === 169 /* Parameter */ && node.parent.name === node; + return node.kind === 80 /* Identifier */ && node.parent.kind === 170 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { let searchSpaceNode = getThisContainer( @@ -172999,36 +173965,36 @@ var Core; ); let staticFlag = 256 /* Static */; switch (searchSpaceNode.kind) { - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: if (isObjectLiteralMethod(searchSpaceNode)) { staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; } // falls through - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; - case 307 /* SourceFile */: + case 308 /* SourceFile */: if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return void 0; } // falls through - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return void 0; } - const references = flatMap(searchSpaceNode.kind === 307 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { + const references = flatMap(searchSpaceNode.kind === 308 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => { if (!isThis(node)) { @@ -173043,18 +174009,18 @@ var Core; ); if (!canHaveSymbol(container)) return false; switch (searchSpaceNode.kind) { - case 218 /* FunctionExpression */: - case 262 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 263 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 231 /* ClassExpression */: - case 263 /* ClassDeclaration */: - case 210 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 264 /* ClassDeclaration */: + case 211 /* ObjectLiteralExpression */: return container.parent && canHaveSymbol(container.parent) && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag; - case 307 /* SourceFile */: - return container.kind === 307 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); + case 308 /* SourceFile */: + return container.kind === 308 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); } }); }).map((n) => nodeEntry(n)); @@ -173178,7 +174144,7 @@ var Core; Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - const exportSpecifier = getDeclarationOfKind(symbol, 281 /* ExportSpecifier */); + const exportSpecifier = getDeclarationOfKind(symbol, 282 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -173218,7 +174184,7 @@ var Core; ) || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0)); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) { - const bindingElement = getDeclarationOfKind(symbol2, 208 /* BindingElement */); + const bindingElement = getDeclarationOfKind(symbol2, 209 /* BindingElement */); if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) { return getPropertySymbolFromBindingElement(checker2, bindingElement); } @@ -173231,8 +174197,8 @@ var Core; if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return; return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => { const type = checker.getTypeAtLocation(typeReference); - const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName); - return type && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol)); + const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName); + return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol); })); } } @@ -173447,7 +174413,7 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles const defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, declarationFilter) || emptyArray; return node.kind === 108 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo]; } - if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 305 /* ShorthandPropertyAssignment */) { const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo( decl, @@ -173501,10 +174467,23 @@ function getDefinitionFromOverriddenMember(typeChecker, node) { const expression = skipParentheses(baseTypeNode.expression); const base = isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression); if (!base) return; - const name = unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name)); - const symbol = hasStaticModifier(classElement) ? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbol(base), name) : typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name); - if (!symbol) return; - return getDefinitionFromSymbol(typeChecker, symbol, node); + const baseType = hasStaticModifier(classElement) ? typeChecker.getTypeOfSymbol(base) : typeChecker.getDeclaredTypeOfSymbol(base); + let baseProp; + if (isComputedPropertyName(classElement.name)) { + const prop = typeChecker.getSymbolAtLocation(classElement.name); + if (!prop) { + return; + } + if (isKnownSymbol(prop)) { + baseProp = find(typeChecker.getPropertiesOfType(baseType), (s) => s.escapedName === prop.escapedName); + } else { + baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(prop.escapedName)); + } + } else { + baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name))); + } + if (!baseProp) return; + return getDefinitionFromSymbol(typeChecker, baseProp, node); } function getReferenceAtPosition(sourceFile, position, program) { var _a, _b; @@ -173692,7 +174671,7 @@ function shouldSkipAlias(node, declaration) { if (node.parent === declaration) { return true; } - if (declaration.kind === 274 /* NamespaceImport */) { + if (declaration.kind === 275 /* NamespaceImport */) { return false; } return true; @@ -173810,20 +174789,20 @@ function isDefinitionVisible(checker, declaration) { if (!declaration.parent) return false; if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration) return isDefinitionVisible(checker, declaration.parent); switch (declaration.kind) { - case 172 /* PropertyDeclaration */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - case 174 /* MethodDeclaration */: + case 173 /* PropertyDeclaration */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + case 175 /* MethodDeclaration */: if (hasEffectiveModifier(declaration, 2 /* Private */)) return false; // Public properties/methods are visible if its parents are visible, so: // falls through - case 176 /* Constructor */: - case 303 /* PropertyAssignment */: - case 304 /* ShorthandPropertyAssignment */: - case 210 /* ObjectLiteralExpression */: - case 231 /* ClassExpression */: - case 219 /* ArrowFunction */: - case 218 /* FunctionExpression */: + case 177 /* Constructor */: + case 304 /* PropertyAssignment */: + case 305 /* ShorthandPropertyAssignment */: + case 211 /* ObjectLiteralExpression */: + case 232 /* ClassExpression */: + case 220 /* ArrowFunction */: + case 219 /* FunctionExpression */: return isDefinitionVisible(checker, declaration.parent); default: return false; @@ -173867,10 +174846,10 @@ function tryGetSignatureDeclaration(typeChecker, node) { } function isJsxConstructorLike(node) { switch (node.kind) { - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: return true; default: return false; @@ -173910,14 +174889,14 @@ function provideInlayHints(context) { return; } switch (node.kind) { - case 267 /* ModuleDeclaration */: - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 231 /* ClassExpression */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 219 /* ArrowFunction */: + case 268 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 232 /* ClassExpression */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 220 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { @@ -174082,7 +175061,7 @@ function provideInlayHints(context) { } function isHintableLiteral(node) { switch (node.kind) { - case 224 /* PrefixUnaryExpression */: { + case 225 /* PrefixUnaryExpression */: { const operand = node.operand; return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText); } @@ -174090,7 +175069,7 @@ function provideInlayHints(context) { case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 15 /* NoSubstitutionTemplateLiteral */: - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: return true; case 80 /* Identifier */: { const name = node.escapedText; @@ -174268,13 +175247,13 @@ function provideInlayHints(context) { parts.push({ text: identifierText }); } break; - case 166 /* QualifiedName */: + case 167 /* QualifiedName */: Debug.assertNode(node2, isQualifiedName); visitForDisplayParts(node2.left); parts.push({ text: "." }); visitForDisplayParts(node2.right); break; - case 182 /* TypePredicate */: + case 183 /* TypePredicate */: Debug.assertNode(node2, isTypePredicateNode); if (node2.assertsModifier) { parts.push({ text: "asserts " }); @@ -174285,7 +175264,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 183 /* TypeReference */: + case 184 /* TypeReference */: Debug.assertNode(node2, isTypeReferenceNode); visitForDisplayParts(node2.typeName); if (node2.typeArguments) { @@ -174294,7 +175273,7 @@ function provideInlayHints(context) { parts.push({ text: ">" }); } break; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: Debug.assertNode(node2, isTypeParameterDeclaration); if (node2.modifiers) { visitDisplayPartList(node2.modifiers, " "); @@ -174309,7 +175288,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.default); } break; - case 169 /* Parameter */: + case 170 /* Parameter */: Debug.assertNode(node2, isParameter); if (node2.modifiers) { visitDisplayPartList(node2.modifiers, " "); @@ -174326,14 +175305,14 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 185 /* ConstructorType */: + case 186 /* ConstructorType */: Debug.assertNode(node2, isConstructorTypeNode); parts.push({ text: "new " }); visitParametersAndTypeParameters(node2); parts.push({ text: " => " }); visitForDisplayParts(node2.type); break; - case 186 /* TypeQuery */: + case 187 /* TypeQuery */: Debug.assertNode(node2, isTypeQueryNode); parts.push({ text: "typeof " }); visitForDisplayParts(node2.exprName); @@ -174343,7 +175322,7 @@ function provideInlayHints(context) { parts.push({ text: ">" }); } break; - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: Debug.assertNode(node2, isTypeLiteralNode); parts.push({ text: "{" }); if (node2.members.length) { @@ -174353,18 +175332,18 @@ function provideInlayHints(context) { } parts.push({ text: "}" }); break; - case 188 /* ArrayType */: + case 189 /* ArrayType */: Debug.assertNode(node2, isArrayTypeNode); visitForDisplayParts(node2.elementType); parts.push({ text: "[]" }); break; - case 189 /* TupleType */: + case 190 /* TupleType */: Debug.assertNode(node2, isTupleTypeNode); parts.push({ text: "[" }); visitDisplayPartList(node2.elements, ", "); parts.push({ text: "]" }); break; - case 202 /* NamedTupleMember */: + case 203 /* NamedTupleMember */: Debug.assertNode(node2, isNamedTupleMember); if (node2.dotDotDotToken) { parts.push({ text: "..." }); @@ -174376,25 +175355,25 @@ function provideInlayHints(context) { parts.push({ text: ": " }); visitForDisplayParts(node2.type); break; - case 190 /* OptionalType */: + case 191 /* OptionalType */: Debug.assertNode(node2, isOptionalTypeNode); visitForDisplayParts(node2.type); parts.push({ text: "?" }); break; - case 191 /* RestType */: + case 192 /* RestType */: Debug.assertNode(node2, isRestTypeNode); parts.push({ text: "..." }); visitForDisplayParts(node2.type); break; - case 192 /* UnionType */: + case 193 /* UnionType */: Debug.assertNode(node2, isUnionTypeNode); visitDisplayPartList(node2.types, " | "); break; - case 193 /* IntersectionType */: + case 194 /* IntersectionType */: Debug.assertNode(node2, isIntersectionTypeNode); visitDisplayPartList(node2.types, " & "); break; - case 194 /* ConditionalType */: + case 195 /* ConditionalType */: Debug.assertNode(node2, isConditionalTypeNode); visitForDisplayParts(node2.checkType); parts.push({ text: " extends " }); @@ -174404,30 +175383,30 @@ function provideInlayHints(context) { parts.push({ text: " : " }); visitForDisplayParts(node2.falseType); break; - case 195 /* InferType */: + case 196 /* InferType */: Debug.assertNode(node2, isInferTypeNode); parts.push({ text: "infer " }); visitForDisplayParts(node2.typeParameter); break; - case 196 /* ParenthesizedType */: + case 197 /* ParenthesizedType */: Debug.assertNode(node2, isParenthesizedTypeNode); parts.push({ text: "(" }); visitForDisplayParts(node2.type); parts.push({ text: ")" }); break; - case 198 /* TypeOperator */: + case 199 /* TypeOperator */: Debug.assertNode(node2, isTypeOperatorNode); parts.push({ text: `${tokenToString(node2.operator)} ` }); visitForDisplayParts(node2.type); break; - case 199 /* IndexedAccessType */: + case 200 /* IndexedAccessType */: Debug.assertNode(node2, isIndexedAccessTypeNode); visitForDisplayParts(node2.objectType); parts.push({ text: "[" }); visitForDisplayParts(node2.indexType); parts.push({ text: "]" }); break; - case 200 /* MappedType */: + case 201 /* MappedType */: Debug.assertNode(node2, isMappedTypeNode); parts.push({ text: "{ " }); if (node2.readonlyToken) { @@ -174459,17 +175438,17 @@ function provideInlayHints(context) { } parts.push({ text: "; }" }); break; - case 201 /* LiteralType */: + case 202 /* LiteralType */: Debug.assertNode(node2, isLiteralTypeNode); visitForDisplayParts(node2.literal); break; - case 184 /* FunctionType */: + case 185 /* FunctionType */: Debug.assertNode(node2, isFunctionTypeNode); visitParametersAndTypeParameters(node2); parts.push({ text: " => " }); visitForDisplayParts(node2.type); break; - case 205 /* ImportType */: + case 206 /* ImportType */: Debug.assertNode(node2, isImportTypeNode); if (node2.isTypeOf) { parts.push({ text: "typeof " }); @@ -174492,7 +175471,7 @@ function provideInlayHints(context) { parts.push({ text: ">" }); } break; - case 171 /* PropertySignature */: + case 172 /* PropertySignature */: Debug.assertNode(node2, isPropertySignature); if ((_a = node2.modifiers) == null ? void 0 : _a.length) { visitDisplayPartList(node2.modifiers, " "); @@ -174507,7 +175486,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 181 /* IndexSignature */: + case 182 /* IndexSignature */: Debug.assertNode(node2, isIndexSignatureDeclaration); parts.push({ text: "[" }); visitDisplayPartList(node2.parameters, ", "); @@ -174517,7 +175496,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 173 /* MethodSignature */: + case 174 /* MethodSignature */: Debug.assertNode(node2, isMethodSignature); if ((_b = node2.modifiers) == null ? void 0 : _b.length) { visitDisplayPartList(node2.modifiers, " "); @@ -174533,7 +175512,7 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 179 /* CallSignature */: + case 180 /* CallSignature */: Debug.assertNode(node2, isCallSignatureDeclaration); visitParametersAndTypeParameters(node2); if (node2.type) { @@ -174541,13 +175520,22 @@ function provideInlayHints(context) { visitForDisplayParts(node2.type); } break; - case 207 /* ArrayBindingPattern */: + case 181 /* ConstructSignature */: + Debug.assertNode(node2, isConstructSignatureDeclaration); + parts.push({ text: "new " }); + visitParametersAndTypeParameters(node2); + if (node2.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node2.type); + } + break; + case 208 /* ArrayBindingPattern */: Debug.assertNode(node2, isArrayBindingPattern); parts.push({ text: "[" }); visitDisplayPartList(node2.elements, ", "); parts.push({ text: "]" }); break; - case 206 /* ObjectBindingPattern */: + case 207 /* ObjectBindingPattern */: Debug.assertNode(node2, isObjectBindingPattern); parts.push({ text: "{" }); if (node2.elements.length) { @@ -174557,16 +175545,16 @@ function provideInlayHints(context) { } parts.push({ text: "}" }); break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: Debug.assertNode(node2, isBindingElement); visitForDisplayParts(node2.name); break; - case 224 /* PrefixUnaryExpression */: + case 225 /* PrefixUnaryExpression */: Debug.assertNode(node2, isPrefixUnaryExpression); parts.push({ text: tokenToString(node2.operator) }); visitForDisplayParts(node2.operand); break; - case 203 /* TemplateLiteralType */: + case 204 /* TemplateLiteralType */: Debug.assertNode(node2, isTemplateLiteralTypeNode); visitForDisplayParts(node2.head); node2.templateSpans.forEach(visitForDisplayParts); @@ -174575,7 +175563,7 @@ function provideInlayHints(context) { Debug.assertNode(node2, isTemplateHead); parts.push({ text: getLiteralText2(node2) }); break; - case 204 /* TemplateLiteralTypeSpan */: + case 205 /* TemplateLiteralTypeSpan */: Debug.assertNode(node2, isTemplateLiteralTypeSpan); visitForDisplayParts(node2.type); visitForDisplayParts(node2.literal); @@ -174588,10 +175576,16 @@ function provideInlayHints(context) { Debug.assertNode(node2, isTemplateTail); parts.push({ text: getLiteralText2(node2) }); break; - case 197 /* ThisType */: + case 198 /* ThisType */: Debug.assertNode(node2, isThisTypeNode); parts.push({ text: "this" }); break; + case 168 /* ComputedPropertyName */: + Debug.assertNode(node2, isComputedPropertyName); + parts.push({ text: "[" }); + visitForDisplayParts(node2.expression); + parts.push({ text: "]" }); + break; default: Debug.failBadSyntaxKind(node2); } @@ -174762,8 +175756,8 @@ function getJsDocCommentsFromDeclarations(declarations, checker) { const parts = []; forEachUnique(declarations, (declaration) => { for (const jsdoc of getCommentHavingNodes(declaration)) { - const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 327 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); - if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 346 /* JSDocTypedefTag */ && declaration.kind !== 338 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 346 /* JSDocTypedefTag */ || t.kind === 338 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 341 /* JSDocParameterTag */ || t.kind === 342 /* JSDocReturnTag */)) { + const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 328 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); + if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 347 /* JSDocTypedefTag */ && declaration.kind !== 339 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 347 /* JSDocTypedefTag */ || t.kind === 339 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 342 /* JSDocParameterTag */ || t.kind === 343 /* JSDocReturnTag */)) { continue; } let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; @@ -174782,13 +175776,13 @@ function isIdenticalListOfDisplayParts(parts1, parts2) { } function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 341 /* JSDocParameterTag */: - case 348 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: + case 349 /* JSDocPropertyTag */: return [declaration]; - case 338 /* JSDocCallbackTag */: - case 346 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: return [declaration, declaration.parent]; - case 323 /* JSDocSignature */: + case 324 /* JSDocSignature */: if (isJSDocOverloadTag(declaration.parent)) { return [declaration.parent.parent]; } @@ -174801,7 +175795,7 @@ function getJsDocTagsFromDeclarations(declarations, checker) { const infos = []; forEachUnique(declarations, (declaration) => { const tags = getJSDocTags(declaration); - if (tags.some((t) => t.kind === 346 /* JSDocTypedefTag */ || t.kind === 338 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 341 /* JSDocParameterTag */ || t.kind === 342 /* JSDocReturnTag */)) { + if (tags.some((t) => t.kind === 347 /* JSDocTypedefTag */ || t.kind === 339 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 342 /* JSDocParameterTag */ || t.kind === 343 /* JSDocReturnTag */)) { return; } for (const tag of tags) { @@ -174823,21 +175817,21 @@ function getDisplayPartsFromComment(comment, checker) { } return flatMap( comment, - (node) => node.kind === 321 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) + (node) => node.kind === 322 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) ); } function getCommentDisplayParts(tag, checker) { const { comment, kind } = tag; const namePart = getTagNameDisplayPart(kind); switch (kind) { - case 349 /* JSDocThrowsTag */: + case 350 /* JSDocThrowsTag */: const typeExpression = tag.typeExpression; return typeExpression ? withNode(typeExpression) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); - case 329 /* JSDocImplementsTag */: + case 330 /* JSDocImplementsTag */: return withNode(tag.class); - case 328 /* JSDocAugmentsTag */: + case 329 /* JSDocAugmentsTag */: return withNode(tag.class); - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: const templateTag = tag; const displayParts = []; if (templateTag.constraint) { @@ -174859,14 +175853,14 @@ function getCommentDisplayParts(tag, checker) { displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]); } return displayParts; - case 344 /* JSDocTypeTag */: - case 350 /* JSDocSatisfiesTag */: + case 345 /* JSDocTypeTag */: + case 351 /* JSDocSatisfiesTag */: return withNode(tag.typeExpression); - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: - case 348 /* JSDocPropertyTag */: - case 341 /* JSDocParameterTag */: - case 347 /* JSDocSeeTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: + case 349 /* JSDocPropertyTag */: + case 342 /* JSDocParameterTag */: + case 348 /* JSDocSeeTag */: const { name } = tag; return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); default: @@ -174889,14 +175883,14 @@ function getCommentDisplayParts(tag, checker) { } function getTagNameDisplayPart(kind) { switch (kind) { - case 341 /* JSDocParameterTag */: + case 342 /* JSDocParameterTag */: return parameterNamePart; - case 348 /* JSDocPropertyTag */: + case 349 /* JSDocPropertyTag */: return propertyNamePart; - case 345 /* JSDocTemplateTag */: + case 346 /* JSDocTemplateTag */: return typeParameterNamePart; - case 346 /* JSDocTypedefTag */: - case 338 /* JSDocCallbackTag */: + case 347 /* JSDocTypedefTag */: + case 339 /* JSDocCallbackTag */: return typeAliasNamePart; default: return textPart; @@ -175019,46 +176013,46 @@ function getCommentOwnerInfo(tokenAtPos, options) { } function getCommentOwnerInfoWorker(commentOwner, options) { switch (commentOwner.kind) { - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 173 /* MethodSignature */: - case 219 /* ArrowFunction */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 174 /* MethodSignature */: + case 220 /* ArrowFunction */: const host = commentOwner; return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) }; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer, options); - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 306 /* EnumMember */: - case 265 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 307 /* EnumMember */: + case 266 /* TypeAliasDeclaration */: return { commentOwner }; - case 171 /* PropertySignature */: { + case 172 /* PropertySignature */: { const host2 = commentOwner; return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner }; } - case 243 /* VariableStatement */: { + case 244 /* VariableStatement */: { const varStatement = commentOwner; const varDeclarations = varStatement.declarationList.declarations; const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0; return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner }; } - case 307 /* SourceFile */: + case 308 /* SourceFile */: return "quit"; - case 267 /* ModuleDeclaration */: - return commentOwner.parent.kind === 267 /* ModuleDeclaration */ ? void 0 : { commentOwner }; - case 244 /* ExpressionStatement */: + case 268 /* ModuleDeclaration */: + return commentOwner.parent.kind === 268 /* ModuleDeclaration */ ? void 0 : { commentOwner }; + case 245 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression, options); - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const be = commentOwner; if (getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; } return isFunctionLike(be.right) ? { commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) } : { commentOwner }; } - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: const init = commentOwner.initializer; if (init && (isFunctionExpression(init) || isArrowFunction(init))) { return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) }; @@ -175069,14 +176063,14 @@ function hasReturn(node, options) { return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock(node.body) && !!forEachReturnStatement(node.body, (n) => n)); } function getRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 217 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 218 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: return rightHandSide; - case 231 /* ClassExpression */: + case 232 /* ClassExpression */: return find(rightHandSide.members, isConstructorDeclaration); } } @@ -175253,7 +176247,7 @@ function matchNode(a, b) { if (a.kind !== b.kind) { return false; } - if (a.kind === 176 /* Constructor */) { + if (a.kind === 177 /* Constructor */) { return a.kind === b.kind; } if (isNamedDeclaration(a) && isNamedDeclaration(b)) { @@ -175706,7 +176700,7 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings return factory.updateImportDeclaration( importDeclaration, importDeclaration.modifiers, - factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings), + factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.phaseModifier, name, namedBindings), // TODO: GH#18217 importDeclaration.moduleSpecifier, importDeclaration.attributes @@ -175733,11 +176727,11 @@ function getModuleNamesFromDecls(decls) { function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return (_a = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression; - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -175851,15 +176845,15 @@ function compareImportKind(s1, s2) { function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 272 /* ImportDeclaration */: + case 273 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 274 /* NamespaceImport */) return 2; + if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: return 5; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: return 6; } } @@ -175962,7 +176956,7 @@ function collectElements(sourceFile, cancellationToken) { function addNodeOutliningSpans(sourceFile, cancellationToken, out) { let depthRemaining = 40; let current = 0; - const statements = [...sourceFile.statements, sourceFile.endOfFileToken]; + const statements = sourceFile.statements; const n = statements.length; while (current < n) { while (current < n && !isAnyImportSyntax(statements[current])) { @@ -175980,6 +176974,7 @@ function addNodeOutliningSpans(sourceFile, cancellationToken, out) { out.push(createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], 102 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */)); } } + visitNode3(sourceFile.endOfFileToken); function visitNode3(n2) { var _a; if (depthRemaining === 0) return; @@ -176108,21 +177103,21 @@ function createOutliningSpanFromBounds(pos, end, kind) { } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 241 /* Block */: + case 242 /* Block */: if (isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } switch (n.parent.kind) { - case 246 /* DoStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 245 /* IfStatement */: - case 247 /* WhileStatement */: - case 254 /* WithStatement */: - case 299 /* CatchClause */: + case 247 /* DoStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 246 /* IfStatement */: + case 248 /* WhileStatement */: + case 255 /* WithStatement */: + case 300 /* CatchClause */: return spanForNode(n.parent); - case 258 /* TryStatement */: + case 259 /* TryStatement */: const tryStatement = n.parent; if (tryStatement.tryBlock === n) { return spanForNode(n.parent); @@ -176134,17 +177129,17 @@ function getOutliningSpanForNode(n, sourceFile) { default: return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 268 /* ModuleBlock */: + case 269 /* ModuleBlock */: return spanForNode(n.parent); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 269 /* CaseBlock */: - case 187 /* TypeLiteral */: - case 206 /* ObjectBindingPattern */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 270 /* CaseBlock */: + case 188 /* TypeLiteral */: + case 207 /* ObjectBindingPattern */: return spanForNode(n); - case 189 /* TupleType */: + case 190 /* TupleType */: return spanForNode( n, /*autoCollapse*/ @@ -176153,24 +177148,24 @@ function getOutliningSpanForNode(n, sourceFile) { !isTupleTypeNode(n.parent), 23 /* OpenBracketToken */ ); - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return spanForNodeArray(n.statements); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 23 /* OpenBracketToken */); - case 284 /* JsxElement */: + case 285 /* JsxElement */: return spanForJSXElement(n); - case 288 /* JsxFragment */: + case 289 /* JsxFragment */: return spanForJSXFragment(n); - case 285 /* JsxSelfClosingElement */: - case 286 /* JsxOpeningElement */: + case 286 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 228 /* TemplateExpression */: + case 229 /* TemplateExpression */: case 15 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 207 /* ArrayBindingPattern */: + case 208 /* ArrayBindingPattern */: return spanForNode( n, /*autoCollapse*/ @@ -176179,15 +177174,15 @@ function getOutliningSpanForNode(n, sourceFile) { !isBindingElement(n.parent), 23 /* OpenBracketToken */ ); - case 219 /* ArrowFunction */: + case 220 /* ArrowFunction */: return spanForArrowFunction(n); - case 213 /* CallExpression */: + case 214 /* CallExpression */: return spanForCallExpression(n); - case 217 /* ParenthesizedExpression */: + case 218 /* ParenthesizedExpression */: return spanForParenthesizedExpression(n); - case 275 /* NamedImports */: - case 279 /* NamedExports */: - case 300 /* ImportAttributes */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: + case 301 /* ImportAttributes */: return spanForImportExportElements(n); } function spanForImportExportElements(node) { @@ -176307,7 +177302,7 @@ function functionSpan(node, body, sourceFile) { node, sourceFile, /*autoCollapse*/ - node.kind !== 219 /* ArrowFunction */ + node.kind !== 220 /* ArrowFunction */ ); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) { @@ -176375,7 +177370,7 @@ function getRenameInfoForNode(node, typeChecker, sourceFile, program, preference return getRenameInfoError(wouldRenameNodeModules); } const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, node); - const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; + const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 168 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; const displayName = specifierName || typeChecker.symbolToString(symbol); const fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), node, sourceFile); @@ -176635,10 +177630,10 @@ function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checke ); } return void 0; - } else if (isTemplateHead(node) && parent2.parent.kind === 215 /* TaggedTemplateExpression */) { + } else if (isTemplateHead(node) && parent2.parent.kind === 216 /* TaggedTemplateExpression */) { const templateExpression = parent2; const tagExpression = templateExpression.parent; - Debug.assert(templateExpression.kind === 228 /* TemplateExpression */); + Debug.assert(templateExpression.kind === 229 /* TemplateExpression */); const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) { @@ -176711,16 +177706,16 @@ function getAdjustedNode(node) { function getContextualSignatureLocationInfo(node, sourceFile, position, checker) { const { parent: parent2 } = node; switch (parent2.kind) { - case 217 /* ParenthesizedExpression */: - case 174 /* MethodDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: + case 218 /* ParenthesizedExpression */: + case 175 /* MethodDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: const info = getArgumentOrParameterListInfo(node, position, sourceFile, checker); if (!info) return void 0; const { argumentIndex, argumentCount, argumentsSpan } = info; const contextualType = isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2); return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan }; - case 226 /* BinaryExpression */: { + case 227 /* BinaryExpression */: { const highestBinary = getHighestBinary(parent2); const contextualType2 = checker.getContextualType(highestBinary); const argumentIndex2 = node.kind === 21 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1; @@ -176829,7 +177824,7 @@ function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) { const template = taggedTemplate.template; const applicableSpanStart = template.getStart(); let applicableSpanEnd = template.getEnd(); - if (template.kind === 228 /* TemplateExpression */) { + if (template.kind === 229 /* TemplateExpression */) { const lastSpan = last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = skipTrivia( @@ -177122,7 +178117,7 @@ function getSelectionChildren(node) { Debug.assertEqual(openBraceToken.kind, 19 /* OpenBraceToken */); Debug.assertEqual(closeBraceToken.kind, 20 /* CloseBraceToken */); const groupedWithPlusMinusTokens = groupChildren(children, (child) => child === node.readonlyToken || child.kind === 148 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 58 /* QuestionToken */); - const groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, ({ kind }) => kind === 23 /* OpenBracketToken */ || kind === 168 /* TypeParameter */ || kind === 24 /* CloseBracketToken */); + const groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, ({ kind }) => kind === 23 /* OpenBracketToken */ || kind === 169 /* TypeParameter */ || kind === 24 /* CloseBracketToken */); return [ openBraceToken, // Pivot on `:` @@ -177132,7 +178127,7 @@ function getSelectionChildren(node) { } if (isPropertySignature(node)) { const children = groupChildren(node.getChildren(), (child) => child === node.name || contains(node.modifiers, child)); - const firstJSDocChild = ((_a = children[0]) == null ? void 0 : _a.kind) === 320 /* JSDoc */ ? children[0] : void 0; + const firstJSDocChild = ((_a = children[0]) == null ? void 0 : _a.kind) === 321 /* JSDoc */ ? children[0] : void 0; const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children; const splittedChildren = splitChildren(withJSDocSeparated, ({ kind }) => kind === 59 /* ColonToken */); return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren; @@ -177193,19 +178188,19 @@ function createSyntaxList2(children) { } function isListOpener(token) { const kind = token && token.kind; - return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 286 /* JsxOpeningElement */; + return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 287 /* JsxOpeningElement */; } function isListCloser(token) { const kind = token && token.kind; - return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 287 /* JsxClosingElement */; + return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 288 /* JsxClosingElement */; } function getEndPos(sourceFile, node) { switch (node.kind) { - case 341 /* JSDocParameterTag */: - case 338 /* JSDocCallbackTag */: - case 348 /* JSDocPropertyTag */: - case 346 /* JSDocTypedefTag */: - case 343 /* JSDocThisTag */: + case 342 /* JSDocParameterTag */: + case 339 /* JSDocCallbackTag */: + case 349 /* JSDocPropertyTag */: + case 347 /* JSDocTypedefTag */: + case 344 /* JSDocThisTag */: return sourceFile.getLineEndOfPosition(node.getStart()); default: return node.getEnd(); @@ -177229,7 +178224,7 @@ function getSymbolKind(typeChecker, symbol, location) { } const flags = getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return getDeclarationOfKind(symbol, 231 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; + return getDeclarationOfKind(symbol, 232 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) return "enum" /* enumElement */; if (flags & 524288 /* TypeAlias */) return "type" /* typeElement */; @@ -177325,7 +178320,7 @@ function getSymbolModifiers(typeChecker, symbol) { } return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : "" /* none */; } -function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias) { +function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias, maximumLength, verbosityLevel) { var _a; const displayParts = []; let documentation = []; @@ -177337,21 +178332,26 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb let documentationFromAlias; let tagsFromAlias; let hasMultipleSignatures = false; + const typeWriterOut = { canIncreaseExpansionDepth: false, truncated: false }; + let symbolWasExpanded = false; if (location.kind === 110 /* ThisKeyword */ && !isThisExpression) { return { displayParts: [keywordPart(110 /* ThisKeyword */)], documentation: [], symbolKind: "primitive type" /* primitiveType */, tags: void 0 }; } if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { if (symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */) { - const declaration = find(symbol.declarations, (declaration2) => declaration2.name === location); + const declaration = find( + symbol.declarations, + (declaration2) => declaration2.name === location && declaration2.kind !== 212 /* PropertyAccessExpression */ + ); if (declaration) { switch (declaration.kind) { - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: symbolKind = "getter" /* memberGetAccessorElement */; break; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: symbolKind = "setter" /* memberSetAccessorElement */; break; - case 172 /* PropertyDeclaration */: + case 173 /* PropertyDeclaration */: symbolKind = "accessor" /* memberAccessorVariableElement */; break; default: @@ -177363,7 +178363,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } let signature; type ?? (type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location)); - if (location.parent && location.parent.kind === 211 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 212 /* PropertyAccessExpression */) { const right = location.parent.name; if (right === location || right && right.getFullWidth() === 0) { location = location.parent; @@ -177379,7 +178379,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); - const useConstructSignatures = callExpressionLike.kind === 214 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108 /* SuperKeyword */; + const useConstructSignatures = callExpressionLike.kind === 215 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108 /* SuperKeyword */; const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : void 0; @@ -177442,22 +178442,22 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb hasMultipleSignatures = allSignatures.length > 1; } } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || // name of function declaration - location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 176 /* Constructor */) { + location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 177 /* Constructor */) { const functionDeclaration = location.parent; const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 137 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration)); if (locationIsSymbolDeclaration) { - const allSignatures = functionDeclaration.kind === 176 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + const allSignatures = functionDeclaration.kind === 177 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 176 /* Constructor */) { + if (functionDeclaration.kind === 177 /* Constructor */) { symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { addPrefixForAnyFunctionOrVar( - functionDeclaration.kind === 179 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, + functionDeclaration.kind === 180 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind ); } @@ -177471,21 +178471,28 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (getDeclarationOfKind(symbol, 231 /* ClassExpression */)) { + const classExpression = getDeclarationOfKind(symbol, 232 /* ClassExpression */); + if (classExpression) { pushSymbolKind("local class" /* localClassElement */); - } else { - displayParts.push(keywordPart(86 /* ClassKeyword */)); + displayParts.push(spacePart()); + } + if (!tryExpandSymbol(symbol, semanticMeaning)) { + if (!classExpression) { + displayParts.push(keywordPart(86 /* ClassKeyword */)); + displayParts.push(spacePart()); + } + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); } - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 64 /* Interface */ && semanticMeaning & 2 /* Type */) { prefixNextMeaning(); - displayParts.push(keywordPart(120 /* InterfaceKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); + if (!tryExpandSymbol(symbol, semanticMeaning)) { + displayParts.push(keywordPart(120 /* InterfaceKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } } if (symbolFlags & 524288 /* TypeAlias */ && semanticMeaning & 2 /* Type */) { prefixNextMeaning(); @@ -177496,25 +178503,44 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(spacePart()); displayParts.push(operatorPart(64 /* EqualsToken */)); displayParts.push(spacePart()); - addRange(displayParts, typeToDisplayParts(typeChecker, location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */)); + addRange( + displayParts, + typeToDisplayParts( + typeChecker, + location.parent && isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), + enclosingDeclaration, + 8388608 /* InTypeAlias */, + maximumLength, + verbosityLevel, + typeWriterOut + ) + ); } if (symbolFlags & 384 /* Enum */) { prefixNextMeaning(); - if (some(symbol.declarations, (d) => isEnumDeclaration(d) && isEnumConst(d))) { - displayParts.push(keywordPart(87 /* ConstKeyword */)); + if (!tryExpandSymbol(symbol, semanticMeaning)) { + if (some(symbol.declarations, (d) => isEnumDeclaration(d) && isEnumConst(d))) { + displayParts.push(keywordPart(87 /* ConstKeyword */)); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart(94 /* EnumKeyword */)); displayParts.push(spacePart()); + addFullSymbolName( + symbol, + /*enclosingDeclaration*/ + void 0 + ); } - displayParts.push(keywordPart(94 /* EnumKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - const declaration = getDeclarationOfKind(symbol, 267 /* ModuleDeclaration */); - const isNamespace = declaration && declaration.name && declaration.name.kind === 80 /* Identifier */; - displayParts.push(keywordPart(isNamespace ? 145 /* NamespaceKeyword */ : 144 /* ModuleKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); + if (!tryExpandSymbol(symbol, semanticMeaning)) { + const declaration = getDeclarationOfKind(symbol, 268 /* ModuleDeclaration */); + const isNamespace = declaration && declaration.name && declaration.name.kind === 80 /* Identifier */; + displayParts.push(keywordPart(isNamespace ? 145 /* NamespaceKeyword */ : 144 /* ModuleKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } } if (symbolFlags & 262144 /* TypeParameter */ && semanticMeaning & 2 /* Type */) { prefixNextMeaning(); @@ -177528,17 +178554,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - const decl = getDeclarationOfKind(symbol, 168 /* TypeParameter */); + const decl = getDeclarationOfKind(symbol, 169 /* TypeParameter */); if (decl === void 0) return Debug.fail(); const declaration = decl.parent; if (declaration) { if (isFunctionLike(declaration)) { addInPrefix(); const signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 180 /* ConstructSignature */) { + if (declaration.kind === 181 /* ConstructSignature */) { displayParts.push(keywordPart(105 /* NewKeyword */)); displayParts.push(spacePart()); - } else if (declaration.kind !== 179 /* CallSignature */ && declaration.name) { + } else if (declaration.kind !== 180 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } addRange(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -177556,7 +178582,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); const declaration = (_a = symbol.declarations) == null ? void 0 : _a[0]; - if ((declaration == null ? void 0 : declaration.kind) === 306 /* EnumMember */) { + if ((declaration == null ? void 0 : declaration.kind) === 307 /* EnumMember */) { const constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== void 0) { displayParts.push(spacePart()); @@ -177584,12 +178610,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb declarationName, type, semanticMeaning, - shouldUseAliasName ? symbol : resolvedSymbol + shouldUseAliasName ? symbol : resolvedSymbol, + maximumLength, + verbosityLevel ); displayParts.push(...resolvedInfo.displayParts); displayParts.push(lineBreakPart()); documentationFromAlias = resolvedInfo.documentation; tagsFromAlias = resolvedInfo.tags; + if (typeWriterOut && resolvedInfo.canIncreaseVerbosityLevel) { + typeWriterOut.canIncreaseExpansionDepth = true; + } } else { documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker); tagsFromAlias = resolvedSymbol.getJsDocTags(typeChecker); @@ -177598,17 +178629,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } if (symbol.declarations) { switch (symbol.declarations[0].kind) { - case 270 /* NamespaceExportDeclaration */: + case 271 /* NamespaceExportDeclaration */: displayParts.push(keywordPart(95 /* ExportKeyword */)); displayParts.push(spacePart()); displayParts.push(keywordPart(145 /* NamespaceKeyword */)); break; - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: displayParts.push(keywordPart(95 /* ExportKeyword */)); displayParts.push(spacePart()); displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 64 /* EqualsToken */ : 90 /* DefaultKeyword */)); break; - case 281 /* ExportSpecifier */: + case 282 /* ExportSpecifier */: displayParts.push(keywordPart(95 /* ExportKeyword */)); break; default: @@ -177618,7 +178649,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(spacePart()); addFullSymbolName(symbol); forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 271 /* ImportEqualsDeclaration */) { + if (declaration.kind === 272 /* ImportEqualsDeclaration */) { const importEqualsDeclaration = declaration; if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(spacePart()); @@ -177655,12 +178686,35 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(spacePart()); if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) { const typeParameterParts = mapToDisplayParts((writer) => { - const param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration, symbolDisplayNodeBuilderFlags); + const param = typeChecker.typeParameterToDeclaration( + type, + enclosingDeclaration, + symbolDisplayNodeBuilderFlags, + /*internalFlags*/ + void 0, + /*tracker*/ + void 0, + maximumLength, + verbosityLevel, + typeWriterOut + ); getPrinter().writeNode(4 /* Unspecified */, param, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration)), writer); - }); + }, maximumLength); addRange(displayParts, typeParameterParts); } else { - addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration)); + addRange( + displayParts, + typeToDisplayParts( + typeChecker, + type, + enclosingDeclaration, + /*flags*/ + void 0, + maximumLength, + verbosityLevel, + typeWriterOut + ) + ); } if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) { const labelDecl = symbol.links.target.links.tupleLabelDeclaration; @@ -177686,9 +178740,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker); } if (documentation.length === 0 && symbolFlags & 4 /* Property */) { - if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 307 /* SourceFile */)) { + if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 308 /* SourceFile */)) { for (const declaration of symbol.declarations) { - if (!declaration.parent || declaration.parent.kind !== 226 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 227 /* BinaryExpression */) { continue; } const rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -177716,7 +178770,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb }) || emptyArray; } } - if (tags.length === 0 && !hasMultipleSignatures) { + if (tags.length === 0 && !hasMultipleSignatures && !isInJSDoc(location)) { tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker); } if (documentation.length === 0 && documentationFromAlias) { @@ -177725,7 +178779,14 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb if (tags.length === 0 && tagsFromAlias) { tags = tagsFromAlias; } - return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags }; + const canIncreaseVerbosityLevel = !typeWriterOut.truncated && typeWriterOut.canIncreaseExpansionDepth; + return { + displayParts, + documentation, + symbolKind, + tags: tags.length === 0 ? void 0 : tags, + canIncreaseVerbosityLevel: verbosityLevel !== void 0 ? canIncreaseVerbosityLevel : void 0 + }; function getPrinter() { return createPrinterWithRemoveComments(); } @@ -177746,6 +178807,63 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb displayParts.push(keywordPart(103 /* InKeyword */)); displayParts.push(spacePart()); } + function canExpandSymbol(symbol2, out) { + if (verbosityLevel === void 0) { + return false; + } + const type2 = symbol2.flags & (32 /* Class */ | 64 /* Interface */) ? typeChecker.getDeclaredTypeOfSymbol(symbol2) : typeChecker.getTypeOfSymbolAtLocation(symbol2, location); + if (!type2 || typeChecker.isLibType(type2)) { + return false; + } + if (0 < verbosityLevel) { + return true; + } + if (out) { + out.canIncreaseExpansionDepth = true; + } + return false; + } + function semanticToSymbolMeaning(meaning) { + let symbolMeaning = 0 /* None */; + if (meaning & 1 /* Value */) { + symbolMeaning |= 111551 /* Value */; + } + if (meaning & 2 /* Type */) { + symbolMeaning |= 788968 /* Type */; + } + if (meaning & 4 /* Namespace */) { + symbolMeaning |= 1920 /* Namespace */; + } + return symbolMeaning; + } + function tryExpandSymbol(symbol2, meaning) { + if (symbolWasExpanded) { + return true; + } + if (canExpandSymbol(symbol2, typeWriterOut)) { + const symbolMeaning = semanticToSymbolMeaning(meaning); + const expandedDisplayParts = mapToDisplayParts((writer) => { + const nodes = typeChecker.getEmitResolver().symbolToDeclarations( + symbol2, + symbolMeaning, + 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, + maximumLength, + verbosityLevel !== void 0 ? verbosityLevel - 1 : void 0, + typeWriterOut + ); + const printer = getPrinter(); + const sourceFile2 = symbol2.valueDeclaration && getSourceFileOfNode(symbol2.valueDeclaration); + nodes.forEach((node, i) => { + if (i > 0) writer.writeLine(); + printer.writeNode(4 /* Unspecified */, node, sourceFile2, writer); + }); + }, maximumLength); + addRange(displayParts, expandedDisplayParts); + symbolWasExpanded = true; + return true; + } + return false; + } function addFullSymbolName(symbolToDisplay, enclosingDeclaration2) { let indexInfos; if (alias && symbolToDisplay === symbol) { @@ -177813,7 +178931,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb } } function addSignatureDisplayParts(signature, allSignatures, flags = 0 /* None */) { - addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); + addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */, maximumLength, verbosityLevel, typeWriterOut)); if (allSignatures.length > 1) { displayParts.push(spacePart()); displayParts.push(punctuationPart(21 /* OpenParenToken */)); @@ -177838,7 +178956,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb addRange(displayParts, typeParameterParts); } } -function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) { +function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias, maximumLength, verbosityLevel) { return getSymbolDisplayPartsDocumentationAndSymbolKindWorker( typeChecker, symbol, @@ -177848,7 +178966,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so /*type*/ void 0, semanticMeaning, - alias + alias, + maximumLength, + verbosityLevel ); } function isLocalVariableOrFunction(symbol) { @@ -177856,14 +178976,14 @@ function isLocalVariableOrFunction(symbol) { return false; } return forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 218 /* FunctionExpression */) { + if (declaration.kind === 219 /* FunctionExpression */) { return true; } - if (declaration.kind !== 260 /* VariableDeclaration */ && declaration.kind !== 262 /* FunctionDeclaration */) { + if (declaration.kind !== 261 /* VariableDeclaration */ && declaration.kind !== 263 /* FunctionDeclaration */) { return false; } for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) { - if (parent2.kind === 307 /* SourceFile */ || parent2.kind === 268 /* ModuleBlock */) { + if (parent2.kind === 308 /* SourceFile */ || parent2.kind === 269 /* ModuleBlock */) { return false; } } @@ -178047,7 +179167,7 @@ function getAdjustedEndPosition(sourceFile, node, options) { return newEnd !== end && (trailingTriviaOption === 2 /* Include */ || isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end; } function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 28 /* CommaToken */ || candidate.kind === 27 /* SemicolonToken */ && node.parent.kind === 210 /* ObjectLiteralExpression */); + return !!candidate && !!node.parent && (candidate.kind === 28 /* CommaToken */ || candidate.kind === 27 /* SemicolonToken */ && node.parent.kind === 211 /* ObjectLiteralExpression */); } function isThisTypeAnnotatable(containingFunction) { return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction); @@ -178276,7 +179396,7 @@ var ChangeTracker = class _ChangeTracker { endNode2 = first(node.parameters); } } else { - endNode2 = (node.kind === 260 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; + endNode2 = (node.kind === 261 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; } this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " }); return true; @@ -178427,18 +179547,18 @@ ${options.prefix}` : "\n" : options.prefix } getInsertNodeAfterOptionsWorker(node) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: case 11 /* StringLiteral */: case 80 /* Identifier */: return { prefix: ", " }; - case 303 /* PropertyAssignment */: + case 304 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 95 /* ExportKeyword */: return { prefix: " " }; - case 169 /* Parameter */: + case 170 /* Parameter */: return {}; default: Debug.assert(isStatement(node) || isClassOrTypeElement(node)); @@ -178447,7 +179567,7 @@ ${options.prefix}` : "\n" : options.prefix } insertName(sourceFile, node, name) { Debug.assert(!node.name); - if (node.kind === 219 /* ArrowFunction */) { + if (node.kind === 220 /* ArrowFunction */) { const arrow = findChildOfKind(node, 39 /* EqualsGreaterThanToken */, sourceFile); const lparen = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile); if (lparen) { @@ -178457,12 +179577,12 @@ ${options.prefix}` : "\n" : options.prefix this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`); this.replaceRange(sourceFile, arrow, factory.createToken(22 /* CloseParenToken */)); } - if (node.body.kind !== 241 /* Block */) { + if (node.body.kind !== 242 /* Block */) { this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken(19 /* OpenBraceToken */), factory.createToken(107 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [factory.createToken(27 /* SemicolonToken */), factory.createToken(20 /* CloseBraceToken */)], { joiner: " " }); } } else { - const pos = findChildOfKind(node, node.kind === 218 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; + const pos = findChildOfKind(node, node.kind === 219 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " }); } } @@ -178602,10 +179722,10 @@ ${options.prefix}` : "\n" : options.prefix } }; function updateJSDocHost(parent2) { - if (parent2.kind !== 219 /* ArrowFunction */) { + if (parent2.kind !== 220 /* ArrowFunction */) { return parent2; } - const jsDocNode = parent2.parent.kind === 172 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; + const jsDocNode = parent2.parent.kind === 173 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; jsDocNode.jsDoc = parent2.jsDoc; return jsDocNode; } @@ -178614,7 +179734,7 @@ function tryMergeJsdocTags(oldTag, newTag) { return void 0; } switch (oldTag.kind) { - case 341 /* JSDocParameterTag */: { + case 342 /* JSDocParameterTag */: { const oldParam = oldTag; const newParam = newTag; return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag( @@ -178628,14 +179748,14 @@ function tryMergeJsdocTags(oldTag, newTag) { oldParam.comment ) : void 0; } - case 342 /* JSDocReturnTag */: + case 343 /* JSDocReturnTag */: return factory.createJSDocReturnTag( /*tagName*/ void 0, newTag.typeExpression, oldTag.comment ); - case 344 /* JSDocTypeTag */: + case 345 /* JSDocTypeTag */: return factory.createJSDocTypeTag( /*tagName*/ void 0, @@ -179083,13 +180203,13 @@ function isValidLocationToAddComment(sourceFile, position) { return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position); } function needSemicolonBetween(a, b) { - return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 167 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); + return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 168 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); } var deleteDeclaration; ((_deleteDeclaration) => { function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 169 /* Parameter */: { + case 170 /* Parameter */: { const oldFunction = node.parent; if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 21 /* OpenParenToken */, sourceFile)) { changes.replaceNodeWithText(sourceFile, node, "()"); @@ -179098,29 +180218,29 @@ var deleteDeclaration; } break; } - case 272 /* ImportDeclaration */: - case 271 /* ImportEqualsDeclaration */: + case 273 /* ImportDeclaration */: + case 272 /* ImportEqualsDeclaration */: const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find(sourceFile.statements, isAnyImportSyntax); deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? 0 /* Exclude */ : hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; - case 208 /* BindingElement */: + case 209 /* BindingElement */: const pattern = node.parent; - const preserveComma = pattern.kind === 207 /* ArrayBindingPattern */ && node !== last(pattern.elements); + const preserveComma = pattern.kind === 208 /* ArrayBindingPattern */ && node !== last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } else { deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 276 /* ImportSpecifier */: + case 277 /* ImportSpecifier */: const namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -179128,7 +180248,7 @@ var deleteDeclaration; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 274 /* NamespaceImport */: + case 275 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 27 /* SemicolonToken */: @@ -179137,8 +180257,8 @@ var deleteDeclaration; case 100 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ }); break; - case 263 /* ClassDeclaration */: - case 262 /* FunctionDeclaration */: + case 264 /* ClassDeclaration */: + case 263 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; default: @@ -179180,13 +180300,13 @@ var deleteDeclaration; const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1)); changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end }); } else { - const importDecl = getAncestor(node, 272 /* ImportDeclaration */); + const importDecl = getAncestor(node, 273 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { const { parent: parent2 } = node; - if (parent2.kind === 299 /* CatchClause */) { + if (parent2.kind === 300 /* CatchClause */) { changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 21 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 22 /* CloseParenToken */, sourceFile)); return; } @@ -179196,14 +180316,14 @@ var deleteDeclaration; } const gp = parent2.parent; switch (gp.kind) { - case 250 /* ForOfStatement */: - case 249 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 250 /* ForInStatement */: changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression()); break; - case 248 /* ForStatement */: + case 249 /* ForStatement */: deleteNode(changes, sourceFile, parent2); break; - case 243 /* VariableStatement */: + case 244 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; default: @@ -179413,10 +180533,10 @@ function getFormattingScanner(text, languageVariant, startPos, endPos, cb) { function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 291 /* JsxAttribute */: - case 286 /* JsxOpeningElement */: - case 287 /* JsxClosingElement */: - case 285 /* JsxSelfClosingElement */: + case 292 /* JsxAttribute */: + case 287 /* JsxOpeningElement */: + case 288 /* JsxClosingElement */: + case 286 /* JsxSelfClosingElement */: return isKeyword(node.kind) || node.kind === 80 /* Identifier */; } } @@ -179590,7 +180710,7 @@ var RuleFlags = /* @__PURE__ */ ((RuleFlags2) => { // src/services/formatting/rules.ts function getAllRules() { const allTokens = []; - for (let token = 0 /* FirstToken */; token <= 165 /* LastToken */; token++) { + for (let token = 0 /* FirstToken */; token <= 166 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -179601,7 +180721,7 @@ function getAllRules() { const anyToken = { tokens: allTokens, isSpecific: false }; const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]); const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]); - const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 165 /* LastKeyword */); + const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 166 /* LastKeyword */); const binaryOperators = tokenRangeFromRange(30 /* FirstBinaryOperator */, 79 /* LastBinaryOperator */); const binaryKeywordOperators = [ 103 /* InKeyword */, @@ -179941,54 +181061,54 @@ function isOptionEnabledOrUndefined(optionName) { return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName]; } function isForContext(context) { - return context.contextNode.kind === 248 /* ForStatement */; + return context.contextNode.kind === 249 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 226 /* BinaryExpression */: + case 227 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 28 /* CommaToken */; - case 227 /* ConditionalExpression */: - case 194 /* ConditionalType */: - case 234 /* AsExpression */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 182 /* TypePredicate */: - case 192 /* UnionType */: - case 193 /* IntersectionType */: - case 238 /* SatisfiesExpression */: + case 228 /* ConditionalExpression */: + case 195 /* ConditionalType */: + case 235 /* AsExpression */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 183 /* TypePredicate */: + case 193 /* UnionType */: + case 194 /* IntersectionType */: + case 239 /* SatisfiesExpression */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 208 /* BindingElement */: + case 209 /* BindingElement */: // equals in type X = ... // falls through - case 265 /* TypeAliasDeclaration */: + case 266 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportEqualsDeclaration */: // equal in export = 1 // falls through - case 277 /* ExportAssignment */: + case 278 /* ExportAssignment */: // equal in let a = 0 // falls through - case 260 /* VariableDeclaration */: + case 261 /* VariableDeclaration */: // equal in p = 0 // falls through - case 169 /* Parameter */: - case 306 /* EnumMember */: - case 172 /* PropertyDeclaration */: - case 171 /* PropertySignature */: + case 170 /* Parameter */: + case 307 /* EnumMember */: + case 173 /* PropertyDeclaration */: + case 172 /* PropertySignature */: return context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 249 /* ForInStatement */: + case 250 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 168 /* TypeParameter */: + case 169 /* TypeParameter */: return context.currentTokenSpan.kind === 103 /* InKeyword */ || context.nextTokenSpan.kind === 103 /* InKeyword */ || context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 250 /* ForOfStatement */: + case 251 /* ForOfStatement */: return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */; } return false; @@ -180001,7 +181121,7 @@ function isNotTypeAnnotationContext(context) { } function isTypeAnnotationContext(context) { const contextKind = context.contextNode.kind; - return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(contextKind); + return contextKind === 173 /* PropertyDeclaration */ || contextKind === 172 /* PropertySignature */ || contextKind === 170 /* Parameter */ || contextKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(contextKind); } function isOptionalPropertyContext(context) { return isPropertyDeclaration(context.contextNode) && context.contextNode.questionToken; @@ -180010,13 +181130,13 @@ function isNonOptionalPropertyContext(context) { return !isOptionalPropertyContext(context); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 227 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */; + return context.contextNode.kind === 228 /* ConditionalExpression */ || context.contextNode.kind === 195 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 206 /* ObjectBindingPattern */ || context.contextNode.kind === 200 /* MappedType */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 207 /* ObjectBindingPattern */ || context.contextNode.kind === 201 /* MappedType */ || isSingleLineBlockContext(context); } function isBeforeMultilineBlockContext(context) { return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -180038,34 +181158,34 @@ function nodeIsBlockContext(node) { return true; } switch (node.kind) { - case 241 /* Block */: - case 269 /* CaseBlock */: - case 210 /* ObjectLiteralExpression */: - case 268 /* ModuleBlock */: + case 242 /* Block */: + case 270 /* CaseBlock */: + case 211 /* ObjectLiteralExpression */: + case 269 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 262 /* FunctionDeclaration */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: + case 263 /* FunctionDeclaration */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 179 /* CallSignature */: - case 218 /* FunctionExpression */: - case 176 /* Constructor */: - case 219 /* ArrowFunction */: + case 180 /* CallSignature */: + case 219 /* FunctionExpression */: + case 177 /* Constructor */: + case 220 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return true; } return false; @@ -180074,39 +181194,39 @@ function isNotFunctionDeclContext(context) { return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 262 /* FunctionDeclaration */ || context.contextNode.kind === 218 /* FunctionExpression */; + return context.contextNode.kind === 263 /* FunctionDeclaration */ || context.contextNode.kind === 219 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 187 /* TypeLiteral */: - case 267 /* ModuleDeclaration */: - case 278 /* ExportDeclaration */: - case 279 /* NamedExports */: - case 272 /* ImportDeclaration */: - case 275 /* NamedImports */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 188 /* TypeLiteral */: + case 268 /* ModuleDeclaration */: + case 279 /* ExportDeclaration */: + case 280 /* NamedExports */: + case 273 /* ImportDeclaration */: + case 276 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 263 /* ClassDeclaration */: - case 267 /* ModuleDeclaration */: - case 266 /* EnumDeclaration */: - case 299 /* CatchClause */: - case 268 /* ModuleBlock */: - case 255 /* SwitchStatement */: + case 264 /* ClassDeclaration */: + case 268 /* ModuleDeclaration */: + case 267 /* EnumDeclaration */: + case 300 /* CatchClause */: + case 269 /* ModuleBlock */: + case 256 /* SwitchStatement */: return true; - case 241 /* Block */: { + case 242 /* Block */: { const blockParent = context.currentTokenParent.parent; - if (!blockParent || blockParent.kind !== 219 /* ArrowFunction */ && blockParent.kind !== 218 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 220 /* ArrowFunction */ && blockParent.kind !== 219 /* FunctionExpression */) { return true; } } @@ -180115,32 +181235,32 @@ function isAfterCodeBlockContext(context) { } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 245 /* IfStatement */: - case 255 /* SwitchStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 247 /* WhileStatement */: - case 258 /* TryStatement */: - case 246 /* DoStatement */: - case 254 /* WithStatement */: + case 246 /* IfStatement */: + case 256 /* SwitchStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 248 /* WhileStatement */: + case 259 /* TryStatement */: + case 247 /* DoStatement */: + case 255 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 299 /* CatchClause */: + case 300 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 210 /* ObjectLiteralExpression */; + return context.contextNode.kind === 211 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 213 /* CallExpression */; + return context.contextNode.kind === 214 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 214 /* NewExpression */; + return context.contextNode.kind === 215 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -180155,10 +181275,10 @@ function isNextTokenNotCloseParen(context) { return context.nextTokenSpan.kind !== 22 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 219 /* ArrowFunction */; + return context.contextNode.kind === 220 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 205 /* ImportType */; + return context.contextNode.kind === 206 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 12 /* JsxText */; @@ -180167,25 +181287,25 @@ function isNonJsxTextContext(context) { return context.contextNode.kind !== 12 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 284 /* JsxElement */ && context.contextNode.kind !== 288 /* JsxFragment */; + return context.contextNode.kind !== 285 /* JsxElement */ && context.contextNode.kind !== 289 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 294 /* JsxExpression */ || context.contextNode.kind === 293 /* JsxSpreadAttribute */; + return context.contextNode.kind === 295 /* JsxExpression */ || context.contextNode.kind === 294 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 291 /* JsxAttribute */ || context.nextTokenParent.kind === 295 /* JsxNamespacedName */ && context.nextTokenParent.parent.kind === 291 /* JsxAttribute */; + return context.nextTokenParent.kind === 292 /* JsxAttribute */ || context.nextTokenParent.kind === 296 /* JsxNamespacedName */ && context.nextTokenParent.parent.kind === 292 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 291 /* JsxAttribute */; + return context.contextNode.kind === 292 /* JsxAttribute */; } function isNextTokenParentNotJsxNamespacedName(context) { - return context.nextTokenParent.kind !== 295 /* JsxNamespacedName */; + return context.nextTokenParent.kind !== 296 /* JsxNamespacedName */; } function isNextTokenParentJsxNamespacedName(context) { - return context.nextTokenParent.kind === 295 /* JsxNamespacedName */; + return context.nextTokenParent.kind === 296 /* JsxNamespacedName */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 285 /* JsxSelfClosingElement */; + return context.contextNode.kind === 286 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -180197,44 +181317,44 @@ function nodeIsInDecoratorContext(node) { while (node && isExpression(node)) { node = node.parent; } - return node && node.kind === 170 /* Decorator */; + return node && node.kind === 171 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 261 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; + return context.currentTokenParent.kind === 262 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 267 /* ModuleDeclaration */; + return context.contextNode.kind === 268 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 187 /* TypeLiteral */; + return context.contextNode.kind === 188 /* TypeLiteral */; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 180 /* ConstructSignature */; + return context.contextNode.kind === 181 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent2) { if (token.kind !== 30 /* LessThanToken */ && token.kind !== 32 /* GreaterThanToken */) { return false; } switch (parent2.kind) { - case 183 /* TypeReference */: - case 216 /* TypeAssertionExpression */: - case 265 /* TypeAliasDeclaration */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 233 /* ExpressionWithTypeArguments */: + case 184 /* TypeReference */: + case 217 /* TypeAssertionExpression */: + case 266 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 234 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -180244,31 +181364,31 @@ function isTypeArgumentOrParameterOrAssertionContext(context) { return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 216 /* TypeAssertionExpression */; + return context.contextNode.kind === 217 /* TypeAssertionExpression */; } function isNonTypeAssertionContext(context) { return !isTypeAssertionContext(context); } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 222 /* VoidExpression */; + return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 223 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 229 /* YieldExpression */ && context.contextNode.expression !== void 0; + return context.contextNode.kind === 230 /* YieldExpression */ && context.contextNode.expression !== void 0; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 235 /* NonNullExpression */; + return context.contextNode.kind === 236 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 245 /* IfStatement */: - case 248 /* ForStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 246 /* DoStatement */: - case 247 /* WhileStatement */: + case 246 /* IfStatement */: + case 249 /* ForStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 247 /* DoStatement */: + case 248 /* WhileStatement */: return true; default: return false; @@ -180297,16 +181417,16 @@ function isSemicolonDeletionContext(context) { if (nextTokenKind === 27 /* SemicolonToken */ && context.currentTokenSpan.kind === 27 /* SemicolonToken */) { return true; } - if (nextTokenKind === 240 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { + if (nextTokenKind === 241 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 264 /* InterfaceDeclaration */ || context.contextNode.kind === 265 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 265 /* InterfaceDeclaration */ || context.contextNode.kind === 266 /* TypeAliasDeclaration */) { return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 21 /* OpenParenToken */; } if (isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 248 /* ForStatement */ && context.currentTokenParent.kind !== 242 /* EmptyStatement */ && context.currentTokenParent.kind !== 240 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 228 /* TemplateExpression */ && nextTokenKind !== 16 /* TemplateHead */ && nextTokenKind !== 15 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 25 /* DotToken */; + return context.currentTokenParent.kind !== 249 /* ForStatement */ && context.currentTokenParent.kind !== 243 /* EmptyStatement */ && context.currentTokenParent.kind !== 241 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 229 /* TemplateExpression */ && nextTokenKind !== 16 /* TemplateHead */ && nextTokenKind !== 15 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 25 /* DotToken */; } function isSemicolonInsertionContext(context) { return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile); @@ -180381,12 +181501,12 @@ function buildMap(rules) { return map2; } function getRuleBucketIndex(row, column) { - Debug.assert(row <= 165 /* LastKeyword */ && column <= 165 /* LastKeyword */, "Must compute formatting context from tokens"); + Debug.assert(row <= 166 /* LastKeyword */ && column <= 166 /* LastKeyword */, "Must compute formatting context from tokens"); return row * mapRowLength + column; } var maskBitSize = 5; var mask = 31; -var mapRowLength = 165 /* LastToken */ + 1; +var mapRowLength = 166 /* LastToken */ + 1; var RulesPosition = ((RulesPosition2) => { RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific"; RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny"; @@ -180495,17 +181615,17 @@ function findOutermostNodeWithinListLevel(node) { } function isListElement(parent2, node) { switch (parent2.kind) { - case 263 /* ClassDeclaration */: - case 264 /* InterfaceDeclaration */: + case 264 /* ClassDeclaration */: + case 265 /* InterfaceDeclaration */: return rangeContainsRange(parent2.members, node); - case 267 /* ModuleDeclaration */: + case 268 /* ModuleDeclaration */: const body = parent2.body; - return !!body && body.kind === 268 /* ModuleBlock */ && rangeContainsRange(body.statements, node); - case 307 /* SourceFile */: - case 241 /* Block */: - case 268 /* ModuleBlock */: + return !!body && body.kind === 269 /* ModuleBlock */ && rangeContainsRange(body.statements, node); + case 308 /* SourceFile */: + case 242 /* Block */: + case 269 /* ModuleBlock */: return rangeContainsRange(parent2.statements, node); - case 299 /* CatchClause */: + case 300 /* CatchClause */: return rangeContainsRange(parent2.block.statements, node); } return false; @@ -180742,25 +181862,25 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt if (modifier) return modifier.kind; } switch (node.kind) { - case 263 /* ClassDeclaration */: + case 264 /* ClassDeclaration */: return 86 /* ClassKeyword */; - case 264 /* InterfaceDeclaration */: + case 265 /* InterfaceDeclaration */: return 120 /* InterfaceKeyword */; - case 262 /* FunctionDeclaration */: + case 263 /* FunctionDeclaration */: return 100 /* FunctionKeyword */; - case 266 /* EnumDeclaration */: - return 266 /* EnumDeclaration */; - case 177 /* GetAccessor */: + case 267 /* EnumDeclaration */: + return 267 /* EnumDeclaration */; + case 178 /* GetAccessor */: return 139 /* GetKeyword */; - case 178 /* SetAccessor */: + case 179 /* SetAccessor */: return 153 /* SetKeyword */; - case 174 /* MethodDeclaration */: + case 175 /* MethodDeclaration */: if (node.asteriskToken) { return 42 /* AsteriskToken */; } // falls through - case 172 /* PropertyDeclaration */: - case 169 /* Parameter */: + case 173 /* PropertyDeclaration */: + case 170 /* Parameter */: const name = getNameOfDeclaration(node); if (name) { return name.kind; @@ -180815,15 +181935,15 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt case 44 /* SlashToken */: case 32 /* GreaterThanToken */: switch (container.kind) { - case 286 /* JsxOpeningElement */: - case 287 /* JsxClosingElement */: - case 285 /* JsxSelfClosingElement */: + case 287 /* JsxOpeningElement */: + case 288 /* JsxClosingElement */: + case 286 /* JsxSelfClosingElement */: return false; } break; case 23 /* OpenBracketToken */: case 24 /* CloseBracketToken */: - if (container.kind !== 200 /* MappedType */) { + if (container.kind !== 201 /* MappedType */) { return false; } break; @@ -180924,11 +182044,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt return inheritedIndentation; } } - const effectiveParentStartLine = child.kind === 170 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + const effectiveParentStartLine = child.kind === 171 /* Decorator */ ? childStartLine : undecoratedParentStartLine; const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent2.kind === 209 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent2.kind === 210 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -181342,50 +182462,50 @@ function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenA } function getOpenTokenForList(node, list) { switch (node.kind) { - case 176 /* Constructor */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 219 /* ArrowFunction */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: + case 177 /* Constructor */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 220 /* ArrowFunction */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: if (node.typeParameters === list) { return 30 /* LessThanToken */; } else if (node.parameters === list) { return 21 /* OpenParenToken */; } break; - case 213 /* CallExpression */: - case 214 /* NewExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: if (node.typeArguments === list) { return 30 /* LessThanToken */; } else if (node.arguments === list) { return 21 /* OpenParenToken */; } break; - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: if (node.typeParameters === list) { return 30 /* LessThanToken */; } break; - case 183 /* TypeReference */: - case 215 /* TaggedTemplateExpression */: - case 186 /* TypeQuery */: - case 233 /* ExpressionWithTypeArguments */: - case 205 /* ImportType */: + case 184 /* TypeReference */: + case 216 /* TaggedTemplateExpression */: + case 187 /* TypeQuery */: + case 234 /* ExpressionWithTypeArguments */: + case 206 /* ImportType */: if (node.typeArguments === list) { return 30 /* LessThanToken */; } break; - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return 19 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -181475,11 +182595,11 @@ var SmartIndenter; } const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; const currentToken = getTokenAtPosition(sourceFile, position); - const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 210 /* ObjectLiteralExpression */; + const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 211 /* ObjectLiteralExpression */; if (options.indentStyle === 1 /* Block */ || isObjectLiteral) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 226 /* BinaryExpression */) { + if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 227 /* BinaryExpression */) { const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; @@ -181487,7 +182607,7 @@ var SmartIndenter; } const containerList = getListByPosition(position, precedingToken.parent, sourceFile); if (containerList && !rangeContainsRange(containerList, precedingToken)) { - const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind); + const useTheSameBaseIndentation = [219 /* FunctionExpression */, 220 /* ArrowFunction */].includes(currentToken.parent.kind); const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize; return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize; } @@ -181629,7 +182749,7 @@ var SmartIndenter; } } function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 307 /* SourceFile */ || !parentAndChildShareLine); + const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 308 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -181667,7 +182787,7 @@ var SmartIndenter; } SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) { - if (parent2.kind === 245 /* IfStatement */ && parent2.elseStatement === child) { + if (parent2.kind === 246 /* IfStatement */ && parent2.elseStatement === child) { const elseKeyword = findChildOfKind(parent2, 93 /* ElseKeyword */, sourceFile); Debug.assert(elseKeyword !== void 0); const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -181715,42 +182835,42 @@ var SmartIndenter; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 183 /* TypeReference */: + case 184 /* TypeReference */: return getList(node.typeArguments); - case 210 /* ObjectLiteralExpression */: + case 211 /* ObjectLiteralExpression */: return getList(node.properties); - case 209 /* ArrayLiteralExpression */: + case 210 /* ArrayLiteralExpression */: return getList(node.elements); - case 187 /* TypeLiteral */: + case 188 /* TypeLiteral */: return getList(node.members); - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 219 /* ArrowFunction */: - case 174 /* MethodDeclaration */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 176 /* Constructor */: - case 185 /* ConstructorType */: - case 180 /* ConstructSignature */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 220 /* ArrowFunction */: + case 175 /* MethodDeclaration */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 177 /* Constructor */: + case 186 /* ConstructorType */: + case 181 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 177 /* GetAccessor */: + case 178 /* GetAccessor */: return getList(node.parameters); - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 345 /* JSDocTemplateTag */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 346 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 214 /* NewExpression */: - case 213 /* CallExpression */: + case 215 /* NewExpression */: + case 214 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 261 /* VariableDeclarationList */: + case 262 /* VariableDeclarationList */: return getList(node.declarations); - case 275 /* NamedImports */: - case 279 /* NamedExports */: + case 276 /* NamedImports */: + case 280 /* NamedExports */: return getList(node.elements); - case 206 /* ObjectBindingPattern */: - case 207 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 208 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -181773,7 +182893,7 @@ var SmartIndenter; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 261 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 262 /* VariableDeclarationList */) { return -1 /* Unknown */; } const containingList = getContainingList(node, sourceFile); @@ -181834,97 +182954,102 @@ var SmartIndenter; function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) { const childKind = child ? child.kind : 0 /* Unknown */; switch (parent2.kind) { - case 244 /* ExpressionStatement */: - case 263 /* ClassDeclaration */: - case 231 /* ClassExpression */: - case 264 /* InterfaceDeclaration */: - case 266 /* EnumDeclaration */: - case 265 /* TypeAliasDeclaration */: - case 209 /* ArrayLiteralExpression */: - case 241 /* Block */: - case 268 /* ModuleBlock */: - case 210 /* ObjectLiteralExpression */: - case 187 /* TypeLiteral */: - case 200 /* MappedType */: - case 189 /* TupleType */: - case 217 /* ParenthesizedExpression */: - case 211 /* PropertyAccessExpression */: - case 213 /* CallExpression */: - case 214 /* NewExpression */: - case 243 /* VariableStatement */: - case 277 /* ExportAssignment */: - case 253 /* ReturnStatement */: - case 227 /* ConditionalExpression */: - case 207 /* ArrayBindingPattern */: - case 206 /* ObjectBindingPattern */: - case 286 /* JsxOpeningElement */: - case 289 /* JsxOpeningFragment */: - case 285 /* JsxSelfClosingElement */: - case 294 /* JsxExpression */: - case 173 /* MethodSignature */: - case 179 /* CallSignature */: - case 180 /* ConstructSignature */: - case 169 /* Parameter */: - case 184 /* FunctionType */: - case 185 /* ConstructorType */: - case 196 /* ParenthesizedType */: - case 215 /* TaggedTemplateExpression */: - case 223 /* AwaitExpression */: - case 279 /* NamedExports */: - case 275 /* NamedImports */: - case 281 /* ExportSpecifier */: - case 276 /* ImportSpecifier */: - case 172 /* PropertyDeclaration */: - case 296 /* CaseClause */: - case 297 /* DefaultClause */: + case 245 /* ExpressionStatement */: + case 264 /* ClassDeclaration */: + case 232 /* ClassExpression */: + case 265 /* InterfaceDeclaration */: + case 267 /* EnumDeclaration */: + case 266 /* TypeAliasDeclaration */: + case 210 /* ArrayLiteralExpression */: + case 242 /* Block */: + case 269 /* ModuleBlock */: + case 211 /* ObjectLiteralExpression */: + case 188 /* TypeLiteral */: + case 201 /* MappedType */: + case 190 /* TupleType */: + case 218 /* ParenthesizedExpression */: + case 212 /* PropertyAccessExpression */: + case 214 /* CallExpression */: + case 215 /* NewExpression */: + case 244 /* VariableStatement */: + case 278 /* ExportAssignment */: + case 254 /* ReturnStatement */: + case 228 /* ConditionalExpression */: + case 208 /* ArrayBindingPattern */: + case 207 /* ObjectBindingPattern */: + case 287 /* JsxOpeningElement */: + case 290 /* JsxOpeningFragment */: + case 286 /* JsxSelfClosingElement */: + case 295 /* JsxExpression */: + case 174 /* MethodSignature */: + case 180 /* CallSignature */: + case 181 /* ConstructSignature */: + case 170 /* Parameter */: + case 185 /* FunctionType */: + case 186 /* ConstructorType */: + case 197 /* ParenthesizedType */: + case 216 /* TaggedTemplateExpression */: + case 224 /* AwaitExpression */: + case 280 /* NamedExports */: + case 276 /* NamedImports */: + case 282 /* ExportSpecifier */: + case 277 /* ImportSpecifier */: + case 173 /* PropertyDeclaration */: + case 297 /* CaseClause */: + case 298 /* DefaultClause */: return true; - case 269 /* CaseBlock */: + case 270 /* CaseBlock */: return settings.indentSwitchCase ?? true; - case 260 /* VariableDeclaration */: - case 303 /* PropertyAssignment */: - case 226 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210 /* ObjectLiteralExpression */) { + case 261 /* VariableDeclaration */: + case 304 /* PropertyAssignment */: + case 227 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 211 /* ObjectLiteralExpression */) { return rangeIsOnOneLine(sourceFile, child); } - if (parent2.kind === 226 /* BinaryExpression */ && sourceFile && child && childKind === 284 /* JsxElement */) { + if (parent2.kind === 227 /* BinaryExpression */ && sourceFile && child && childKind === 285 /* JsxElement */) { const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent2.pos)).line; const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line; return parentStartLine !== childStartLine; } - if (parent2.kind !== 226 /* BinaryExpression */) { + if (parent2.kind !== 227 /* BinaryExpression */) { return true; } break; - case 246 /* DoStatement */: - case 247 /* WhileStatement */: - case 249 /* ForInStatement */: - case 250 /* ForOfStatement */: - case 248 /* ForStatement */: - case 245 /* IfStatement */: - case 262 /* FunctionDeclaration */: - case 218 /* FunctionExpression */: - case 174 /* MethodDeclaration */: - case 176 /* Constructor */: - case 177 /* GetAccessor */: - case 178 /* SetAccessor */: - return childKind !== 241 /* Block */; - case 219 /* ArrowFunction */: - if (sourceFile && childKind === 217 /* ParenthesizedExpression */) { + case 247 /* DoStatement */: + case 248 /* WhileStatement */: + case 250 /* ForInStatement */: + case 251 /* ForOfStatement */: + case 249 /* ForStatement */: + case 246 /* IfStatement */: + case 263 /* FunctionDeclaration */: + case 219 /* FunctionExpression */: + case 175 /* MethodDeclaration */: + case 177 /* Constructor */: + case 178 /* GetAccessor */: + case 179 /* SetAccessor */: + return childKind !== 242 /* Block */; + case 220 /* ArrowFunction */: + if (sourceFile && childKind === 218 /* ParenthesizedExpression */) { return rangeIsOnOneLine(sourceFile, child); } - return childKind !== 241 /* Block */; - case 278 /* ExportDeclaration */: - return childKind !== 279 /* NamedExports */; - case 272 /* ImportDeclaration */: - return childKind !== 273 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 275 /* NamedImports */; - case 284 /* JsxElement */: - return childKind !== 287 /* JsxClosingElement */; - case 288 /* JsxFragment */: - return childKind !== 290 /* JsxClosingFragment */; - case 193 /* IntersectionType */: - case 192 /* UnionType */: - case 238 /* SatisfiesExpression */: - if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */ || childKind === 200 /* MappedType */) { + return childKind !== 242 /* Block */; + case 279 /* ExportDeclaration */: + return childKind !== 280 /* NamedExports */; + case 273 /* ImportDeclaration */: + return childKind !== 274 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 276 /* NamedImports */; + case 285 /* JsxElement */: + return childKind !== 288 /* JsxClosingElement */; + case 289 /* JsxFragment */: + return childKind !== 291 /* JsxClosingFragment */; + case 194 /* IntersectionType */: + case 193 /* UnionType */: + case 239 /* SatisfiesExpression */: + if (childKind === 188 /* TypeLiteral */ || childKind === 190 /* TupleType */ || childKind === 201 /* MappedType */) { + return false; + } + break; + case 259 /* TryStatement */: + if (childKind === 242 /* Block */) { return false; } break; @@ -181934,11 +183059,11 @@ var SmartIndenter; SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent2) { switch (kind) { - case 253 /* ReturnStatement */: - case 257 /* ThrowStatement */: - case 251 /* ContinueStatement */: - case 252 /* BreakStatement */: - return parent2.kind !== 241 /* Block */; + case 254 /* ReturnStatement */: + case 258 /* ThrowStatement */: + case 252 /* ContinueStatement */: + case 253 /* BreakStatement */: + return parent2.kind !== 242 /* Block */; default: return false; } @@ -182569,6 +183694,7 @@ __export(ts_exports2, { decodeMappings: () => decodeMappings, decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, deduplicate: () => deduplicate, + defaultHoverMaximumTruncationLength: () => defaultHoverMaximumTruncationLength, defaultInitCompilerOptions: () => defaultInitCompilerOptions, defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, diagnosticCategoryName: () => diagnosticCategoryName, @@ -182753,7 +183879,6 @@ __export(ts_exports2, { getCommonSourceDirectory: () => getCommonSourceDirectory, getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, getCompilerOptionValue: () => getCompilerOptionValue, - getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, getConditions: () => getConditions, getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, getConstantValue: () => getConstantValue, @@ -184787,9 +185912,9 @@ var TypingsInstaller = class { this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`); this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`); } - if (npmConfig.devDependencies && npmLock.dependencies) { + if (npmConfig.devDependencies && (npmLock.packages || npmLock.dependencies)) { for (const key in npmConfig.devDependencies) { - if (!hasProperty(npmLock.dependencies, key)) { + if (npmLock.packages && !hasProperty(npmLock.packages, `node_modules/${key}`) || npmLock.dependencies && !hasProperty(npmLock.dependencies, key)) { continue; } const packageName = getBaseFileName(key); @@ -184813,7 +185938,7 @@ var TypingsInstaller = class { if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); } - const info = getProperty(npmLock.dependencies, key); + const info = npmLock.packages && getProperty(npmLock.packages, `node_modules/${key}`) || getProperty(npmLock.dependencies, key); const version2 = info && info.version; if (!version2) { continue; @@ -185327,6 +186452,7 @@ var ModuleKind2 = /* @__PURE__ */ ((ModuleKind3) => { ModuleKind3["ESNext"] = "esnext"; ModuleKind3["Node16"] = "node16"; ModuleKind3["Node18"] = "node18"; + ModuleKind3["Node20"] = "node20"; ModuleKind3["NodeNext"] = "nodenext"; ModuleKind3["Preserve"] = "preserve"; return ModuleKind3; @@ -186080,7 +187206,7 @@ var Project2 = class _Project { this.projectService.onProjectCreation(this); } /** @internal */ - getResolvedProjectReferenceToRedirect(_fileName) { + getRedirectFromSourceFile(_fileName) { return void 0; } isNonTsProject() { @@ -188129,9 +189255,9 @@ var ConfiguredProject2 = class extends Project2 { (this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(canonicalConfigPath); } /** @internal */ - getResolvedProjectReferenceToRedirect(fileName) { + getRedirectFromSourceFile(fileName) { const program = this.getCurrentProgram(); - return program && program.getResolvedProjectReferenceToRedirect(fileName); + return program && program.getRedirectFromSourceFile(fileName); } /** @internal */ forEachResolvedProjectReference(cb) { @@ -194246,7 +195372,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter } const initialNode = getTouchingPropertyName(program.getSourceFile(file), position); const symbol = program.getTypeChecker().getSymbolAtLocation(initialNode); - const importSpecifier = symbol && getDeclarationOfKind(symbol, 276 /* ImportSpecifier */); + const importSpecifier = symbol && getDeclarationOfKind(symbol, 277 /* ImportSpecifier */); if (!importSpecifier) return void 0; const nameToSearch = ((_a2 = importSpecifier.propertyName) == null ? void 0 : _a2.text) || importSpecifier.name.text; return searchForDeclaration(nameToSearch, fileToSearch, noDtsProgram); @@ -194798,11 +195924,17 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter getQuickInfoWorker(args, simplifiedResult) { const { file, project } = this.getFileAndProject(args); const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); - const quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo)); + const userPreferences = this.getPreferences(file); + const quickInfo = project.getLanguageService().getQuickInfoAtPosition( + file, + this.getPosition(args, scriptInfo), + userPreferences.maximumHoverLength, + args.verbosityLevel + ); if (!quickInfo) { return void 0; } - const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + const useDisplayParts = !!userPreferences.displayPartsForJSDoc; if (simplifiedResult) { const displayString = displayPartsToString(quickInfo.displayParts); return { @@ -194812,7 +195944,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter end: scriptInfo.positionToLineOffset(textSpanEnd(quickInfo.textSpan)), displayString, documentation: useDisplayParts ? this.mapDisplayParts(quickInfo.documentation, project) : displayPartsToString(quickInfo.documentation), - tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts) + tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts), + canIncreaseVerbosityLevel: quickInfo.canIncreaseVerbosityLevel }; } else { return useDisplayParts ? quickInfo : { @@ -197322,6 +198455,7 @@ if (typeof console !== "undefined") { decodeMappings, decodedTextSpanIntersectsWith, deduplicate, + defaultHoverMaximumTruncationLength, defaultInitCompilerOptions, defaultMaximumTruncationLength, diagnosticCategoryName, @@ -197506,7 +198640,6 @@ if (typeof console !== "undefined") { getCommonSourceDirectory, getCommonSourceDirectoryOfConfig, getCompilerOptionValue, - getCompilerOptionsDiffValue, getConditions, getConfigFileParsingDiagnostics, getConstantValue, diff --git a/packages/schematics/angular/utility/ast-utils.ts b/packages/schematics/angular/utility/ast-utils.ts index 106481688d18..df1f28a8eeb1 100644 --- a/packages/schematics/angular/utility/ast-utils.ts +++ b/packages/schematics/angular/utility/ast-utils.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { tags } from '@angular-devkit/core'; import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript'; import { Change, InsertChange, NoopChange } from './change'; import { getEOL } from './eol'; @@ -91,6 +90,11 @@ export function insertImport( ); } +const findNodesCache = new WeakMap< + ts.SourceFile, + Map boolean), ts.Node[]> +>(); + /** * Find all nodes from the AST in the subtree of node of SyntaxKind kind. * @param node @@ -138,6 +142,14 @@ export function findNodes( ? kindOrGuard : (node: ts.Node): node is T => node.kind === kindOrGuard; + // Caching is only supported for the entire file + if (ts.isSourceFile(node)) { + const sourceFileCache = findNodesCache.get(node); + if (sourceFileCache?.has(kindOrGuard)) { + return sourceFileCache.get(kindOrGuard) as T[]; + } + } + const arr: T[] = []; if (test(node)) { arr.push(node); @@ -158,6 +170,15 @@ export function findNodes( } } + if (ts.isSourceFile(node)) { + let sourceFileCache = findNodesCache.get(node); + if (!sourceFileCache) { + sourceFileCache = new Map(); + findNodesCache.set(node, sourceFileCache); + } + sourceFileCache.set(kindOrGuard, arr); + } + return arr; } @@ -168,20 +189,14 @@ export function findNodes( */ export function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[] { const nodes: ts.Node[] = [sourceFile]; - const result: ts.Node[] = []; - - while (nodes.length > 0) { - const node = nodes.shift(); - if (node) { - result.push(node); - if (node.getChildCount(sourceFile) >= 0) { - nodes.unshift(...node.getChildren()); - } - } + // NOTE: nodes.length changes inside of the loop but we only append to the end + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + nodes.push(...node.getChildren(sourceFile)); } - return result; + return nodes; } export function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null { @@ -379,7 +394,11 @@ export function addSymbolToNgModuleMetadata( let toInsert: string; if (node.properties.length == 0) { position = node.getEnd() - 1; - toInsert = `\n ${metadataField}: [\n${tags.indentBy(4)`${symbolName}`}\n ]\n`; + toInsert = ` + ${metadataField}: [ +${' '.repeat(4)}${symbolName} + ] +`; } else { const childNode = node.properties[node.properties.length - 1]; position = childNode.getEnd(); @@ -389,7 +408,7 @@ export function addSymbolToNgModuleMetadata( if (matches) { toInsert = `,${matches[0]}${metadataField}: [${matches[1]}` + - `${tags.indentBy(matches[2].length + 2)`${symbolName}`}${matches[0]}]`; + `${' '.repeat(matches[2].length + 2)}${symbolName}${matches[0]}]`; } else { toInsert = `, ${metadataField}: [${symbolName}]`; } @@ -418,8 +437,8 @@ export function addSymbolToNgModuleMetadata( const elements = assignmentInit.elements; if (elements.length) { - const symbolsArray = elements.map((node) => tags.oneLine`${node.getText()}`); - if (symbolsArray.includes(tags.oneLine`${symbolName}`)) { + const symbolsArray = elements.map((node) => node.getText()); + if (symbolsArray.includes(symbolName)) { return []; } @@ -433,13 +452,13 @@ export function addSymbolToNgModuleMetadata( if (ts.isArrayLiteralExpression(expression)) { // We found the field but it's empty. Insert it just before the `]`. position--; - toInsert = `\n${tags.indentBy(4)`${symbolName}`}\n `; + toInsert = `\n${' '.repeat(4)}${symbolName}\n `; } else { // Get the indentation of the last element, if any. const text = expression.getFullText(source); const matches = text.match(/^(\r?\n)(\s*)/); if (matches) { - toInsert = `,${matches[1]}${tags.indentBy(matches[2].length)`${symbolName}`}`; + toInsert = `,${matches[1]}${' '.repeat(matches[2].length)}${symbolName}`; } else { toInsert = `, ${symbolName}`; } diff --git a/packages/schematics/angular/utility/ast-utils_spec.ts b/packages/schematics/angular/utility/ast-utils_spec.ts index b5e2cda692c5..e8688844f2cd 100644 --- a/packages/schematics/angular/utility/ast-utils_spec.ts +++ b/packages/schematics/angular/utility/ast-utils_spec.ts @@ -6,11 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { tags } from '@angular-devkit/core'; import { HostTree } from '@angular-devkit/schematics'; import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript'; import { Change, InsertChange } from '../utility/change'; -import { getFileContent } from '../utility/test'; import { addDeclarationToModule, addExportToModule, @@ -38,7 +36,7 @@ function applyChanges(path: string, content: string, changes: Change[]): string } tree.commitUpdate(exportRecorder); - return getFileContent(tree, path); + return tree.readText(path); } describe('ast utils', () => { @@ -74,7 +72,7 @@ describe('ast utils', () => { }); it('should add export to module if not indented', () => { - moduleContent = tags.stripIndents`${moduleContent}`; + moduleContent = moduleContent.replace(/^(\s+)/gm, ''); const source = getTsSource(modulePath, moduleContent); const changes = addExportToModule(source, modulePath, 'FooComponent', './foo.component'); const output = applyChanges(modulePath, moduleContent, changes); @@ -83,7 +81,7 @@ describe('ast utils', () => { }); it('should add declarations to module if not indented', () => { - moduleContent = tags.stripIndents`${moduleContent}`; + moduleContent = moduleContent.replace(/^(\s+)/gm, ''); const source = getTsSource(modulePath, moduleContent); const changes = addDeclarationToModule(source, modulePath, 'FooComponent', './foo.component'); const output = applyChanges(modulePath, moduleContent, changes); @@ -92,7 +90,7 @@ describe('ast utils', () => { }); it('should add declarations to module when PropertyAssignment is StringLiteral', () => { - moduleContent = tags.stripIndents` + moduleContent = ` import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; @@ -111,7 +109,7 @@ describe('ast utils', () => { const changes = addDeclarationToModule(source, modulePath, 'FooComponent', './foo.component'); const output = applyChanges(modulePath, moduleContent, changes); expect(output).toMatch(/import { FooComponent } from '.\/foo.component';/); - expect(output).toMatch(/"declarations": \[\nAppComponent,\nFooComponent\n\]/); + expect(output).toMatch(/"declarations": \[\s*AppComponent,\s*FooComponent\s*\]/); }); it('should add metadata', () => { diff --git a/packages/schematics/angular/utility/change.ts b/packages/schematics/angular/utility/change.ts index e4055620258c..6736b29e594b 100644 --- a/packages/schematics/angular/utility/change.ts +++ b/packages/schematics/angular/utility/change.ts @@ -33,9 +33,9 @@ export interface Change { */ export class NoopChange implements Change { description = 'No operation.'; - order = Infinity; + order: number = Infinity; path = null; - apply() { + apply(): Promise { return Promise.resolve(); } } @@ -62,7 +62,7 @@ export class InsertChange implements Change { /** * This method does not insert spaces if there is none in the original string. */ - apply(host: Host) { + apply(host: Host): Promise { return host.read(this.path).then((content) => { const prefix = content.substring(0, this.pos); const suffix = content.substring(this.pos); diff --git a/packages/schematics/angular/utility/dependencies.ts b/packages/schematics/angular/utility/dependencies.ts index 06c4f38653bd..b90ba8796975 100644 --- a/packages/schematics/angular/utility/dependencies.ts +++ b/packages/schematics/angular/utility/dependencies.ts @@ -6,8 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ -import { Tree } from '@angular-devkit/schematics'; +import { Rule, Tree } from '@angular-devkit/schematics'; +import { TestRunner } from '../ng-new/schema'; +import { DependencyType, ExistingBehavior, InstallBehavior, addDependency } from './dependency'; import { JSONFile } from './json-file'; +import { latestVersions } from './latest-versions'; const PKG_JSON_PATH = '/package.json'; export enum NodeDependencyType { @@ -34,7 +37,7 @@ const ALL_DEPENDENCY_TYPE = [ export function addPackageJsonDependency( tree: Tree, dependency: NodeDependency, - pkgJsonPath = PKG_JSON_PATH, + pkgJsonPath: string = PKG_JSON_PATH, ): void { const json = new JSONFile(tree, pkgJsonPath); @@ -48,7 +51,7 @@ export function addPackageJsonDependency( export function removePackageJsonDependency( tree: Tree, name: string, - pkgJsonPath = PKG_JSON_PATH, + pkgJsonPath: string = PKG_JSON_PATH, ): void { const json = new JSONFile(tree, pkgJsonPath); @@ -60,7 +63,7 @@ export function removePackageJsonDependency( export function getPackageJsonDependency( tree: Tree, name: string, - pkgJsonPath = PKG_JSON_PATH, + pkgJsonPath: string = PKG_JSON_PATH, ): NodeDependency | null { const json = new JSONFile(tree, pkgJsonPath); @@ -78,3 +81,29 @@ export function getPackageJsonDependency( return null; } + +export function addTestRunnerDependencies( + testRunner: TestRunner | undefined, + skipInstall: boolean, +): Rule[] { + const dependencies = + testRunner === TestRunner.Vitest + ? ['vitest', 'jsdom'] + : [ + 'karma', + 'karma-chrome-launcher', + 'karma-coverage', + 'karma-jasmine', + 'karma-jasmine-html-reporter', + 'jasmine-core', + '@types/jasmine', + ]; + + return dependencies.map((name) => + addDependency(name, latestVersions[name], { + type: DependencyType.Dev, + existing: ExistingBehavior.Skip, + install: skipInstall ? InstallBehavior.None : InstallBehavior.Auto, + }), + ); +} diff --git a/packages/schematics/angular/utility/dependency.ts b/packages/schematics/angular/utility/dependency.ts index 2f3501c33a84..1cac91e5c5bf 100644 --- a/packages/schematics/angular/utility/dependency.ts +++ b/packages/schematics/angular/utility/dependency.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import { Rule, SchematicContext } from '@angular-devkit/schematics'; +import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import * as path from 'node:path'; @@ -73,6 +73,55 @@ export enum ExistingBehavior { Replace, } +/** + * Represents a dependency found in a package manifest. + */ +export interface Dependency { + /** + * The type of the dependency. + */ + type: DependencyType; + + /** + * The name of the package. + */ + name: string; + + /** + * The version specifier of the package. + */ + version: string; +} + +/** + * Gets information about a dependency from a `package.json` file. + * + * @param tree The schematic's virtual file system representation. + * @param name The name of the package to check. + * @param packageJsonPath The path to the `package.json` file. Defaults to `/package.json`. + * @returns An object containing the dependency's type and version, or null if not found. + */ +export function getDependency( + tree: Tree, + name: string, + packageJsonPath = '/package.json', +): Dependency | null { + const manifest = tree.readJson(packageJsonPath) as MinimalPackageManifest; + + for (const type of [DependencyType.Default, DependencyType.Dev, DependencyType.Peer]) { + const section = manifest[type]; + if (section?.[name]) { + return { + type, + name, + version: section[name], + }; + } + } + + return null; +} + /** * Adds a package as a dependency to a `package.json`. By default the `package.json` located * at the schematic's root will be used. The `manifestPath` option can be used to explicitly specify @@ -177,3 +226,59 @@ export function addDependency( } }; } + +/** + * Removes a package from the package.json in the project root. + * + * @param name The name of the package to remove. + * @param options An optional object that can contain a path of a manifest file to modify. + * @returns A Schematics {@link Rule} + */ +export function removeDependency( + name: string, + options: { + /** + * The path of the package manifest file (`package.json`) that will be modified. + * Defaults to `/package.json`. + */ + packageJsonPath?: string; + + /** + * The dependency installation behavior to use to determine whether a + * {@link NodePackageInstallTask} should be scheduled after removing the dependency. + * Defaults to {@link InstallBehavior.Auto}. + */ + install?: InstallBehavior; + } = {}, +): Rule { + const { packageJsonPath = '/package.json', install = InstallBehavior.Auto } = options; + + return (tree, context) => { + const manifest = tree.readJson(packageJsonPath) as MinimalPackageManifest; + let wasRemoved = false; + + for (const type of [DependencyType.Default, DependencyType.Dev, DependencyType.Peer]) { + const dependencySection = manifest[type]; + if (dependencySection?.[name]) { + delete dependencySection[name]; + wasRemoved = true; + } + } + + if (wasRemoved) { + tree.overwrite(packageJsonPath, JSON.stringify(manifest, null, 2)); + + const installPaths = installTasks.get(context) ?? new Set(); + if ( + install === InstallBehavior.Always || + (install === InstallBehavior.Auto && !installPaths.has(packageJsonPath)) + ) { + context.addTask( + new NodePackageInstallTask({ workingDirectory: path.dirname(packageJsonPath) }), + ); + installPaths.add(packageJsonPath); + installTasks.set(context, installPaths); + } + } + }; +} diff --git a/packages/schematics/angular/utility/dependency_spec.ts b/packages/schematics/angular/utility/dependency_spec.ts index be04a25db2d6..d1c92d11a6fa 100644 --- a/packages/schematics/angular/utility/dependency_spec.ts +++ b/packages/schematics/angular/utility/dependency_spec.ts @@ -15,7 +15,14 @@ import { callRule, chain, } from '@angular-devkit/schematics'; -import { DependencyType, ExistingBehavior, InstallBehavior, addDependency } from './dependency'; +import { + DependencyType, + ExistingBehavior, + InstallBehavior, + addDependency, + getDependency, + removeDependency, +} from './dependency'; interface LogEntry { type: 'warn'; @@ -484,3 +491,196 @@ describe('addDependency', () => { ); }); }); + +describe('removeDependency', () => { + it('removes a package from "dependencies"', async () => { + const tree = new EmptyTree(); + tree.create( + '/package.json', + JSON.stringify({ + dependencies: { '@angular/core': '^14.0.0' }, + }), + ); + + const rule = removeDependency('@angular/core'); + await testRule(rule, tree); + + expect(tree.readJson('/package.json')).toEqual({ + dependencies: {}, + }); + }); + + it('removes a package from "devDependencies"', async () => { + const tree = new EmptyTree(); + tree.create( + '/package.json', + JSON.stringify({ + devDependencies: { typescript: '~4.7.2' }, + }), + ); + + const rule = removeDependency('typescript'); + await testRule(rule, tree); + + expect(tree.readJson('/package.json')).toEqual({ + devDependencies: {}, + }); + }); + + it('removes a package from "peerDependencies"', async () => { + const tree = new EmptyTree(); + tree.create( + '/package.json', + JSON.stringify({ + peerDependencies: { rxjs: '^7.0.0' }, + }), + ); + + const rule = removeDependency('rxjs'); + await testRule(rule, tree); + + expect(tree.readJson('/package.json')).toEqual({ + peerDependencies: {}, + }); + }); + + it('does not change manifest if package is not found', async () => { + const tree = new EmptyTree(); + const manifest = { dependencies: { '@angular/core': '^14.0.0' } }; + tree.create('/package.json', JSON.stringify(manifest)); + + const rule = removeDependency('typescript'); + await testRule(rule, tree); + + expect(tree.readJson('/package.json')).toEqual(manifest); + }); + + it('schedules a package install task by default', async () => { + const tree = new EmptyTree(); + tree.create('/package.json', JSON.stringify({ dependencies: { '@angular/core': '1.0.0' } })); + + const rule = removeDependency('@angular/core'); + const { tasks } = await testRule(rule, tree); + + expect(tasks.map((task) => task.toConfiguration())).toEqual([ + { + name: 'node-package', + options: jasmine.objectContaining({ command: 'install', workingDirectory: '/' }), + }, + ]); + }); + + it('does not schedule a package install task if package not found', async () => { + const tree = new EmptyTree(); + tree.create('/package.json', JSON.stringify({ dependencies: {} })); + + const rule = removeDependency('@angular/core'); + const { tasks } = await testRule(rule, tree); + + expect(tasks).toEqual([]); + }); + + it('does not schedule a package install task when install behavior is none', async () => { + const tree = new EmptyTree(); + tree.create('/package.json', JSON.stringify({ dependencies: { '@angular/core': '1.0.0' } })); + + const rule = removeDependency('@angular/core', { install: InstallBehavior.None }); + const { tasks } = await testRule(rule, tree); + + expect(tasks).toEqual([]); + }); + + it('uses specified manifest when provided via "packageJsonPath" option', async () => { + const tree = new EmptyTree(); + tree.create('/package.json', JSON.stringify({ dependencies: { '@angular/core': '1.0.0' } })); + tree.create( + '/abc/package.json', + JSON.stringify({ dependencies: { '@angular/core': '1.0.0' } }), + ); + + const rule = removeDependency('@angular/core', { packageJsonPath: '/abc/package.json' }); + await testRule(rule, tree); + + expect(tree.readJson('/package.json')).toEqual({ dependencies: { '@angular/core': '1.0.0' } }); + expect(tree.readJson('/abc/package.json')).toEqual({ dependencies: {} }); + }); +}); + +describe('getDependency', () => { + it('returns a dependency found in "dependencies"', () => { + const tree = new EmptyTree(); + tree.create( + '/package.json', + JSON.stringify({ + dependencies: { '@angular/core': '^14.0.0' }, + }), + ); + + const dep = getDependency(tree, '@angular/core'); + expect(dep).toEqual({ + type: DependencyType.Default, + name: '@angular/core', + version: '^14.0.0', + }); + }); + + it('returns a dependency found in "devDependencies"', () => { + const tree = new EmptyTree(); + tree.create( + '/package.json', + JSON.stringify({ + devDependencies: { typescript: '~4.7.2' }, + }), + ); + + const dep = getDependency(tree, 'typescript'); + expect(dep).toEqual({ + type: DependencyType.Dev, + name: 'typescript', + version: '~4.7.2', + }); + }); + + it('returns a dependency found in "peerDependencies"', () => { + const tree = new EmptyTree(); + tree.create( + '/package.json', + JSON.stringify({ + peerDependencies: { rxjs: '^7.0.0' }, + }), + ); + + const dep = getDependency(tree, 'rxjs'); + expect(dep).toEqual({ + type: DependencyType.Peer, + name: 'rxjs', + version: '^7.0.0', + }); + }); + + it('returns null if a dependency is not found', () => { + const tree = new EmptyTree(); + tree.create('/package.json', JSON.stringify({})); + + const dep = getDependency(tree, '@angular/core'); + expect(dep).toBeNull(); + }); + + it('returns a dependency from a specified manifest path', () => { + const tree = new EmptyTree(); + tree.create('/package.json', JSON.stringify({})); + tree.create( + '/abc/package.json', + JSON.stringify({ + dependencies: { '@angular/core': '^14.0.0' }, + }), + ); + + const dep = getDependency(tree, '@angular/core', '/abc/package.json'); + expect(dep).toEqual({ + type: DependencyType.Default, + name: '@angular/core', + version: '^14.0.0', + }); + }); +}); diff --git a/packages/schematics/angular/utility/find-module.ts b/packages/schematics/angular/utility/find-module.ts index 69e10dc1368e..c98b52a0cbe2 100644 --- a/packages/schematics/angular/utility/find-module.ts +++ b/packages/schematics/angular/utility/find-module.ts @@ -20,8 +20,10 @@ export interface ModuleOptions { standalone?: boolean; } -export const MODULE_EXT = '.module.ts'; -export const ROUTING_MODULE_EXT = '-routing.module.ts'; +export const MODULE_EXT = '-module.ts'; +export const ROUTING_MODULE_EXT = '-routing-module.ts'; +export const MODULE_EXT_LEGACY = '.module.ts'; +export const ROUTING_MODULE_EXT_LEGACY = '-routing.module.ts'; /** * Find the module referred by a set of options passed to the schematics. @@ -31,13 +33,10 @@ export function findModuleFromOptions(host: Tree, options: ModuleOptions): Path return undefined; } - const moduleExt = options.moduleExt || MODULE_EXT; - const routingModuleExt = options.routingModuleExt || ROUTING_MODULE_EXT; - if (!options.module) { const pathToCheck = (options.path || '') + '/' + options.name; - return normalize(findModule(host, pathToCheck, moduleExt, routingModuleExt)); + return normalize(findModule(host, pathToCheck, options.moduleExt, options.routingModuleExt)); } else { const modulePath = normalize(`/${options.path}/${options.module}`); const componentPath = normalize(`/${options.path}/${options.name}`); @@ -53,14 +52,21 @@ export function findModuleFromOptions(host: Tree, options: ModuleOptions): Path } const candidatesDirs = [...candidateSet].sort((a, b) => b.length - a.length); - for (const c of candidatesDirs) { - const candidateFiles = ['', `${moduleBaseName}.ts`, `${moduleBaseName}${moduleExt}`].map( - (x) => join(c, x), + const candidateFiles: string[] = ['', `${moduleBaseName}.ts`]; + if (options.moduleExt) { + candidateFiles.push(`${moduleBaseName}${options.moduleExt}`); + } else { + candidateFiles.push( + `${moduleBaseName}${MODULE_EXT}`, + `${moduleBaseName}${MODULE_EXT_LEGACY}`, ); + } + for (const c of candidatesDirs) { for (const sc of candidateFiles) { - if (host.exists(sc) && host.readText(sc).includes('@NgModule')) { - return normalize(sc); + const scPath = join(c, sc); + if (host.exists(scPath) && host.readText(scPath).includes('@NgModule')) { + return normalize(scPath); } } } @@ -78,15 +84,22 @@ export function findModuleFromOptions(host: Tree, options: ModuleOptions): Path export function findModule( host: Tree, generateDir: string, - moduleExt = MODULE_EXT, - routingModuleExt = ROUTING_MODULE_EXT, + moduleExt?: string, + routingModuleExt?: string, ): Path { let dir: DirEntry | null = host.getDir('/' + generateDir); let foundRoutingModule = false; + const moduleExtensions: string[] = moduleExt ? [moduleExt] : [MODULE_EXT, MODULE_EXT_LEGACY]; + const routingModuleExtensions: string[] = routingModuleExt + ? [routingModuleExt] + : [ROUTING_MODULE_EXT, ROUTING_MODULE_EXT_LEGACY]; + while (dir) { - const allMatches = dir.subfiles.filter((p) => p.endsWith(moduleExt)); - const filteredMatches = allMatches.filter((p) => !p.endsWith(routingModuleExt)); + const allMatches = dir.subfiles.filter((p) => moduleExtensions.some((m) => p.endsWith(m))); + const filteredMatches = allMatches.filter( + (p) => !routingModuleExtensions.some((m) => p.endsWith(m)), + ); foundRoutingModule = foundRoutingModule || allMatches.length !== filteredMatches.length; diff --git a/packages/schematics/angular/utility/find-module_spec.ts b/packages/schematics/angular/utility/find-module_spec.ts index 9680f15949c8..0db295ae384f 100644 --- a/packages/schematics/angular/utility/find-module_spec.ts +++ b/packages/schematics/angular/utility/find-module_spec.ts @@ -143,6 +143,15 @@ describe('find-module', () => { expect(modPath).toEqual('/projects/my-proj/src/admin/foo.module.ts'); }); + it('should find a module in a sub dir when using the `-module` suffix', () => { + tree.create('/projects/my-proj/src/admin/foo-module.ts', '@NgModule'); + options.name = 'other/test'; + options.module = 'admin/foo'; + options.path = '/projects/my-proj/src'; + const modPath = findModuleFromOptions(tree, options) as string; + expect(modPath).toEqual('/projects/my-proj/src/admin/foo-module.ts'); + }); + it('should find a module in a sub dir (2)', () => { tree.create('/projects/my-proj/src/admin/foo.module.ts', '@NgModule'); options.name = 'admin/hello'; diff --git a/packages/schematics/angular/utility/generate-from-files.ts b/packages/schematics/angular/utility/generate-from-files.ts index 3f3547d5e6e2..23321ac2a6a2 100644 --- a/packages/schematics/angular/utility/generate-from-files.ts +++ b/packages/schematics/angular/utility/generate-from-files.ts @@ -34,6 +34,7 @@ export interface GenerateFromFilesOptions { skipTests?: boolean; templateFilesDirectory?: string; type?: string; + classifiedName?: string; } export function generateFromFiles( diff --git a/packages/schematics/angular/utility/json-file.ts b/packages/schematics/angular/utility/json-file.ts index dffb7a94f997..e7c767745b90 100644 --- a/packages/schematics/angular/utility/json-file.ts +++ b/packages/schematics/angular/utility/json-file.ts @@ -95,9 +95,16 @@ export class JSONFile { }, }); - this.content = applyEdits(this.content, edits); - this.host.overwrite(this.path, this.content); - this._jsonAst = undefined; + if (edits.length > 0) { + const editedContent = applyEdits(this.content, edits); + + // Update the file content if it changed + if (editedContent !== this.content) { + this.content = editedContent; + this.host.overwrite(this.path, editedContent); + this._jsonAst = undefined; + } + } } remove(jsonPath: JSONPath): void { diff --git a/packages/schematics/angular/utility/latest-versions/package.json b/packages/schematics/angular/utility/latest-versions/package.json index 7d83d4a83b31..29ef3658f23b 100644 --- a/packages/schematics/angular/utility/latest-versions/package.json +++ b/packages/schematics/angular/utility/latest-versions/package.json @@ -8,20 +8,24 @@ "@types/node": "^20.17.19", "browser-sync": "^3.0.0", "express": "^5.1.0", - "jasmine-core": "~5.7.0", + "jasmine-core": "~5.13.0", "jasmine-spec-reporter": "~7.0.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine": "~5.1.0", "karma": "~6.4.0", + "jsdom": "^27.1.0", "less": "^4.2.0", "postcss": "^8.5.3", "protractor": "~7.0.0", "rxjs": "~7.8.0", + "tailwindcss": "^4.1.12", + "@tailwindcss/postcss": "^4.1.12", "tslib": "^2.3.0", "ts-node": "~10.9.0", - "typescript": "~5.8.2", - "zone.js": "~0.15.0" + "typescript": "~5.9.2", + "vitest": "^4.0.8", + "zone.js": "~0.16.0" } } diff --git a/packages/schematics/angular/utility/project-targets.ts b/packages/schematics/angular/utility/project-targets.ts index 8897a3ddab66..a018d69c175a 100644 --- a/packages/schematics/angular/utility/project-targets.ts +++ b/packages/schematics/angular/utility/project-targets.ts @@ -21,3 +21,15 @@ export function isUsingApplicationBuilder(project: ProjectDefinition): boolean { return isUsingApplicationBuilder; } + +export function isZonelessApp(project: ProjectDefinition): boolean { + const buildTarget = project.targets.get('build'); + if (!buildTarget?.options?.polyfills) { + return true; + } + + const polyfills = buildTarget.options.polyfills as string[] | string; + const polyfillsList = Array.isArray(polyfills) ? polyfills : [polyfills]; + + return !polyfillsList.includes('zone.js'); +} diff --git a/packages/schematics/angular/utility/project.ts b/packages/schematics/angular/utility/project.ts new file mode 100644 index 000000000000..beef40630e4d --- /dev/null +++ b/packages/schematics/angular/utility/project.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; +import { ProjectDefinition, WorkspaceDefinition, getWorkspace } from './workspace'; + +/** + * Creates a schematic rule factory that provides project information to the given factory function. + * The project is determined from the `project` option. If the project is not found, an exception is + * thrown. + * + * @param factory The factory function that creates the schematic rule. + * @returns A schematic rule factory. + */ +export function createProjectSchematic( + factory: ( + options: S, + projectContext: { + project: ProjectDefinition; + workspace: WorkspaceDefinition; + tree: Tree; + context: SchematicContext; + }, + ) => Rule | Promise, +): (options: S) => Rule { + return (options) => async (tree, context) => { + const workspace = await getWorkspace(tree); + const project = workspace.projects.get(options.project); + + if (!project) { + throw new SchematicsException(`Project "${options.project}" does not exist.`); + } + + return factory(options, { project, workspace, tree, context }); + }; +} diff --git a/packages/schematics/angular/utility/standalone/code_block.ts b/packages/schematics/angular/utility/standalone/code_block.ts index 128c6076a41b..439699718cb9 100644 --- a/packages/schematics/angular/utility/standalone/code_block.ts +++ b/packages/schematics/angular/utility/standalone/code_block.ts @@ -75,7 +75,10 @@ export class CodeBlock { * @param initialCode Code pending transformed. * @param filePath Path of the file in which the code will be inserted. */ - static transformPendingCode(initialCode: PendingCode, filePath: string) { + static transformPendingCode( + initialCode: PendingCode, + filePath: string, + ): { code: PendingCode; rules: Rule[] } { const code = { ...initialCode }; const rules: Rule[] = []; diff --git a/packages/schematics/angular/utility/standalone/rules.ts b/packages/schematics/angular/utility/standalone/rules.ts index dc8e7518bafd..a926acd960e2 100644 --- a/packages/schematics/angular/utility/standalone/rules.ts +++ b/packages/schematics/angular/utility/standalone/rules.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import { tags } from '@angular-devkit/core'; import { Rule, SchematicsException, Tree, chain } from '@angular-devkit/schematics'; import ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; import { addSymbolToNgModuleMetadata, insertAfterLastOccurrence } from '../ast-utils'; @@ -188,7 +187,7 @@ function insertStandaloneRootProvider(tree: Tree, mainFilePath: string, expressi return; } - const newAppConfig = `, {\n${tags.indentBy(2)`providers: [${expression}]`}\n}`; + const newAppConfig = `, {\n${' '.repeat(2)}providers: [${expression}]\n}`; let targetCall: ts.CallExpression; if (bootstrapCall.arguments.length === 1) { @@ -240,7 +239,7 @@ function addProvidersExpressionToAppConfig( ), ]); } else { - const prop = tags.indentBy(2)`providers: [${expression}]`; + const prop = `${' '.repeat(2)}providers: [${expression}]`; let toInsert: string; let insertPosition: number; diff --git a/packages/schematics/angular/utility/standalone/rules_spec.ts b/packages/schematics/angular/utility/standalone/rules_spec.ts index 2be4d89c61d3..3208ed0d6f04 100644 --- a/packages/schematics/angular/utility/standalone/rules_spec.ts +++ b/packages/schematics/angular/utility/standalone/rules_spec.ts @@ -354,7 +354,6 @@ describe('standalone utilities', () => { host, ); - // eslint-disable-next-line @typescript-eslint/no-floating-promises await expectAsync(promise).toBeRejectedWithError( `Cannot add provider to invalid bootstrapApplication call in ${mainPath}`, ); @@ -384,7 +383,6 @@ describe('standalone utilities', () => { host, ); - // eslint-disable-next-line @typescript-eslint/no-floating-promises await expectAsync(promise).toBeRejectedWithError( `Cannot statically analyze bootstrapApplication call in ${mainPath}`, ); @@ -402,7 +400,6 @@ describe('standalone utilities', () => { host, ); - // eslint-disable-next-line @typescript-eslint/no-floating-promises await expectAsync(promise).toBeRejectedWithError('Bootstrap call not found'); }); }); @@ -447,7 +444,6 @@ describe('standalone utilities', () => { content, `providers: [ provideBrowserGlobalErrorListeners(), - provideZoneChangeDetection({ eventCoalescing:true }), provideModule([]), ]`, ); diff --git a/packages/schematics/angular/utility/standalone/util.ts b/packages/schematics/angular/utility/standalone/util.ts index 6d5648b68fd6..433967bce172 100644 --- a/packages/schematics/angular/utility/standalone/util.ts +++ b/packages/schematics/angular/utility/standalone/util.ts @@ -7,6 +7,7 @@ */ import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import { join } from 'node:path/posix'; import ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript'; import { Change, applyToUpdateRecorder } from '../change'; import { targetBuildNotFoundError } from '../project-targets'; @@ -23,16 +24,23 @@ export async function getMainFilePath(tree: Tree, projectName: string): Promise< const project = workspace.projects.get(projectName); const buildTarget = project?.targets.get('build'); - if (!buildTarget) { + if (!project || !buildTarget) { throw targetBuildNotFoundError(); } const options = buildTarget.options as Record; - return buildTarget.builder === Builders.Application || + if ( + buildTarget.builder === Builders.Application || buildTarget.builder === Builders.BuildApplication - ? options.browser - : options.main; + ) { + // These builders support a default of `/main.ts` + const projectSourceRoot = project.sourceRoot ?? join(project.root, 'src'); + + return options.browser ?? join(projectSourceRoot, 'main.ts'); + } + + return options.main; } /** @@ -129,7 +137,7 @@ function findImportLocalName( * @param path Path to the file that is being changed. * @param changes Changes that should be applied to the file. */ -export function applyChangesToFile(tree: Tree, path: string, changes: Change[]) { +export function applyChangesToFile(tree: Tree, path: string, changes: Change[]): void { if (changes.length > 0) { const recorder = tree.beginUpdate(path); applyToUpdateRecorder(recorder, changes); diff --git a/packages/schematics/angular/utility/test/get-file-content.ts b/packages/schematics/angular/utility/test/get-file-content.ts deleted file mode 100644 index 18cbb746e8f8..000000000000 --- a/packages/schematics/angular/utility/test/get-file-content.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { Tree } from '@angular-devkit/schematics'; - -export function getFileContent(tree: Tree, path: string): string { - const fileEntry = tree.get(path); - - if (!fileEntry) { - throw new Error(`The file (${path}) does not exist.`); - } - - return fileEntry.content.toString(); -} diff --git a/packages/schematics/angular/utility/test/index.ts b/packages/schematics/angular/utility/test/index.ts index 03261cb3a222..b9b32c0dad2a 100644 --- a/packages/schematics/angular/utility/test/index.ts +++ b/packages/schematics/angular/utility/test/index.ts @@ -7,4 +7,3 @@ */ export * from './create-app-module'; -export * from './get-file-content'; diff --git a/packages/schematics/angular/utility/validation.ts b/packages/schematics/angular/utility/validation.ts index 8b380d1b8262..54c3fddb815d 100644 --- a/packages/schematics/angular/utility/validation.ts +++ b/packages/schematics/angular/utility/validation.ts @@ -10,7 +10,7 @@ import { SchematicsException } from '@angular-devkit/schematics'; // Must start with a letter, and must contain only alphanumeric characters or dashes. // When adding a dash the segment after the dash must also start with a letter. -export const htmlSelectorRe = +export const htmlSelectorRe: RegExp = /^[a-zA-Z][.0-9a-zA-Z]*((:?-[0-9]+)*|(:?-[a-zA-Z][.0-9a-zA-Z]*(:?-[0-9]+)*)*)$/; // See: https://github.com/tc39/proposal-regexp-unicode-property-escapes/blob/fe6d07fad74cd0192d154966baa1e95e7cda78a1/README.md#other-examples diff --git a/packages/schematics/angular/utility/workspace-models.ts b/packages/schematics/angular/utility/workspace-models.ts index 34c329b470d1..e4a570410371 100644 --- a/packages/schematics/angular/utility/workspace-models.ts +++ b/packages/schematics/angular/utility/workspace-models.ts @@ -27,6 +27,7 @@ export enum Builders { BrowserEsbuild = '@angular-devkit/build-angular:browser-esbuild', Karma = '@angular-devkit/build-angular:karma', BuildKarma = '@angular/build:karma', + BuildUnitTest = '@angular/build:unit-test', TsLint = '@angular-devkit/build-angular:tslint', NgPackagr = '@angular-devkit/build-angular:ng-packagr', BuildNgPackagr = '@angular/build:ng-packagr', diff --git a/packages/schematics/angular/utility/workspace.ts b/packages/schematics/angular/utility/workspace.ts index b831458edf40..f8567fc534a3 100644 --- a/packages/schematics/angular/utility/workspace.ts +++ b/packages/schematics/angular/utility/workspace.ts @@ -81,7 +81,7 @@ export function updateWorkspace( */ export async function getWorkspace( tree: Tree, - path = DEFAULT_WORKSPACE_PATH, + path: string = DEFAULT_WORKSPACE_PATH, ): Promise { const host = new TreeWorkspaceHost(tree); diff --git a/packages/schematics/angular/web-worker/index.ts b/packages/schematics/angular/web-worker/index.ts index f04ef232f955..a19e2b714174 100644 --- a/packages/schematics/angular/web-worker/index.ts +++ b/packages/schematics/angular/web-worker/index.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import { join, normalize, tags } from '@angular-devkit/core'; import { Rule, + RuleFactory, SchematicContext, SchematicsException, Tree, @@ -21,9 +21,11 @@ import { strings, url, } from '@angular-devkit/schematics'; +import { join } from 'node:path/posix'; import { parseName } from '../utility/parse-name'; import { relativePathToWorkspaceRoot } from '../utility/paths'; -import { buildDefaultPath, getWorkspace, updateWorkspace } from '../utility/workspace'; +import { createProjectSchematic } from '../utility/project'; +import { buildDefaultPath, updateWorkspace } from '../utility/workspace'; import { Schema as WebWorkerOptions } from './schema'; function addSnippet(options: WebWorkerOptions): Rule { @@ -50,18 +52,18 @@ function addSnippet(options: WebWorkerOptions): Rule { const siblingModulePath = `${options.path}/${siblingModules[0]}`; const logMessage = 'console.log(`page got message: ${data}`);'; - const workerCreationSnippet = tags.stripIndent` - if (typeof Worker !== 'undefined') { - // Create a new - const worker = new Worker(new URL('./${options.name}.worker', import.meta.url)); - worker.onmessage = ({ data }) => { - ${logMessage} - }; - worker.postMessage('hello'); - } else { - // Web Workers are not supported in this environment. - // You should add a fallback so that your program still executes correctly. - } + const workerCreationSnippet = ` +if (typeof Worker !== 'undefined') { + // Create a new + const worker = new Worker(new URL('./${options.name}.worker', import.meta.url)); + worker.onmessage = ({ data }) => { + ${logMessage} + }; + worker.postMessage('hello'); +} else { + // Web Workers are not supported in this environment. + // You should add a fallback so that your program still executes correctly. +} `; // Append the worker creation snippet. @@ -72,19 +74,8 @@ function addSnippet(options: WebWorkerOptions): Rule { }; } -export default function (options: WebWorkerOptions): Rule { - return async (host: Tree) => { - const workspace = await getWorkspace(host); - - if (!options.project) { - throw new SchematicsException('Option "project" is required.'); - } - - const project = workspace.projects.get(options.project); - if (!project) { - throw new SchematicsException(`Invalid project name (${options.project})`); - } - +const webWorkerSchematic: RuleFactory = createProjectSchematic( + (options, { project }) => { const projectType = project.extensions['projectType']; if (projectType !== 'application') { throw new SchematicsException(`Web Worker requires a project type of "application".`); @@ -122,7 +113,7 @@ export default function (options: WebWorkerOptions): Rule { throw new Error(`Build target is not defined for this project.`); } - const workerConfigPath = join(normalize(root), 'tsconfig.worker.json'); + const workerConfigPath = join(root, 'tsconfig.worker.json'); (buildTarget.options ??= {}).webWorkerTsConfig ??= workerConfigPath; if (testTarget) { (testTarget.options ??= {}).webWorkerTsConfig ??= workerConfigPath; @@ -134,5 +125,7 @@ export default function (options: WebWorkerOptions): Rule { mergeWith(templateSourceWorkerCode), mergeWith(templateSourceWorkerConfig), ]); - }; -} + }, +); + +export default webWorkerSchematic; diff --git a/packages/schematics/angular/workspace/files/README.md.template b/packages/schematics/angular/workspace/files/README.md.template index 85cba41ab1ea..3cf62f4dabcc 100644 --- a/packages/schematics/angular/workspace/files/README.md.template +++ b/packages/schematics/angular/workspace/files/README.md.template @@ -38,7 +38,7 @@ This will compile your project and store the build artifacts in the `dist/` dire ## Running unit tests -To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: +To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command: ```bash ng test diff --git a/packages/schematics/angular/workspace/files/__dot__gitignore.template b/packages/schematics/angular/workspace/files/__dot__gitignore.template index cc7b141350ff..854acd5fc039 100644 --- a/packages/schematics/angular/workspace/files/__dot__gitignore.template +++ b/packages/schematics/angular/workspace/files/__dot__gitignore.template @@ -26,6 +26,7 @@ yarn-error.log !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json +!.vscode/mcp.json .history/* # Miscellaneous @@ -36,6 +37,7 @@ yarn-error.log /libpeerconnection.log testem.log /typings +__screenshots__/ # System files .DS_Store diff --git a/packages/schematics/angular/workspace/files/__dot__vscode/mcp.json.template b/packages/schematics/angular/workspace/files/__dot__vscode/mcp.json.template new file mode 100644 index 000000000000..bf4004da9477 --- /dev/null +++ b/packages/schematics/angular/workspace/files/__dot__vscode/mcp.json.template @@ -0,0 +1,9 @@ +{ + // For more information, visit: https://angular.dev/ai/mcp + "mcpServers": { + "angular-cli": { + "command": "npx", + "args": ["-y", "@angular/cli", "mcp"] + } + } +} diff --git a/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template b/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template index f3125a95b776..96e9e1c26833 100644 --- a/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template +++ b/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template @@ -12,10 +12,10 @@ "background": { "activeOnStart": true, "beginsPattern": { - "regexp": "(.*?)" + "regexp": "Changes detected" }, "endsPattern": { - "regexp": "bundle generation complete" + "regexp": "bundle generation (complete|failed)" } } } @@ -30,10 +30,10 @@ "background": { "activeOnStart": true, "beginsPattern": { - "regexp": "(.*?)" + "regexp": "Changes detected" }, "endsPattern": { - "regexp": "bundle generation complete" + "regexp": "bundle generation (complete|failed)" } } } diff --git a/packages/schematics/angular/workspace/files/package.json.template b/packages/schematics/angular/workspace/files/package.json.template index 4ee0cdd9ab73..790f65acf407 100644 --- a/packages/schematics/angular/workspace/files/package.json.template +++ b/packages/schematics/angular/workspace/files/package.json.template @@ -8,7 +8,20 @@ "watch": "ng build --watch --configuration development"<% if (!minimal) { %>, "test": "ng test"<% } %> }, + "prettier": { + "printWidth": 100, + "singleQuote": true, + "overrides": [ + { + "files": "*.html", + "options": { + "parser": "angular" + } + } + ] + }, "private": true, + <% if (packageManagerWithVersion) { %>"packageManager": "<%= packageManagerWithVersion %>",<% } %> "dependencies": { "@angular/common": "<%= latestVersions.Angular %>", "@angular/compiler": "<%= latestVersions.Angular %>", @@ -17,19 +30,11 @@ "@angular/platform-browser": "<%= latestVersions.Angular %>", "@angular/router": "<%= latestVersions.Angular %>", "rxjs": "<%= latestVersions['rxjs'] %>", - "tslib": "<%= latestVersions['tslib'] %>", - "zone.js": "<%= latestVersions['zone.js'] %>" + "tslib": "<%= latestVersions['tslib'] %>" }, "devDependencies": { "@angular/cli": "<%= '^' + version %>", - "@angular/compiler-cli": "<%= latestVersions.Angular %>",<% if (!minimal) { %> - "@types/jasmine": "<%= latestVersions['@types/jasmine'] %>", - "jasmine-core": "<%= latestVersions['jasmine-core'] %>", - "karma": "<%= latestVersions['karma'] %>", - "karma-chrome-launcher": "<%= latestVersions['karma-chrome-launcher'] %>", - "karma-coverage": "<%= latestVersions['karma-coverage'] %>", - "karma-jasmine": "<%= latestVersions['karma-jasmine'] %>", - "karma-jasmine-html-reporter": "<%= latestVersions['karma-jasmine-html-reporter'] %>",<% } %> + "@angular/compiler-cli": "<%= latestVersions.Angular %>", "typescript": "<%= latestVersions['typescript'] %>" } } diff --git a/packages/schematics/angular/workspace/files/tsconfig.json.template b/packages/schematics/angular/workspace/files/tsconfig.json.template index 798ec8305a16..d51e03ac01fe 100644 --- a/packages/schematics/angular/workspace/files/tsconfig.json.template +++ b/packages/schematics/angular/workspace/files/tsconfig.json.template @@ -19,7 +19,6 @@ "enableI18nLegacyMessageIdFormat": false<% if (strict) { %>, "strictInjectionParameters": true, "strictInputAccessModifiers": true, - "typeCheckHostBindings": true, "strictTemplates": true<% } %> }, "files": [] diff --git a/packages/schematics/angular/workspace/index.ts b/packages/schematics/angular/workspace/index.ts index 4a47de7ec7b8..85205042f3e3 100644 --- a/packages/schematics/angular/workspace/index.ts +++ b/packages/schematics/angular/workspace/index.ts @@ -16,19 +16,46 @@ import { strings, url, } from '@angular-devkit/schematics'; +import { execSync } from 'node:child_process'; import { latestVersions } from '../utility/latest-versions'; import { Schema as WorkspaceOptions } from './schema'; export default function (options: WorkspaceOptions): Rule { - return mergeWith( - apply(url('./files'), [ - options.minimal ? filter((path) => !path.endsWith('editorconfig.template')) : noop(), - applyTemplates({ - utils: strings, - ...options, - 'dot': '.', - latestVersions, - }), - ]), - ); + return () => { + const packageManager = options.packageManager; + let packageManagerWithVersion: string | undefined; + + if (packageManager) { + let packageManagerVersion: string | undefined; + try { + packageManagerVersion = execSync(`${packageManager} --version`, { + encoding: 'utf8', + stdio: 'pipe', + env: { + ...process.env, + // NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes. + NO_UPDATE_NOTIFIER: '1', + NPM_CONFIG_UPDATE_NOTIFIER: 'false', + }, + }).trim(); + } catch {} + + if (packageManagerVersion) { + packageManagerWithVersion = `${packageManager}@${packageManagerVersion}`; + } + } + + return mergeWith( + apply(url('./files'), [ + options.minimal ? filter((path) => !path.endsWith('editorconfig.template')) : noop(), + applyTemplates({ + utils: strings, + ...options, + 'dot': '.', + latestVersions, + packageManagerWithVersion, + }), + ]), + ); + }; } diff --git a/packages/schematics/angular/workspace/index_spec.ts b/packages/schematics/angular/workspace/index_spec.ts index 520452e71b89..65dd7987aa41 100644 --- a/packages/schematics/angular/workspace/index_spec.ts +++ b/packages/schematics/angular/workspace/index_spec.ts @@ -23,13 +23,13 @@ describe('Workspace Schematic', () => { it('should create all files of a workspace', async () => { const options = { ...defaultOptions }; - const tree = await schematicRunner.runSchematic('workspace', options); const files = tree.files; expect(files).toEqual( jasmine.arrayContaining([ '/.vscode/extensions.json', '/.vscode/launch.json', + '/.vscode/mcp.json', '/.vscode/tasks.json', '/.editorconfig', '/angular.json', @@ -58,7 +58,6 @@ describe('Workspace Schematic', () => { const pkg = JSON.parse(tree.readContent('/package.json')); expect(pkg.dependencies['@angular/core']).toEqual(latestVersions.Angular); expect(pkg.dependencies['rxjs']).toEqual(latestVersions['rxjs']); - expect(pkg.dependencies['zone.js']).toEqual(latestVersions['zone.js']); expect(pkg.devDependencies['typescript']).toEqual(latestVersions['typescript']); }); @@ -72,6 +71,7 @@ describe('Workspace Schematic', () => { jasmine.arrayContaining([ '/.vscode/extensions.json', '/.vscode/launch.json', + '/.vscode/mcp.json', '/.vscode/tasks.json', '/angular.json', '/.gitignore', @@ -134,4 +134,10 @@ describe('Workspace Schematic', () => { const { tasks } = parseJson(tree.readContent('.vscode/tasks.json').toString()); expect(tasks).not.toContain(jasmine.objectContaining({ type: 'npm', script: 'test' })); }); + + it('should include prettier config overrides for Angular templates', async () => { + const tree = await schematicRunner.runSchematic('workspace', defaultOptions); + const pkg = JSON.parse(tree.readContent('/package.json')); + expect(pkg.prettier).withContext('package.json#prettier is present').toBeTruthy(); + }); }); diff --git a/packages/schematics/angular/workspace/schema.json b/packages/schematics/angular/workspace/schema.json index cd09b5d870c0..51ec1a22e889 100644 --- a/packages/schematics/angular/workspace/schema.json +++ b/packages/schematics/angular/workspace/schema.json @@ -40,7 +40,10 @@ "packageManager": { "description": "The package manager to use for installing dependencies.", "type": "string", - "enum": ["npm", "yarn", "pnpm", "cnpm", "bun"] + "enum": ["npm", "yarn", "pnpm", "bun"], + "$default": { + "$source": "packageManager" + } } }, "required": ["name", "version"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2bb2fefd3fbd..836c840b056a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,87 +5,95 @@ settings: excludeLinksFromLockfile: false overrides: - typescript: 5.8.3 + undici-types: ^7.16.0 '@angular/build': workspace:* -packageExtensionsChecksum: d67b1f07b351844d00c57cbace376860 +packageExtensionsChecksum: sha256-3L73Fw32UVtE6x5BJxJPBtQtH/mgsr31grNpdhHP1IY= importers: .: + dependenciesMeta: + esbuild: + built: true + puppeteer: + built: true devDependencies: '@angular/animations': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) '@angular/cdk': - specifier: 20.0.0-next.10 - version: 20.0.0-next.10(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) + specifier: 21.1.0-next.3 + version: 21.1.0-next.3(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) '@angular/common': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) '@angular/compiler': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9 + specifier: 21.1.0-next.4 + version: 21.1.0-next.4 '@angular/compiler-cli': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3) '@angular/core': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) '@angular/forms': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) '@angular/localize': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/compiler-cli@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3))(@angular/compiler@20.0.0-next.9) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/compiler-cli@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3))(@angular/compiler@21.1.0-next.4) '@angular/material': - specifier: 20.0.0-next.10 - version: 20.0.0-next.10(xotmywbppgelv3sapeuqfwdbqe) + specifier: 21.1.0-next.3 + version: 21.1.0-next.3(5911ac44acdb5e81564606f5886cc827) '@angular/ng-dev': - specifier: https://github.com/angular/dev-infra-private-ng-dev-builds.git#1125d8dbec5e787d9579e5b218b60a3be64c50fa - version: https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/1125d8dbec5e787d9579e5b218b60a3be64c50fa(encoding@0.1.13) + specifier: https://github.com/angular/dev-infra-private-ng-dev-builds.git#ddc3809c1993612732eaae62d28e828b2ed789e5 + version: https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/ddc3809c1993612732eaae62d28e828b2ed789e5(@modelcontextprotocol/sdk@1.25.0(zod@4.2.1)) '@angular/platform-browser': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) '@angular/platform-server': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/compiler@20.0.0-next.9)(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/compiler@21.1.0-next.4)(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) '@angular/router': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) '@angular/service-worker': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@babel/core': + specifier: 7.28.5 + version: 7.28.5 '@bazel/bazelisk': specifier: 1.26.0 version: 1.26.0 '@bazel/buildifier': - specifier: 8.2.0 - version: 8.2.0 + specifier: 8.2.1 + version: 8.2.1 '@eslint/compat': - specifier: 1.2.9 - version: 1.2.9(eslint@9.26.0(jiti@1.21.7)) + specifier: 2.0.0 + version: 2.0.0(eslint@9.39.2(jiti@2.6.1)) '@eslint/eslintrc': - specifier: 3.3.1 - version: 3.3.1 + specifier: 3.3.3 + version: 3.3.3 '@eslint/js': - specifier: 9.26.0 - version: 9.26.0 + specifier: 9.39.2 + version: 9.39.2 '@rollup/plugin-alias': - specifier: ^5.1.1 - version: 5.1.1(rollup@4.40.2) + specifier: ^6.0.0 + version: 6.0.0(rollup@4.53.5) '@rollup/plugin-commonjs': - specifier: ^28.0.0 - version: 28.0.3(rollup@4.40.2) + specifier: ^29.0.0 + version: 29.0.0(rollup@4.53.5) '@rollup/plugin-json': specifier: ^6.1.0 - version: 6.1.0(rollup@4.40.2) + version: 6.1.0(rollup@4.53.5) '@rollup/plugin-node-resolve': - specifier: 16.0.1 - version: 16.0.1(rollup@4.40.2) + specifier: 16.0.3 + version: 16.0.3(rollup@4.53.5) '@stylistic/eslint-plugin': - specifier: ^4.0.0 - version: 4.2.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) + specifier: ^5.0.0 + version: 5.6.1(eslint@9.39.2(jiti@2.6.1)) '@types/babel__core': specifier: 7.20.5 version: 7.20.5 @@ -94,19 +102,19 @@ importers: version: 7.27.0 '@types/browser-sync': specifier: ^2.27.0 - version: 2.29.0 + version: 2.29.1 '@types/express': specifier: ~5.0.1 - version: 5.0.1 + version: 5.0.6 '@types/http-proxy': specifier: ^1.17.4 - version: 1.17.16 + version: 1.17.17 '@types/ini': specifier: ^4.0.0 version: 4.1.1 '@types/jasmine': specifier: ~5.1.0 - version: 5.1.8 + version: 5.1.13 '@types/jasmine-reporters': specifier: ^2 version: 2.5.3 @@ -117,14 +125,14 @@ importers: specifier: ^3.0.3 version: 3.0.8 '@types/loader-utils': - specifier: ^2.0.0 - version: 2.0.6 + specifier: ^3.0.0 + version: 3.0.0(esbuild@0.27.1) '@types/lodash': specifier: ^4.17.0 - version: 4.17.16 + version: 4.17.21 '@types/node': - specifier: ^20.17.19 - version: 20.17.44 + specifier: ^22.12.0 + version: 22.19.3 '@types/npm-package-arg': specifier: ^6.1.0 version: 6.1.4 @@ -133,7 +141,7 @@ importers: version: 11.1.8 '@types/picomatch': specifier: ^4.0.0 - version: 4.0.0 + version: 4.0.2 '@types/progress': specifier: ^2.0.3 version: 2.0.7 @@ -142,16 +150,13 @@ importers: version: 1.20.6 '@types/semver': specifier: ^7.3.12 - version: 7.7.0 - '@types/shelljs': - specifier: ^0.8.11 - version: 0.8.15 + version: 7.7.1 '@types/watchpack': specifier: ^2.4.4 - version: 2.4.4 + version: 2.4.5 '@types/yargs': specifier: ^17.0.20 - version: 17.0.33 + version: 17.0.35 '@types/yargs-parser': specifier: ^21.0.0 version: 21.0.3 @@ -159,53 +164,47 @@ importers: specifier: ^1.1.5 version: 1.1.9 '@typescript-eslint/eslint-plugin': - specifier: 8.32.0 - version: 8.32.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) + specifier: 8.50.0 + version: 8.50.0(@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) '@typescript-eslint/parser': - specifier: 8.32.0 - version: 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) + specifier: 8.50.0 + version: 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) ajv: specifier: 8.17.1 version: 8.17.1 - ansi-colors: - specifier: 4.1.3 - version: 4.1.3 - beasties: - specifier: 0.3.3 - version: 0.3.3 buffer: specifier: 6.0.3 version: 6.0.3 esbuild: - specifier: 0.25.4 - version: 0.25.4 + specifier: 0.27.1 + version: 0.27.1 esbuild-wasm: - specifier: 0.25.4 - version: 0.25.4 + specifier: 0.27.1 + version: 0.27.1 eslint: - specifier: 9.26.0 - version: 9.26.0(jiti@1.21.7) + specifier: 9.39.2 + version: 9.39.2(jiti@2.6.1) eslint-config-prettier: - specifier: 10.1.2 - version: 10.1.2(eslint@9.26.0(jiti@1.21.7)) + specifier: 10.1.8 + version: 10.1.8(eslint@9.39.2(jiti@2.6.1)) eslint-plugin-header: specifier: 3.1.1 - version: 3.1.1(eslint@9.26.0(jiti@1.21.7)) + version: 3.1.1(eslint@9.39.2(jiti@2.6.1)) eslint-plugin-import: - specifier: 2.31.0 - version: 2.31.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.26.0(jiti@1.21.7)) + specifier: 2.32.0 + version: 2.32.0(@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1)) express: - specifier: 5.1.0 - version: 5.1.0 + specifier: 5.2.1 + version: 5.2.1 fast-glob: specifier: 3.3.3 version: 3.3.3 globals: - specifier: 16.0.0 - version: 16.0.0 + specifier: 16.5.0 + version: 16.5.0 http-proxy: specifier: ^1.18.1 - version: 1.18.1(debug@4.4.0) + version: 1.18.1(debug@4.4.3) http-proxy-middleware: specifier: 3.0.5 version: 3.0.5 @@ -213,11 +212,11 @@ importers: specifier: 9.1.7 version: 9.1.7 jasmine: - specifier: ~5.7.0 - version: 5.7.1 + specifier: ~5.13.0 + version: 5.13.0 jasmine-core: - specifier: ~5.7.0 - version: 5.7.1 + specifier: ~5.13.0 + version: 5.13.0 jasmine-reporters: specifier: ^2.5.2 version: 2.5.2 @@ -226,7 +225,7 @@ importers: version: 7.0.0 karma: specifier: ~6.4.0 - version: 6.4.4 + version: 6.4.4(bufferutil@4.0.9) karma-chrome-launcher: specifier: ~3.2.0 version: 3.2.0 @@ -235,93 +234,73 @@ importers: version: 2.2.1 karma-jasmine: specifier: ~5.1.0 - version: 5.1.0(karma@6.4.4) + version: 5.1.0(karma@6.4.4(bufferutil@4.0.9)) karma-jasmine-html-reporter: specifier: ~2.1.0 - version: 2.1.0(jasmine-core@5.7.1)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) + version: 2.1.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.0.9)))(karma@6.4.4(bufferutil@4.0.9)) karma-source-map-support: specifier: 1.4.0 version: 1.4.0 - listr2: - specifier: 8.3.3 - version: 8.3.3 lodash: specifier: ^4.17.21 version: 4.17.21 magic-string: - specifier: 0.30.17 - version: 0.30.17 - npm: - specifier: ^11.0.0 - version: 11.3.0 + specifier: 0.30.21 + version: 0.30.21 prettier: specifier: ^3.0.0 - version: 3.5.3 + version: 3.7.4 protractor: specifier: ~7.0.0 version: 7.0.0 puppeteer: specifier: 18.2.1 - version: 18.2.1(encoding@0.1.13) + version: 18.2.1(bufferutil@4.0.9)(encoding@0.1.13) quicktype-core: - specifier: 23.1.3 - version: 23.1.3(encoding@0.1.13) + specifier: 23.2.6 + version: 23.2.6(encoding@0.1.13) rollup: - specifier: 4.40.2 - version: 4.40.2 + specifier: 4.53.5 + version: 4.53.5 rollup-license-plugin: - specifier: ~3.0.1 - version: 3.0.2 + specifier: ~3.1.0 + version: 3.1.0 rollup-plugin-dts: - specifier: 6.2.1 - version: 6.2.1(rollup@4.40.2)(typescript@5.8.3) + specifier: 6.3.0 + version: 6.3.0(rollup@4.53.5)(typescript@5.9.3) rollup-plugin-sourcemaps2: - specifier: 0.5.1 - version: 0.5.1(@types/node@20.17.44)(rollup@4.40.2) + specifier: 0.5.4 + version: 0.5.4(@types/node@22.19.3)(rollup@4.53.5) semver: - specifier: 7.7.1 - version: 7.7.1 - shelljs: - specifier: ^0.9.0 - version: 0.9.2 + specifier: 7.7.3 + version: 7.7.3 source-map-support: specifier: 0.5.21 version: 0.5.21 - tar: - specifier: ^7.0.0 - version: 7.4.3 ts-node: specifier: ^10.9.1 - version: 10.9.2(@types/node@20.17.44)(typescript@5.8.3) + version: 10.9.2(@types/node@22.19.3)(typescript@5.9.3) tslib: specifier: 2.8.1 version: 2.8.1 typescript: - specifier: 5.8.3 - version: 5.8.3 + specifier: 5.9.3 + version: 5.9.3 undici: - specifier: 7.8.0 - version: 7.8.0 + specifier: 7.16.0 + version: 7.16.0 unenv: specifier: ^1.10.0 version: 1.10.0 verdaccio: - specifier: 6.1.2 - version: 6.1.2(encoding@0.1.13) + specifier: 6.2.4 + version: 6.2.4(encoding@0.1.13) verdaccio-auth-memory: specifier: ^10.0.0 - version: 10.2.2 - yargs-parser: - specifier: 21.1.1 - version: 21.1.1 + version: 10.3.1 zone.js: - specifier: ^0.15.0 - version: 0.15.0 - dependenciesMeta: - esbuild: - built: true - puppeteer: - built: true + specifier: ^0.16.0 + version: 0.16.0 modules/testing/builder: devDependencies: @@ -337,12 +316,21 @@ importers: '@angular/ssr': specifier: workspace:* version: link:../../../packages/angular/ssr + '@vitest/coverage-v8': + specifier: 4.0.15 + version: 4.0.15(vitest@4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) + browser-sync: + specifier: 3.0.4 + version: 3.0.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + jsdom: + specifier: 27.3.0 + version: 27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) rxjs: specifier: 7.8.2 version: 7.8.2 vitest: - specifier: 3.1.3 - version: 3.1.3(@types/node@20.17.44)(jiti@1.21.7)(jsdom@26.1.0)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) + specifier: 4.0.15 + version: 4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) packages/angular/build: dependencies: @@ -353,32 +341,32 @@ importers: specifier: workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER version: link:../../angular_devkit/architect '@babel/core': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.28.5 + version: 7.28.5 '@babel/helper-annotate-as-pure': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.27.3 + version: 7.27.3 '@babel/helper-split-export-declaration': specifier: 7.24.7 version: 7.24.7 '@inquirer/confirm': - specifier: 5.1.9 - version: 5.1.9(@types/node@20.17.44) + specifier: 5.1.21 + version: 5.1.21(@types/node@24.10.4) '@vitejs/plugin-basic-ssl': - specifier: 2.0.0 - version: 2.0.0(vite@6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1)) + specifier: 2.1.0 + version: 2.1.0(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) beasties: - specifier: 0.3.3 - version: 0.3.3 + specifier: 0.3.5 + version: 0.3.5 browserslist: - specifier: ^4.23.0 - version: 4.24.5 + specifier: ^4.26.0 + version: 4.28.1 esbuild: - specifier: 0.25.4 - version: 0.25.4 + specifier: 0.27.1 + version: 0.27.1 https-proxy-agent: specifier: 7.0.6 - version: 7.0.6(supports-color@10.0.0) + version: 7.0.6(supports-color@10.2.2) istanbul-lib-instrument: specifier: 6.0.3 version: 6.0.3 @@ -386,48 +374,47 @@ importers: specifier: 3.3.1 version: 3.3.1 listr2: - specifier: 8.3.3 - version: 8.3.3 + specifier: 9.0.5 + version: 9.0.5 magic-string: - specifier: 0.30.17 - version: 0.30.17 + specifier: 0.30.21 + version: 0.30.21 mrmime: specifier: 2.0.1 version: 2.0.1 parse5-html-rewriting-stream: - specifier: 7.1.0 - version: 7.1.0 + specifier: 8.0.0 + version: 8.0.0 picomatch: - specifier: 4.0.2 - version: 4.0.2 + specifier: 4.0.3 + version: 4.0.3 piscina: - specifier: 5.0.0 - version: 5.0.0 - rollup: - specifier: 4.40.2 - version: 4.40.2 + specifier: 5.1.4 + version: 5.1.4 + rolldown: + specifier: 1.0.0-beta.54 + version: 1.0.0-beta.54 sass: - specifier: 1.87.0 - version: 1.87.0 + specifier: 1.97.0 + version: 1.97.0 semver: - specifier: 7.7.1 - version: 7.7.1 + specifier: 7.7.3 + version: 7.7.3 source-map-support: specifier: 0.5.21 version: 0.5.21 tinyglobby: - specifier: 0.2.13 - version: 0.2.13 + specifier: 0.2.15 + version: 0.2.15 + undici: + specifier: 7.16.0 + version: 7.16.0 vite: - specifier: 6.3.5 - version: 6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) + specifier: 7.3.0 + version: 7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) watchpack: - specifier: 2.4.2 - version: 2.4.2 - optionalDependencies: - lmdb: - specifier: 3.3.0 - version: 3.3.0 + specifier: 2.4.4 + version: 2.4.4 devDependencies: '@angular-devkit/core': specifier: workspace:* @@ -436,23 +423,27 @@ importers: specifier: workspace:* version: link:../ssr jsdom: - specifier: 26.1.0 - version: 26.1.0 + specifier: 27.3.0 + version: 27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) less: - specifier: 4.3.0 - version: 4.3.0 + specifier: 4.4.2 + version: 4.4.2 ng-packagr: - specifier: 20.0.0-rc.0 - version: 20.0.0-rc.0(@angular/compiler-cli@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3))(tslib@2.8.1)(typescript@5.8.3) + specifier: 21.1.0-next.0 + version: 21.1.0-next.0(@angular/compiler-cli@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3))(tslib@2.8.1)(typescript@5.9.3) postcss: - specifier: 8.5.3 - version: 8.5.3 + specifier: 8.5.6 + version: 8.5.6 rxjs: specifier: 7.8.2 version: 7.8.2 vitest: - specifier: 3.1.3 - version: 3.1.3(@types/node@20.17.44)(jiti@1.21.7)(jsdom@26.1.0)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) + specifier: 4.0.15 + version: 4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + optionalDependencies: + lmdb: + specifier: 3.4.4 + version: 3.4.4 packages/angular/cli: dependencies: @@ -466,44 +457,53 @@ importers: specifier: workspace:0.0.0-PLACEHOLDER version: link:../../angular_devkit/schematics '@inquirer/prompts': - specifier: 7.5.0 - version: 7.5.0(@types/node@20.17.44) + specifier: 7.10.1 + version: 7.10.1(@types/node@24.10.4) '@listr2/prompt-adapter-inquirer': - specifier: 2.0.22 - version: 2.0.22(@inquirer/prompts@7.5.0(@types/node@20.17.44)) + specifier: 3.0.5 + version: 3.0.5(@inquirer/prompts@7.10.1(@types/node@24.10.4))(@types/node@24.10.4)(listr2@9.0.5) + '@modelcontextprotocol/sdk': + specifier: 1.25.0 + version: 1.25.0(zod@4.2.1) '@schematics/angular': specifier: workspace:0.0.0-PLACEHOLDER version: link:../../schematics/angular '@yarnpkg/lockfile': specifier: 1.1.0 version: 1.1.0 + algoliasearch: + specifier: 5.46.0 + version: 5.46.0 ini: - specifier: 5.0.0 - version: 5.0.0 + specifier: 6.0.0 + version: 6.0.0 jsonc-parser: specifier: 3.3.1 version: 3.3.1 listr2: - specifier: 8.3.3 - version: 8.3.3 + specifier: 9.0.5 + version: 9.0.5 npm-package-arg: - specifier: 12.0.2 - version: 12.0.2 - npm-pick-manifest: - specifier: 10.0.0 - version: 10.0.0 + specifier: 13.0.2 + version: 13.0.2 pacote: - specifier: 20.0.0 - version: 20.0.0 + specifier: 21.0.4 + version: 21.0.4 + parse5-html-rewriting-stream: + specifier: 8.0.0 + version: 8.0.0 resolve: - specifier: 1.22.10 - version: 1.22.10 + specifier: 1.22.11 + version: 1.22.11 semver: - specifier: 7.7.1 - version: 7.7.1 + specifier: 7.7.3 + version: 7.7.3 yargs: - specifier: 17.7.2 - version: 17.7.2 + specifier: 18.0.0 + version: 18.0.0 + zod: + specifier: 4.2.1 + version: 4.2.1 packages/angular/pwa: dependencies: @@ -514,8 +514,8 @@ importers: specifier: workspace:0.0.0-PLACEHOLDER version: link:../../schematics/angular parse5-html-rewriting-stream: - specifier: 7.1.0 - version: 7.1.0 + specifier: 8.0.0 + version: 8.0.0 packages/angular/ssr: dependencies: @@ -527,26 +527,29 @@ importers: specifier: workspace:* version: link:../../angular_devkit/schematics '@angular/common': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) '@angular/compiler': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9 + specifier: 21.1.0-next.4 + version: 21.1.0-next.4 '@angular/core': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) '@angular/platform-browser': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) '@angular/platform-server': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/compiler@20.0.0-next.9)(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/compiler@21.1.0-next.4)(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) '@angular/router': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) '@schematics/angular': specifier: workspace:* version: link:../../schematics/angular + beasties: + specifier: 0.3.5 + version: 0.3.5 packages/angular_devkit/architect: dependencies: @@ -562,22 +565,6 @@ importers: '@angular-devkit/architect': specifier: workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER version: link:../architect - '@angular-devkit/core': - specifier: workspace:0.0.0-PLACEHOLDER - version: link:../core - ansi-colors: - specifier: 4.1.3 - version: 4.1.3 - progress: - specifier: 2.0.3 - version: 2.0.3 - yargs-parser: - specifier: 21.1.1 - version: 21.1.1 - devDependencies: - '@types/progress': - specifier: 2.0.7 - version: 2.0.7 packages/angular_devkit/build_angular: dependencies: @@ -597,65 +584,59 @@ importers: specifier: workspace:* version: link:../../angular/build '@babel/core': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.28.5 + version: 7.28.5 '@babel/generator': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.28.5 + version: 7.28.5 '@babel/helper-annotate-as-pure': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.27.3 + version: 7.27.3 '@babel/helper-split-export-declaration': specifier: 7.24.7 version: 7.24.7 '@babel/plugin-transform-async-generator-functions': - specifier: 7.27.1 - version: 7.27.1(@babel/core@7.27.1) + specifier: 7.28.0 + version: 7.28.0(@babel/core@7.28.5) '@babel/plugin-transform-async-to-generator': specifier: 7.27.1 - version: 7.27.1(@babel/core@7.27.1) + version: 7.27.1(@babel/core@7.28.5) '@babel/plugin-transform-runtime': - specifier: 7.27.1 - version: 7.27.1(@babel/core@7.27.1) + specifier: 7.28.5 + version: 7.28.5(@babel/core@7.28.5) '@babel/preset-env': - specifier: 7.27.2 - version: 7.27.2(@babel/core@7.27.1) + specifier: 7.28.5 + version: 7.28.5(@babel/core@7.28.5) '@babel/runtime': - specifier: 7.27.1 - version: 7.27.1 + specifier: 7.28.4 + version: 7.28.4 '@discoveryjs/json-ext': specifier: 0.6.3 version: 0.6.3 '@ngtools/webpack': specifier: workspace:0.0.0-PLACEHOLDER version: link:../../ngtools/webpack - '@vitejs/plugin-basic-ssl': - specifier: 2.0.0 - version: 2.0.0(vite@6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1)) ansi-colors: specifier: 4.1.3 version: 4.1.3 autoprefixer: - specifier: 10.4.21 - version: 10.4.21(postcss@8.5.3) + specifier: 10.4.23 + version: 10.4.23(postcss@8.5.6) babel-loader: specifier: 10.0.0 - version: 10.0.0(@babel/core@7.27.1)(webpack@5.99.8(esbuild@0.25.4)) + version: 10.0.0(@babel/core@7.28.5)(webpack@5.104.0(esbuild@0.27.1)) browserslist: - specifier: ^4.21.5 - version: 4.24.5 + specifier: ^4.26.0 + version: 4.28.1 copy-webpack-plugin: - specifier: 13.0.0 - version: 13.0.0(webpack@5.99.8(esbuild@0.25.4)) + specifier: 13.0.1 + version: 13.0.1(webpack@5.104.0(esbuild@0.27.1)) css-loader: specifier: 7.1.2 - version: 7.1.2(webpack@5.99.8(esbuild@0.25.4)) + version: 7.1.2(webpack@5.104.0(esbuild@0.27.1)) esbuild-wasm: - specifier: 0.25.4 - version: 0.25.4 - fast-glob: - specifier: 3.3.3 - version: 3.3.3 + specifier: 0.27.1 + version: 0.27.1 http-proxy-middleware: specifier: 3.0.5 version: 3.0.5 @@ -669,38 +650,38 @@ importers: specifier: 1.4.0 version: 1.4.0 less: - specifier: 4.3.0 - version: 4.3.0 + specifier: 4.4.2 + version: 4.4.2 less-loader: specifier: 12.3.0 - version: 12.3.0(less@4.3.0)(webpack@5.99.8(esbuild@0.25.4)) + version: 12.3.0(less@4.4.2)(webpack@5.104.0(esbuild@0.27.1)) license-webpack-plugin: specifier: 4.0.2 - version: 4.0.2(webpack@5.99.8(esbuild@0.25.4)) + version: 4.0.2(webpack@5.104.0(esbuild@0.27.1)) loader-utils: specifier: 3.3.1 version: 3.3.1 mini-css-extract-plugin: - specifier: 2.9.2 - version: 2.9.2(webpack@5.99.8(esbuild@0.25.4)) + specifier: 2.9.4 + version: 2.9.4(webpack@5.104.0(esbuild@0.27.1)) open: - specifier: 10.1.2 - version: 10.1.2 + specifier: 11.0.0 + version: 11.0.0 ora: - specifier: 5.4.1 - version: 5.4.1 + specifier: 9.0.0 + version: 9.0.0 picomatch: - specifier: 4.0.2 - version: 4.0.2 + specifier: 4.0.3 + version: 4.0.3 piscina: - specifier: 5.0.0 - version: 5.0.0 + specifier: 5.1.4 + version: 5.1.4 postcss: - specifier: 8.5.3 - version: 8.5.3 + specifier: 8.5.6 + version: 8.5.6 postcss-loader: - specifier: 8.1.1 - version: 8.1.1(postcss@8.5.3)(typescript@5.8.3)(webpack@5.99.8(esbuild@0.25.4)) + specifier: 8.2.0 + version: 8.2.0(postcss@8.5.6)(typescript@5.9.3)(webpack@5.104.0(esbuild@0.27.1)) resolve-url-loader: specifier: 5.0.0 version: 5.0.0 @@ -708,23 +689,26 @@ importers: specifier: 7.8.2 version: 7.8.2 sass: - specifier: 1.87.0 - version: 1.87.0 + specifier: 1.97.0 + version: 1.97.0 sass-loader: - specifier: 16.0.5 - version: 16.0.5(sass@1.87.0)(webpack@5.99.8(esbuild@0.25.4)) + specifier: 16.0.6 + version: 16.0.6(sass@1.97.0)(webpack@5.104.0(esbuild@0.27.1)) semver: - specifier: 7.7.1 - version: 7.7.1 + specifier: 7.7.3 + version: 7.7.3 source-map-loader: specifier: 5.0.0 - version: 5.0.0(webpack@5.99.8(esbuild@0.25.4)) + version: 5.0.0(webpack@5.104.0(esbuild@0.27.1)) source-map-support: specifier: 0.5.21 version: 0.5.21 terser: - specifier: 5.39.0 - version: 5.39.0 + specifier: 5.44.1 + version: 5.44.1 + tinyglobby: + specifier: 0.2.15 + version: 0.2.15 tree-kill: specifier: 1.2.2 version: 1.2.2 @@ -732,40 +716,40 @@ importers: specifier: 2.8.1 version: 2.8.1 webpack: - specifier: 5.99.8 - version: 5.99.8(esbuild@0.25.4) + specifier: 5.104.0 + version: 5.104.0(esbuild@0.27.1) webpack-dev-middleware: - specifier: 7.4.2 - version: 7.4.2(webpack@5.99.8(esbuild@0.25.4)) + specifier: 7.4.5 + version: 7.4.5(webpack@5.104.0(esbuild@0.27.1)) webpack-dev-server: - specifier: 5.2.1 - version: 5.2.1(webpack@5.99.8(esbuild@0.25.4)) + specifier: 5.2.2 + version: 5.2.2(bufferutil@4.0.9)(utf-8-validate@6.0.5)(webpack@5.104.0(esbuild@0.27.1)) webpack-merge: specifier: 6.0.1 version: 6.0.1 webpack-subresource-integrity: specifier: 5.1.0 - version: 5.1.0(webpack@5.99.8(esbuild@0.25.4)) - optionalDependencies: - esbuild: - specifier: 0.25.4 - version: 0.25.4 + version: 5.1.0(webpack@5.104.0(esbuild@0.27.1)) devDependencies: '@angular/ssr': specifier: workspace:* version: link:../../angular/ssr '@web/test-runner': - specifier: 0.20.1 - version: 0.20.1 + specifier: 0.20.2 + version: 0.20.2(bufferutil@4.0.9) browser-sync: specifier: 3.0.4 - version: 3.0.4 + version: 3.0.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) ng-packagr: - specifier: 20.0.0-rc.0 - version: 20.0.0-rc.0(@angular/compiler-cli@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3))(tslib@2.8.1)(typescript@5.8.3) + specifier: 21.1.0-next.0 + version: 21.1.0-next.0(@angular/compiler-cli@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3))(tslib@2.8.1)(typescript@5.9.3) undici: - specifier: 7.8.0 - version: 7.8.0 + specifier: 7.16.0 + version: 7.16.0 + optionalDependencies: + esbuild: + specifier: 0.27.1 + version: 0.27.1 packages/angular_devkit/build_webpack: dependencies: @@ -783,11 +767,11 @@ importers: specifier: workspace:0.0.0-PLACEHOLDER version: link:../../ngtools/webpack webpack: - specifier: 5.99.8 - version: 5.99.8(esbuild@0.25.4) + specifier: 5.104.0 + version: 5.104.0(esbuild@0.27.1) webpack-dev-server: - specifier: 5.2.1 - version: 5.2.1(webpack@5.99.8(esbuild@0.25.4)) + specifier: 5.2.2 + version: 5.2.2(bufferutil@4.0.9)(utf-8-validate@6.0.5)(webpack@5.104.0(esbuild@0.27.1)) packages/angular_devkit/core: dependencies: @@ -801,18 +785,18 @@ importers: specifier: 3.3.1 version: 3.3.1 picomatch: - specifier: 4.0.2 - version: 4.0.2 + specifier: 4.0.3 + version: 4.0.3 rxjs: specifier: 7.8.2 version: 7.8.2 source-map: - specifier: 0.7.4 - version: 0.7.4 + specifier: 0.7.6 + version: 0.7.6 devDependencies: chokidar: - specifier: 4.0.3 - version: 4.0.3 + specifier: 5.0.0 + version: 5.0.0 packages/angular_devkit/schematics: dependencies: @@ -823,11 +807,11 @@ importers: specifier: 3.3.1 version: 3.3.1 magic-string: - specifier: 0.30.17 - version: 0.30.17 + specifier: 0.30.21 + version: 0.30.21 ora: - specifier: 5.4.1 - version: 5.4.1 + specifier: 9.0.0 + version: 9.0.0 rxjs: specifier: 7.8.2 version: 7.8.2 @@ -841,14 +825,8 @@ importers: specifier: workspace:0.0.0-PLACEHOLDER version: link:../schematics '@inquirer/prompts': - specifier: 7.5.0 - version: 7.5.0(@types/node@20.17.44) - ansi-colors: - specifier: 4.1.3 - version: 4.1.3 - yargs-parser: - specifier: 21.1.1 - version: 21.1.1 + specifier: 7.10.1 + version: 7.10.1(@types/node@24.10.4) packages/ngtools/webpack: devDependencies: @@ -856,17 +834,17 @@ importers: specifier: workspace:0.0.0-PLACEHOLDER version: link:../../angular_devkit/core '@angular/compiler': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9 + specifier: 21.1.0-next.4 + version: 21.1.0-next.4 '@angular/compiler-cli': - specifier: 20.0.0-next.9 - version: 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3) + specifier: 21.1.0-next.4 + version: 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3) typescript: - specifier: 5.8.3 - version: 5.8.3 + specifier: 5.9.3 + version: 5.9.3 webpack: - specifier: 5.99.8 - version: 5.99.8(esbuild@0.25.4) + specifier: 5.104.0 + version: 5.104.0(esbuild@0.27.1) packages/schematics/angular: dependencies: @@ -885,197 +863,276 @@ importers: '@angular-devkit/schematics': specifier: workspace:* version: link:../packages/angular_devkit/schematics - rxjs: - specifier: 7.8.2 - version: 7.8.2 + '@types/tar-stream': + specifier: 3.1.4 + version: 3.1.4 + tar-stream: + specifier: 3.1.7 + version: 3.1.7 tree-kill: specifier: 1.2.2 version: 1.2.2 - tools/baseline_browserslist: - devDependencies: - baseline-browser-mapping: - specifier: 2.3.0 - version: 2.3.0 - packages: + '@acemir/cssom@0.9.29': + resolution: {integrity: sha512-G90x0VW+9nW4dFajtjCoT+NM0scAfH9Mb08IcjgFHYbfiL/lU04dTF9JuVOi3/OH+DJCQdcIseSXkdCB9Ky6JA==} + + '@actions/core@2.0.1': + resolution: {integrity: sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==} + + '@actions/exec@2.0.0': + resolution: {integrity: sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==} + + '@actions/http-client@3.0.0': + resolution: {integrity: sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ==} + + '@actions/io@2.0.0': + resolution: {integrity: sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==} + + '@algolia/abtesting@1.12.0': + resolution: {integrity: sha512-EfW0bfxjPs+C7ANkJDw2TATntfBKsFiy7APh+KO0pQ8A6HYa5I0NjFuCGCXWfzzzLXNZta3QUl3n5Kmm6aJo9Q==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-abtesting@5.46.0': + resolution: {integrity: sha512-eG5xV8rujK4ZIHXrRshvv9O13NmU/k42Rnd3w43iKH5RaQ2zWuZO6Q7XjaoJjAFVCsJWqRbXzbYyPGrbF3wGNg==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-analytics@5.46.0': + resolution: {integrity: sha512-AYh2uL8IUW9eZrbbT+wZElyb7QkkeV3US2NEKY7doqMlyPWE8lErNfkVN1NvZdVcY4/SVic5GDbeDz2ft8YIiQ==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-common@5.46.0': + resolution: {integrity: sha512-0emZTaYOeI9WzJi0TcNd2k3SxiN6DZfdWc2x2gHt855Jl9jPUOzfVTL6gTvCCrOlT4McvpDGg5nGO+9doEjjig==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-insights@5.46.0': + resolution: {integrity: sha512-wrBJ8fE+M0TDG1As4DDmwPn2TXajrvmvAN72Qwpuv8e2JOKNohF7+JxBoF70ZLlvP1A1EiH8DBu+JpfhBbNphQ==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-personalization@5.46.0': + resolution: {integrity: sha512-LnkeX4p0ENt0DoftDJJDzQQJig/sFQmD1eQifl/iSjhUOGUIKC/7VTeXRcKtQB78naS8njUAwpzFvxy1CDDXDQ==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-query-suggestions@5.46.0': + resolution: {integrity: sha512-aF9tc4ex/smypXw+W3lBPB1jjKoaGHpZezTqofvDOI/oK1dR2sdTpFpK2Ru+7IRzYgwtRqHF3znmTlyoNs9dpA==} + engines: {node: '>= 14.0.0'} + + '@algolia/client-search@5.46.0': + resolution: {integrity: sha512-22SHEEVNjZfFWkFks3P6HilkR3rS7a6GjnCIqR22Zz4HNxdfT0FG+RE7efTcFVfLUkTTMQQybvaUcwMrHXYa7Q==} + engines: {node: '>= 14.0.0'} + + '@algolia/ingestion@1.46.0': + resolution: {integrity: sha512-2LT0/Z+/sFwEpZLH6V17WSZ81JX2uPjgvv5eNlxgU7rPyup4NXXfuMbtCJ+6uc4RO/LQpEJd3Li59ke3wtyAsA==} + engines: {node: '>= 14.0.0'} + + '@algolia/monitoring@1.46.0': + resolution: {integrity: sha512-uivZ9wSWZ8mz2ZU0dgDvQwvVZV8XBv6lYBXf8UtkQF3u7WeTqBPeU8ZoeTyLpf0jAXCYOvc1mAVmK0xPLuEwOQ==} + engines: {node: '>= 14.0.0'} + + '@algolia/recommend@5.46.0': + resolution: {integrity: sha512-O2BB8DuySuddgOAbhyH4jsGbL+KyDGpzJRtkDZkv091OMomqIA78emhhMhX9d/nIRrzS1wNLWB/ix7Hb2eV5rg==} + engines: {node: '>= 14.0.0'} + + '@algolia/requester-browser-xhr@5.46.0': + resolution: {integrity: sha512-eW6xyHCyYrJD0Kjk9Mz33gQ40LfWiEA51JJTVfJy3yeoRSw/NXhAL81Pljpa0qslTs6+LO/5DYPZddct6HvISQ==} + engines: {node: '>= 14.0.0'} + + '@algolia/requester-fetch@5.46.0': + resolution: {integrity: sha512-Vn2+TukMGHy4PIxmdvP667tN/MhS7MPT8EEvEhS6JyFLPx3weLcxSa1F9gVvrfHWCUJhLWoMVJVB2PT8YfRGcw==} + engines: {node: '>= 14.0.0'} + + '@algolia/requester-node-http@5.46.0': + resolution: {integrity: sha512-xaqXyna5yBZ+r1SJ9my/DM6vfTqJg9FJgVydRJ0lnO+D5NhqGW/qaRG/iBGKr/d4fho34el6WakV7BqJvrl/HQ==} + engines: {node: '>= 14.0.0'} + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@angular/animations@20.0.0-next.9': - resolution: {integrity: sha512-lO0KPbUiCTE/ODvYZMVms+2tu0yWbBB4ryI4HyFDVlMIIx7a/4jhQVoXQHuLseuw9Z8e9StO3RB7zbEsZjtT5g==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/animations@21.1.0-next.4': + resolution: {integrity: sha512-GtbawUvSBiUX5/DPLJh0iQcsdqLaNhrs0X7XET/6DyKDK39dlWjOLc/etBPQc7RlbP1QzlbpsISb/Gu0rcbv5A==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/common': 20.0.0-next.9 - '@angular/core': 20.0.0-next.9 + '@angular/core': 21.1.0-next.4 - '@angular/cdk@20.0.0-next.10': - resolution: {integrity: sha512-z72vwZnryFydG4lqElMXEP6ywdlq2kA+uA8pIH2vdneR7iyM3TdGfgeVqFB/S8JOoq0AeQ3A9K5l1Gm0dPDRgw==} + '@angular/cdk@21.1.0-next.3': + resolution: {integrity: sha512-1NxzybXwBefUdOX5HzffjgZg4AwYuogDfRDgViTSzM4yZsVPup5+dDafwZAjYu90qdjriH5d/Lf6PUxhp2rLtA==} peerDependencies: - '@angular/common': ^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0 - '@angular/core': ^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0 + '@angular/common': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 + '@angular/core': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 + '@angular/platform-browser': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 rxjs: ^6.5.3 || ^7.4.0 - '@angular/common@20.0.0-next.9': - resolution: {integrity: sha512-+V9Rbp6rbkJ7qx/ZGxrIdFb36X1TZSik9eXHVpcUncojdsg+je2mG7fvuCcuktkc2JRhv08TQnhOWi/BNuHQGA==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/common@21.1.0-next.4': + resolution: {integrity: sha512-HNM0eaZ86pXQZnmI6MlVj0FvvI3wF5mBkGyMN8Ktuswf9DUq04xBkliLiMwkb5UFmeSibxE3mUaMymw92Nn4fA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/core': 20.0.0-next.9 + '@angular/core': 21.1.0-next.4 rxjs: ^6.5.3 || ^7.4.0 - '@angular/compiler-cli@20.0.0-next.9': - resolution: {integrity: sha512-M0kAujqufiNnPt/PJoNj8c7to6epjPfwBYsUf0M6xi1jqjhXYqOJr4FUnatV5WkzjCdfVVf1YrwnGtZnKeUdDg==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/compiler-cli@21.1.0-next.4': + resolution: {integrity: sha512-iW+8gnGSUqCv4WdN3LMv9ikh9vHfKnbfaG01Hvzxs+q4tL3xVRDezeL+EnpaIdmKsCOIfsYrWwAXNfMd48S4Lw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: - '@angular/compiler': 20.0.0-next.9 - typescript: 5.8.3 + '@angular/compiler': 21.1.0-next.4 + typescript: '>=5.9 <6.0' + peerDependenciesMeta: + typescript: + optional: true - '@angular/compiler@20.0.0-next.9': - resolution: {integrity: sha512-5f0fEokhjE4JU/d/I7dB1t/TOoGWOGftdqjswfniHij2s/UMdgXNSr7HcTk+AibZ3pT142PDSqtWDuYaG4zAtA==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/compiler@21.1.0-next.4': + resolution: {integrity: sha512-uY4Yg3OJ/DL6AlqMjO8VXgKiFHJK3QspFJzslkJKys2d8I7a7YIoWxYRJ9ZUfWW++8Swig17pL9NOrRLXx+iQg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} - '@angular/core@20.0.0-next.9': - resolution: {integrity: sha512-dTcDo1mp3A0hsAAajgMHjb8DX/MweUrPqJH660iXSCZVSM5MqFUBhazrJgySt31CKCPE5F3W+ZeISN8QCi9pcQ==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/core@21.1.0-next.4': + resolution: {integrity: sha512-aJAGd+8o/8vle68hAJGah/DMQVD4/vFf/lDhnqe69sFLY7HLeq5UdBjIu00nZ1DUVeL0n/QOA97bLRICINhVrg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/compiler': 20.0.0-next.9 + '@angular/compiler': 21.1.0-next.4 rxjs: ^6.5.3 || ^7.4.0 - zone.js: ~0.15.0 + zone.js: ~0.15.0 || ~0.16.0 peerDependenciesMeta: '@angular/compiler': optional: true + zone.js: + optional: true - '@angular/forms@20.0.0-next.9': - resolution: {integrity: sha512-ne7hBsqpyfpkSgkC7JRBrY5pnPEE+uIm9xYaDjsBzJHaJYGWkkF9eHdPmW7X13Lok8LRG7z24wxZlTeY/UNn0g==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/forms@21.1.0-next.4': + resolution: {integrity: sha512-GluP6ZCId5DSukrgx/RlJX2CsVwHsRTSO8wAdYsqk2JIQpSPDtJk14RzvdHnMGeuBHrWn2dy88hq8G6W0SlQDA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/common': 20.0.0-next.9 - '@angular/core': 20.0.0-next.9 - '@angular/platform-browser': 20.0.0-next.9 + '@angular/common': 21.1.0-next.4 + '@angular/core': 21.1.0-next.4 + '@angular/platform-browser': 21.1.0-next.4 rxjs: ^6.5.3 || ^7.4.0 - '@angular/localize@20.0.0-next.9': - resolution: {integrity: sha512-B3IS4i1ez4vpVe1VD9Gl/v0XXOvyNOhuXanGKGLCYfepBiDMy4YwMh7t5WfwYrGAPYO5kCaNFyEYot4p4tK8cw==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/localize@21.1.0-next.4': + resolution: {integrity: sha512-awaQi5ib3UteQrIpxZmVrPBLnpAiPFeqVaogj0+hbn5dIvcQ4qbnjq3aTT/eR64aDGL6hByJ2e0Ac5fmVKUAEw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: - '@angular/compiler': 20.0.0-next.9 - '@angular/compiler-cli': 20.0.0-next.9 + '@angular/compiler': 21.1.0-next.4 + '@angular/compiler-cli': 21.1.0-next.4 - '@angular/material@20.0.0-next.10': - resolution: {integrity: sha512-V8YU1uSaHVd0LZAV4wSd3RbQ/tV+HSuTtu+RiJ8z7OEfdIt44NOIqQ1AzSHhiCTz8+BS61TDKrbDNUDJP2KX/g==} + '@angular/material@21.1.0-next.3': + resolution: {integrity: sha512-m59JnFOUpTk5yLAYpJnk+nfvhzUO7tIG/WHFFOD2VmqWuadyZ+k6M4bQPy0ereumUcLue1QN7ZM6UpJWlgRqVQ==} peerDependencies: - '@angular/cdk': 20.0.0-next.10 - '@angular/common': ^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0 - '@angular/core': ^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0 - '@angular/forms': ^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0 - '@angular/platform-browser': ^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0 + '@angular/cdk': 21.1.0-next.3 + '@angular/common': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 + '@angular/core': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 + '@angular/forms': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 + '@angular/platform-browser': ^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0 rxjs: ^6.5.3 || ^7.4.0 - '@angular/ng-dev@https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/1125d8dbec5e787d9579e5b218b60a3be64c50fa': - resolution: {tarball: https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/1125d8dbec5e787d9579e5b218b60a3be64c50fa} - version: 0.0.0-2c7bab7971084f3f1f6f72735099a9591ee5ebcb + '@angular/ng-dev@https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/ddc3809c1993612732eaae62d28e828b2ed789e5': + resolution: {tarball: https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/ddc3809c1993612732eaae62d28e828b2ed789e5} + version: 0.0.0-942d738d8f4d65b161d06e6c399fefec318cdbfe hasBin: true - '@angular/platform-browser@20.0.0-next.9': - resolution: {integrity: sha512-gvyrm4o4UWn/VSiaJirI4hOf50bD6wF3QwpoP9NOG4YQyo5GjFQf6QPGVAfPgKjrp3eyTemVMhFq2yoVj9elNg==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/platform-browser@21.1.0-next.4': + resolution: {integrity: sha512-3Tntq39GTw6wWsp92FZ438mz0eILW+9aXh/r0BzRTFnr2QtDrpEOnLqTNfdxJlS/NEYyrSmP7XzkmAlt13zu2g==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/animations': 20.0.0-next.9 - '@angular/common': 20.0.0-next.9 - '@angular/core': 20.0.0-next.9 + '@angular/animations': 21.1.0-next.4 + '@angular/common': 21.1.0-next.4 + '@angular/core': 21.1.0-next.4 peerDependenciesMeta: '@angular/animations': optional: true - '@angular/platform-server@20.0.0-next.9': - resolution: {integrity: sha512-+CxoXX5rh497SYwhCzCYV2OKboZ3iyHJgWDQTQ2PhdKrPb6iKRsTw7IcNj5CYKAPb/iFpQ4lBUNfYwRwirmoRg==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/platform-server@21.1.0-next.4': + resolution: {integrity: sha512-R+FzXYCjNV6T7iMDPZ18FrSsTBZx200DU+ivKCMwUR9nwPYnA4oD+YwZKd+OgZrQqo4p5T/seXWScnqROopvQg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/common': 20.0.0-next.9 - '@angular/compiler': 20.0.0-next.9 - '@angular/core': 20.0.0-next.9 - '@angular/platform-browser': 20.0.0-next.9 + '@angular/common': 21.1.0-next.4 + '@angular/compiler': 21.1.0-next.4 + '@angular/core': 21.1.0-next.4 + '@angular/platform-browser': 21.1.0-next.4 rxjs: ^6.5.3 || ^7.4.0 - '@angular/router@20.0.0-next.9': - resolution: {integrity: sha512-pkgcyBTfO1LIUHBfmnxQNDhWN6Gr7S4RNkvms9n/fj/athKEvAxSjwcqkrIFADkqOw0t2zRjdqEPIoHAouImHw==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/router@21.1.0-next.4': + resolution: {integrity: sha512-2ZLGbA57w9zA+yO6iXMuSaORJbD2jMoFRrKcMHamDhw81rpbJ3zcBjQ+I8GeAVgus5irWRr/6dYOmgy9kSldkg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: - '@angular/common': 20.0.0-next.9 - '@angular/core': 20.0.0-next.9 - '@angular/platform-browser': 20.0.0-next.9 + '@angular/common': 21.1.0-next.4 + '@angular/core': 21.1.0-next.4 + '@angular/platform-browser': 21.1.0-next.4 rxjs: ^6.5.3 || ^7.4.0 - '@angular/service-worker@20.0.0-next.9': - resolution: {integrity: sha512-HCm5LaCp0C9fS9RsCCWcntNzVOyiE2WEbeyuDbAkrOJOahtPC1cgkixGgipOCc95ib6d3W8yIS7gwvH8tFt4qg==} - engines: {node: ^20.11.1 || >=22.11.0} + '@angular/service-worker@21.1.0-next.4': + resolution: {integrity: sha512-RadEpo+xp7hzv2qgpNRmsFsILX5ZY7AYGLHTVvEu4j5DUI9LUJllnmlEz/U5HHz/99h8eEPZPlUZ/H0OMMmUfw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: - '@angular/core': 20.0.0-next.9 + '@angular/core': 21.1.0-next.4 rxjs: ^6.5.3 || ^7.4.0 - '@asamuzakjp/css-color@3.1.7': - resolution: {integrity: sha512-Ok5fYhtwdyJQmU1PpEv6Si7Y+A4cYb8yNM9oiIJC9TzXPMuN9fvdonKJqcnz9TbFqV6bQ8z0giRq0iaOpGZV2g==} + '@asamuzakjp/css-color@4.1.1': + resolution: {integrity: sha512-B0Hv6G3gWGMn0xKJ0txEi/jM5iFpT3MfDxmhZFb4W047GvytCf1DHQ1D69W3zHI4yWe2aTZAA0JnbMZ7Xc8DuQ==} + + '@asamuzakjp/dom-selector@6.7.6': + resolution: {integrity: sha512-hBaJER6A9MpdG3WgdlOolHmbOYvSk46y7IQN/1+iqiCuUu6iWdQrs9DGKF8ocqsEqWujWf/V7b7vaDgiUmIvUg==} + + '@asamuzakjp/nwsapi@2.3.9': + resolution: {integrity: sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==} '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.27.2': - resolution: {integrity: sha512-TUtMJYRPyUb/9aU8f3K0mjmjf6M9N5Woshn2CS6nqJSeJtTtQcpLUXjGt9vbF8ZGff0El99sWkLgzwW3VXnxZQ==} - engines: {node: '>=6.9.0'} - - '@babel/core@7.26.10': - resolution: {integrity: sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==} + '@babel/compat-data@7.28.5': + resolution: {integrity: sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==} engines: {node: '>=6.9.0'} - '@babel/core@7.27.1': - resolution: {integrity: sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==} + '@babel/core@7.28.5': + resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} engines: {node: '>=6.9.0'} - '@babel/generator@7.27.1': - resolution: {integrity: sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==} + '@babel/generator@7.28.5': + resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.27.1': - resolution: {integrity: sha512-WnuuDILl9oOBbKnb4L+DyODx7iC47XfzmNCpTttFsSp6hTG7XZxu60+4IO+2/hPfcGOoKbFiwoI/+zwARbNQow==} + '@babel/helper-annotate-as-pure@7.27.3': + resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==} engines: {node: '>=6.9.0'} '@babel/helper-compilation-targets@7.27.2': resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.27.1': - resolution: {integrity: sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==} + '@babel/helper-create-class-features-plugin@7.28.5': + resolution: {integrity: sha512-q3WC4JfdODypvxArsJQROfupPBq9+lMwjKq7C33GhbFYJsufD0yd/ziwD+hJucLeWsnFPWZjsU2DNFqBPE7jwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.27.1': - resolution: {integrity: sha512-uVDC72XVf8UbrH5qQTc18Agb8emwjTiZrQE11Nv3CuBEZmVvTwwE9CBUEvHku06gQCAyYf8Nv6ja1IN+6LMbxQ==} + '@babel/helper-create-regexp-features-plugin@7.28.5': + resolution: {integrity: sha512-N1EhvLtHzOvj7QQOUCCS3NrPJP8c5W6ZXCHDn7Yialuy1iu4r5EmIYkXlKNqT99Ciw+W0mDqWoR6HWMZlFP3hw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-define-polyfill-provider@0.6.4': - resolution: {integrity: sha512-jljfR1rGnXXNWnmQg2K3+bvhkxB51Rl32QRaOTuwwjviGrHzIbSc8+x9CpraDtbT7mfyjXObULP4w/adunNwAw==} + '@babel/helper-define-polyfill-provider@0.6.5': + resolution: {integrity: sha512-uJnGFcPsWQK8fvjgGP5LZUZZsYGIoPeRjSF5PGwrelYgq7Q15/Ft9NGFp1zglwgIv//W0uG4BevRuSJRyylZPg==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-member-expression-to-functions@7.27.1': - resolution: {integrity: sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==} + '@babel/helper-globals@7.28.0': + resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-member-expression-to-functions@7.28.5': + resolution: {integrity: sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==} engines: {node: '>=6.9.0'} '@babel/helper-module-imports@7.27.1': resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.27.1': - resolution: {integrity: sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==} + '@babel/helper-module-transforms@7.28.3': + resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1112,29 +1169,29 @@ packages: resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.27.1': - resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} engines: {node: '>=6.9.0'} '@babel/helper-validator-option@7.27.1': resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/helper-wrap-function@7.27.1': - resolution: {integrity: sha512-NFJK2sHUvrjo8wAU/nQTWU890/zB2jj0qBcCbZbbf+005cAsv6tMjXz31fBign6M5ov1o0Bllu+9nbqkfsjjJQ==} + '@babel/helper-wrap-function@7.28.3': + resolution: {integrity: sha512-zdf983tNfLZFletc0RRXYrHrucBEg95NIFMkn6K9dbeMYnsgHaSBGcQqdsCSStG2PYwRre0Qc2NNSCXbG+xc6g==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.27.1': - resolution: {integrity: sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==} + '@babel/helpers@7.28.4': + resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} engines: {node: '>=6.9.0'} - '@babel/parser@7.27.2': - resolution: {integrity: sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==} + '@babel/parser@7.28.5': + resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1': - resolution: {integrity: sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==} + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.28.5': + resolution: {integrity: sha512-87GDMS3tsmMSi/3bWOte1UblL+YUTFMV8SZPZ2eSEL17s74Cw/l63rR6NmGVKMYW2GYi85nE+/d6Hw5N0bEk2Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1157,8 +1214,8 @@ packages: peerDependencies: '@babel/core': ^7.13.0 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.27.1': - resolution: {integrity: sha512-6BpaYGDavZqkI6yT+KSPdpZFfpnd68UKXbcjI9pJ13pvHhPrCKWOOLp+ysvMeA+DxnhuPpgIaRpxRxo5A9t5jw==} + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.28.3': + resolution: {integrity: sha512-b6YTX108evsvE4YgWyQ921ZAFFQm3Bn+CA3+ZXlNVnPhx+UfsVURoPjfGAPCjBgrqo30yX/C2nZGX96DxvR9Iw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1193,8 +1250,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-async-generator-functions@7.27.1': - resolution: {integrity: sha512-eST9RrwlpaoJBDHShc+DS2SG4ATTi2MYNb4OxYkf3n+7eb49LWpnS+HSpVfW4x927qQwgk8A2hGNVaajAEw0EA==} + '@babel/plugin-transform-async-generator-functions@7.28.0': + resolution: {integrity: sha512-BEOdvX4+M765icNPZeidyADIvQ1m1gmunXufXxvRESy/jNNyfovIqUyE7MVgGBjWktCoJlzvFA1To2O4ymIO3Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1211,8 +1268,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoping@7.27.1': - resolution: {integrity: sha512-QEcFlMl9nGTgh1rn2nIeU5bkfb9BAjaQcWbiP4LvKxUot52ABcTkpcyJ7f2Q2U2RuQ84BNLgts3jRme2dTx6Fw==} + '@babel/plugin-transform-block-scoping@7.28.5': + resolution: {integrity: sha512-45DmULpySVvmq9Pj3X9B+62Xe+DJGov27QravQJU1LLcapR6/10i+gYVAucGGJpHBp5mYxIMK4nDAT/QDLr47g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1223,14 +1280,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-static-block@7.27.1': - resolution: {integrity: sha512-s734HmYU78MVzZ++joYM+NkJusItbdRcbm+AGRgJCt3iA+yux0QpD9cBVdz3tKyrjVYWRl7j0mHSmv4lhV0aoA==} + '@babel/plugin-transform-class-static-block@7.28.3': + resolution: {integrity: sha512-LtPXlBbRoc4Njl/oh1CeD/3jC+atytbnf/UqLoqTDcEYGUPj022+rvfkbDYieUrSj3CaV4yHDByPE+T2HwfsJg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.12.0 - '@babel/plugin-transform-classes@7.27.1': - resolution: {integrity: sha512-7iLhfFAubmpeJe/Wo2TVuDrykh/zlWXLzPNdL0Jqn/Xu8R3QQ8h9ff8FQoISZOsw74/HFqFI7NX63HN7QFIHKA==} + '@babel/plugin-transform-classes@7.28.4': + resolution: {integrity: sha512-cFOlhIYPBv/iBoc+KS3M6et2XPtbT2HiCRfBXWtfpc9OAyostldxIf9YAYB6ypURBBbx+Qv6nyrLzASfJe+hBA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1241,8 +1298,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-destructuring@7.27.1': - resolution: {integrity: sha512-ttDCqhfvpE9emVkXbPD8vyxxh4TWYACVybGkDj+oReOGwnp066ITEivDlLwe0b1R0+evJ13IXQuLNB5w1fhC5Q==} + '@babel/plugin-transform-destructuring@7.28.5': + resolution: {integrity: sha512-Kl9Bc6D0zTUcFUvkNuQh4eGXPKKNDOJQXVyyM4ZAQPMveniJdxi8XMJwLo+xSoW3MIq81bD33lcUe9kZpl0MCw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1271,8 +1328,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-exponentiation-operator@7.27.1': - resolution: {integrity: sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ==} + '@babel/plugin-transform-explicit-resource-management@7.28.0': + resolution: {integrity: sha512-K8nhUcn3f6iB+P3gwCv/no7OdzOZQcKchW6N389V6PD8NUWKZHzndOd9sPDVbMoBsbmjMqlB4L9fm+fEFNVlwQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-exponentiation-operator@7.28.5': + resolution: {integrity: sha512-D4WIMaFtwa2NizOp+dnoFjRez/ClKiC2BqqImwKd1X28nqBtZEyCYJ2ozQrrzlxAFrcrjxo39S6khe9RNDlGzw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1307,8 +1370,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-logical-assignment-operators@7.27.1': - resolution: {integrity: sha512-SJvDs5dXxiae4FbSL1aBJlG4wvl594N6YEVVn9e3JGulwioy6z3oPjx/sQBO3Y4NwUu5HNix6KJ3wBZoewcdbw==} + '@babel/plugin-transform-logical-assignment-operators@7.28.5': + resolution: {integrity: sha512-axUuqnUTBuXyHGcJEVVh9pORaN6wC5bYfE7FGzPiaWa3syib9m7g+/IT/4VgCOe2Upef43PHzeAvcrVek6QuuA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1331,8 +1394,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-systemjs@7.27.1': - resolution: {integrity: sha512-w5N1XzsRbc0PQStASMksmUeqECuzKuTJer7kFagK8AXgpCMkeDMO5S+aaFb7A51ZYDF7XI34qsTX+fkHiIm5yA==} + '@babel/plugin-transform-modules-systemjs@7.28.5': + resolution: {integrity: sha512-vn5Jma98LCOeBy/KpeQhXcV2WZgaRUtjwQmjoBuLNlOmkg0fB5pdvYVeWRYI69wWKwK2cD1QbMiUQnoujWvrew==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1367,8 +1430,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-rest-spread@7.27.2': - resolution: {integrity: sha512-AIUHD7xJ1mCrj3uPozvtngY3s0xpv7Nu7DoUSnzNY6Xam1Cy4rUznR//pvMHOhQ4AvbCexhbqXCtpxGHOGOO6g==} + '@babel/plugin-transform-object-rest-spread@7.28.4': + resolution: {integrity: sha512-373KA2HQzKhQCYiRVIRr+3MjpCObqzDlyrM6u4I201wL8Mp2wHf7uB8GhDwis03k2ti8Zr65Zyyqs1xOxUF/Ew==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1385,14 +1448,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.27.1': - resolution: {integrity: sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==} + '@babel/plugin-transform-optional-chaining@7.28.5': + resolution: {integrity: sha512-N6fut9IZlPnjPwgiQkXNhb+cT8wQKFlJNqcZkWlcTqkcqx6/kU4ynGmLFoa4LViBSirn05YAwk+sQBbPfxtYzQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-parameters@7.27.1': - resolution: {integrity: sha512-018KRk76HWKeZ5l4oTj2zPpSh+NbGdt0st5S6x0pga6HgrjBOJb24mMDHorFopOOd6YHkLgOZ+zaCjZGPO4aKg==} + '@babel/plugin-transform-parameters@7.27.7': + resolution: {integrity: sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1415,8 +1478,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-regenerator@7.27.1': - resolution: {integrity: sha512-B19lbbL7PMrKr52BNPjCqg1IyNUIjTcxKj8uX9zHO+PmWN93s19NDr/f69mIkEp2x9nmDJ08a7lgHaTTzvW7mw==} + '@babel/plugin-transform-regenerator@7.28.4': + resolution: {integrity: sha512-+ZEdQlBoRg9m2NnzvEeLgtvBMO4tkFBw5SQIUgLICgTrumLoU7lr+Oghi6km2PFj+dbUt2u1oby2w3BDO9YQnA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1433,8 +1496,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-runtime@7.27.1': - resolution: {integrity: sha512-TqGF3desVsTcp3WrJGj4HfKokfCXCLcHpt4PJF0D8/iT6LPd9RS82Upw3KPeyr6B22Lfd3DO8MVrmp0oRkUDdw==} + '@babel/plugin-transform-runtime@7.28.5': + resolution: {integrity: sha512-20NUVgOrinudkIBzQ2bNxP08YpKprUkRTiRSd2/Z5GOdPImJGkoN4Z7IQe1T5AdyKI1i5L6RBmluqdSzvaq9/w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1493,8 +1556,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/preset-env@7.27.2': - resolution: {integrity: sha512-Ma4zSuYSlGNRlCLO+EAzLnCmJK2vdstgv+n7aUP+/IKZrOfWHOJVdSJtuub8RzHTj3ahD37k5OKJWvzf16TQyQ==} + '@babel/preset-env@7.28.5': + resolution: {integrity: sha512-S36mOoi1Sb6Fz98fBfE+UZSpYw5mJm0NUHtIKrOuNcqeFauy1J6dIvXm2KRVKobOSaGq4t/hBXdN4HGU3wL9Wg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1504,444 +1567,689 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 - '@babel/runtime@7.27.1': - resolution: {integrity: sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==} + '@babel/runtime@7.28.4': + resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} engines: {node: '>=6.9.0'} '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.27.1': - resolution: {integrity: sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==} + '@babel/traverse@7.28.5': + resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==} engines: {node: '>=6.9.0'} - '@babel/types@7.27.1': - resolution: {integrity: sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==} + '@babel/types@7.28.5': + resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} engines: {node: '>=6.9.0'} '@bazel/bazelisk@1.26.0': resolution: {integrity: sha512-bTNcHdGyEQ9r7SczEYUa0gkEQhJo1ld2BjXI8fWBvsUeoHi03QpUs2HZgDbjjrpQFQqG2ZbO7ihZvH8MjhUTHw==} hasBin: true - '@bazel/buildifier@8.2.0': - resolution: {integrity: sha512-GKiCBXi8RcOH8Gc2zkeHJl30GGayplWVW/eMx9v1M2g53Iz2+CmacVW+LB5rIrZsLWiolaK9BFVWXRQol4Wt0Q==} + '@bazel/buildifier@8.2.1': + resolution: {integrity: sha512-eZ/Aq+2r4PcJa6LbPCT6ffgIJfTU/gYilqIzoX2OLM4nNkbQC6tTMPZNn7aHHjhGPxbNLv41zm4Xqt1olCLgXw==} hasBin: true + '@bcoe/v8-coverage@1.0.2': + resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} + engines: {node: '>=18'} + '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} + '@conventional-changelog/git-client@1.0.1': + resolution: {integrity: sha512-PJEqBwAleffCMETaVm/fUgHldzBE35JFk3/9LL6NUA5EXa3qednu+UT6M7E5iBu3zIQZCULYIiZ90fBYHt6xUw==} + engines: {node: '>=18'} + peerDependencies: + conventional-commits-filter: ^5.0.0 + conventional-commits-parser: ^6.0.0 + peerDependenciesMeta: + conventional-commits-filter: + optional: true + conventional-commits-parser: + optional: true + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} - '@csstools/color-helpers@5.0.2': - resolution: {integrity: sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==} + '@csstools/color-helpers@5.1.0': + resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==} engines: {node: '>=18'} - '@csstools/css-calc@2.1.3': - resolution: {integrity: sha512-XBG3talrhid44BY1x3MHzUx/aTG8+x/Zi57M4aTKK9RFB4aLlF3TTSzfzn8nWVHWL3FgAXAxmupmDd6VWww+pw==} + '@csstools/css-calc@2.1.4': + resolution: {integrity: sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-parser-algorithms': ^3.0.4 - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-color-parser@3.0.9': - resolution: {integrity: sha512-wILs5Zk7BU86UArYBJTPy/FMPPKVKHMj1ycCEyf3VUptol0JNRLFU/BZsJ4aiIHJEbSLiizzRrw8Pc1uAEDrXw==} + '@csstools/css-color-parser@3.1.0': + resolution: {integrity: sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-parser-algorithms': ^3.0.4 - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-parser-algorithms@3.0.4': - resolution: {integrity: sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==} + '@csstools/css-parser-algorithms@3.0.5': + resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-tokenizer': ^3.0.4 + + '@csstools/css-syntax-patches-for-csstree@1.0.22': + resolution: {integrity: sha512-qBcx6zYlhleiFfdtzkRgwNC7VVoAwfK76Vmsw5t+PbvtdknO9StgRk7ROvq9so1iqbdW4uLIDAsXRsTfUrIoOw==} + engines: {node: '>=18'} - '@csstools/css-tokenizer@3.0.3': - resolution: {integrity: sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==} + '@csstools/css-tokenizer@3.0.4': + resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} engines: {node: '>=18'} - '@cypress/request@3.0.8': - resolution: {integrity: sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==} + '@cypress/request@3.0.9': + resolution: {integrity: sha512-I3l7FdGRXluAS44/0NguwWlO83J18p0vlr2FYHrJkWdNYhgVoiYo61IXPqaOsL+vNxU1ZqMACzItGK3/KKDsdw==} engines: {node: '>= 6'} '@discoveryjs/json-ext@0.6.3': resolution: {integrity: sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==} engines: {node: '>=14.17.0'} - '@esbuild/aix-ppc64@0.25.4': - resolution: {integrity: sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==} + '@emnapi/core@1.7.1': + resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==} + + '@emnapi/runtime@1.7.1': + resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} + + '@emnapi/wasi-threads@1.1.0': + resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} + + '@esbuild/aix-ppc64@0.27.1': + resolution: {integrity: sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.25.4': - resolution: {integrity: sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==} + '@esbuild/android-arm64@0.27.1': + resolution: {integrity: sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.25.4': - resolution: {integrity: sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==} + '@esbuild/android-arm@0.27.1': + resolution: {integrity: sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.25.4': - resolution: {integrity: sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==} + '@esbuild/android-x64@0.27.1': + resolution: {integrity: sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.25.4': - resolution: {integrity: sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==} + '@esbuild/darwin-arm64@0.27.1': + resolution: {integrity: sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.25.4': - resolution: {integrity: sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==} + '@esbuild/darwin-x64@0.27.1': + resolution: {integrity: sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.25.4': - resolution: {integrity: sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==} + '@esbuild/freebsd-arm64@0.27.1': + resolution: {integrity: sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.25.4': - resolution: {integrity: sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==} + '@esbuild/freebsd-x64@0.27.1': + resolution: {integrity: sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.25.4': - resolution: {integrity: sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==} + '@esbuild/linux-arm64@0.27.1': + resolution: {integrity: sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.25.4': - resolution: {integrity: sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==} + '@esbuild/linux-arm@0.27.1': + resolution: {integrity: sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.25.4': - resolution: {integrity: sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==} + '@esbuild/linux-ia32@0.27.1': + resolution: {integrity: sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.25.4': - resolution: {integrity: sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==} + '@esbuild/linux-loong64@0.27.1': + resolution: {integrity: sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.25.4': - resolution: {integrity: sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==} + '@esbuild/linux-mips64el@0.27.1': + resolution: {integrity: sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.25.4': - resolution: {integrity: sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==} + '@esbuild/linux-ppc64@0.27.1': + resolution: {integrity: sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.25.4': - resolution: {integrity: sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==} + '@esbuild/linux-riscv64@0.27.1': + resolution: {integrity: sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.25.4': - resolution: {integrity: sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==} + '@esbuild/linux-s390x@0.27.1': + resolution: {integrity: sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.25.4': - resolution: {integrity: sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==} + '@esbuild/linux-x64@0.27.1': + resolution: {integrity: sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.25.4': - resolution: {integrity: sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==} + '@esbuild/netbsd-arm64@0.27.1': + resolution: {integrity: sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.25.4': - resolution: {integrity: sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==} + '@esbuild/netbsd-x64@0.27.1': + resolution: {integrity: sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.25.4': - resolution: {integrity: sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==} + '@esbuild/openbsd-arm64@0.27.1': + resolution: {integrity: sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.25.4': - resolution: {integrity: sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==} + '@esbuild/openbsd-x64@0.27.1': + resolution: {integrity: sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.25.4': - resolution: {integrity: sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==} + '@esbuild/openharmony-arm64@0.27.1': + resolution: {integrity: sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.27.1': + resolution: {integrity: sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.25.4': - resolution: {integrity: sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==} + '@esbuild/win32-arm64@0.27.1': + resolution: {integrity: sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.25.4': - resolution: {integrity: sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==} + '@esbuild/win32-ia32@0.27.1': + resolution: {integrity: sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.25.4': - resolution: {integrity: sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==} + '@esbuild/win32-x64@0.27.1': + resolution: {integrity: sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.7.0': - resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} + '@eslint-community/eslint-utils@4.9.0': + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.12.1': - resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/compat@1.2.9': - resolution: {integrity: sha512-gCdSY54n7k+driCadyMNv8JSPzYLeDVM/ikZRtvtROBpRdFSkS8W9A82MqsaY7lZuwL0wiapgD0NT1xT0hyJsA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/compat@2.0.0': + resolution: {integrity: sha512-T9AfE1G1uv4wwq94ozgTGio5EUQBqAVe1X9qsQtSNVEYW6j3hvtZVm8Smr4qL1qDPFg+lOB2cL5RxTRMzq4CTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} peerDependencies: - eslint: ^9.10.0 + eslint: ^8.40 || 9 peerDependenciesMeta: eslint: optional: true - '@eslint/config-array@0.20.0': - resolution: {integrity: sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==} + '@eslint/config-array@0.21.1': + resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/config-helpers@0.2.2': - resolution: {integrity: sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==} + '@eslint/config-helpers@0.4.2': + resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.13.0': - resolution: {integrity: sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==} + '@eslint/core@0.17.0': + resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.3.1': - resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} + '@eslint/core@1.0.0': + resolution: {integrity: sha512-PRfWP+8FOldvbApr6xL7mNCw4cJcSTq4GA7tYbgq15mRb0kWKO/wEB2jr+uwjFH3sZvEZneZyCUGTxsv4Sahyw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/eslintrc@3.3.3': + resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.26.0': - resolution: {integrity: sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==} + '@eslint/js@9.39.2': + resolution: {integrity: sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/object-schema@2.1.6': - resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} + '@eslint/object-schema@2.1.7': + resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.8': - resolution: {integrity: sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==} + '@eslint/plugin-kit@0.4.1': + resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@glideapps/ts-necessities@2.2.3': - resolution: {integrity: sha512-gXi0awOZLHk3TbW55GZLCPP6O+y/b5X1pBXKBVckFONSwF1z1E5ND2BGJsghQFah+pW7pkkyFb2VhUQI2qhL5w==} + '@fastify/busboy@2.1.1': + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} - '@google-cloud/common@5.0.2': - resolution: {integrity: sha512-V7bmBKYQyu0eVG2BFejuUjlBt+zrya6vtsKdY+JxMM/dNntPF41vZ9+LhOshEUH01zOHEqBSvI7Dad7ZS6aUeA==} - engines: {node: '>=14.0.0'} + '@firebase/ai@2.6.1': + resolution: {integrity: sha512-qJd9bpABqsanFnwdbjZEDbKKr1jRtuUZ+cHyNBLWsxobH4pd73QncvuO3XlMq4eKBLlg1f5jNdFpJ3G3ABu2Tg==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@firebase/app-types': 0.x - '@google-cloud/precise-date@4.0.0': - resolution: {integrity: sha512-1TUx3KdaU3cN7nfCdNf+UVqA/PSX29Cjcox3fZZBtINlRrXVTmUkQnCKv2MbBUbCopbK4olAT1IHl76uZyCiVA==} - engines: {node: '>=14.0.0'} + '@firebase/analytics-compat@0.2.25': + resolution: {integrity: sha512-fdzoaG0BEKbqksRDhmf4JoyZf16Wosrl0Y7tbZtJyVDOOwziE0vrFjmZuTdviL0yhak+Nco6rMsUUbkbD+qb6Q==} + peerDependencies: + '@firebase/app-compat': 0.x - '@google-cloud/projectify@4.0.0': - resolution: {integrity: sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==} - engines: {node: '>=14.0.0'} + '@firebase/analytics-types@0.8.3': + resolution: {integrity: sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg==} - '@google-cloud/promisify@4.0.0': - resolution: {integrity: sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==} - engines: {node: '>=14'} + '@firebase/analytics@0.10.19': + resolution: {integrity: sha512-3wU676fh60gaiVYQEEXsbGS4HbF2XsiBphyvvqDbtC1U4/dO4coshbYktcCHq+HFaGIK07iHOh4pME0hEq1fcg==} + peerDependencies: + '@firebase/app': 0.x - '@google-cloud/spanner@7.21.0': - resolution: {integrity: sha512-SrlHgXmSaEbGhdimxcB0FgNsW9J931JBBveoGW43clQHVNcDJuKRoG+240inbSRZoW8JIwwEHToXYU5YGO3VGg==} - engines: {node: '>=14.0.0'} + '@firebase/app-check-compat@0.4.0': + resolution: {integrity: sha512-UfK2Q8RJNjYM/8MFORltZRG9lJj11k0nW84rrffiKvcJxLf1jf6IEjCIkCamykHE73C6BwqhVfhIBs69GXQV0g==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x - '@grpc/grpc-js@1.13.3': - resolution: {integrity: sha512-FTXHdOoPbZrBjlVLHuKbDZnsTxXv2BlHF57xw6LuThXacXvtkahEPED0CKMk6obZDf65Hv4k3z62eyPNpvinIg==} - engines: {node: '>=12.10.0'} + '@firebase/app-check-interop-types@0.3.3': + resolution: {integrity: sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A==} - '@grpc/proto-loader@0.7.15': - resolution: {integrity: sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==} - engines: {node: '>=6'} - hasBin: true + '@firebase/app-check-types@0.5.3': + resolution: {integrity: sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng==} - '@hapi/bourne@3.0.0': - resolution: {integrity: sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==} + '@firebase/app-check@0.11.0': + resolution: {integrity: sha512-XAvALQayUMBJo58U/rxW02IhsesaxxfWVmVkauZvGEz3vOAjMEQnzFlyblqkc2iAaO82uJ2ZVyZv9XzPfxjJ6w==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x - '@humanfs/core@0.19.1': - resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} - engines: {node: '>=18.18.0'} + '@firebase/app-compat@0.5.6': + resolution: {integrity: sha512-YYGARbutghQY4zZUWMYia0ib0Y/rb52y72/N0z3vglRHL7ii/AaK9SA7S/dzScVOlCdnbHXz+sc5Dq+r8fwFAg==} + engines: {node: '>=20.0.0'} - '@humanfs/node@0.16.6': - resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} - engines: {node: '>=18.18.0'} + '@firebase/app-types@0.9.3': + resolution: {integrity: sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw==} - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} + '@firebase/app@0.14.6': + resolution: {integrity: sha512-4uyt8BOrBsSq6i4yiOV/gG6BnnrvTeyymlNcaN/dKvyU1GoolxAafvIvaNP1RCGPlNab3OuE4MKUQuv2lH+PLQ==} + engines: {node: '>=20.0.0'} - '@humanwhocodes/retry@0.3.1': - resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} - engines: {node: '>=18.18'} + '@firebase/auth-compat@0.6.2': + resolution: {integrity: sha512-8UhCzF6pav9bw/eXA8Zy1QAKssPRYEYXaWagie1ewLTwHkXv6bKp/j6/IwzSYQP67sy/BMFXIFaCCsoXzFLr7A==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x - '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} - engines: {node: '>=18.18'} + '@firebase/auth-interop-types@0.2.4': + resolution: {integrity: sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA==} - '@inquirer/checkbox@4.1.5': - resolution: {integrity: sha512-swPczVU+at65xa5uPfNP9u3qx/alNwiaykiI/ExpsmMSQW55trmZcwhYWzw/7fj+n6Q8z1eENvR7vFfq9oPSAQ==} - engines: {node: '>=18'} + '@firebase/auth-types@0.13.0': + resolution: {integrity: sha512-S/PuIjni0AQRLF+l9ck0YpsMOdE8GO2KU6ubmBB7P+7TJUCQDa3R1dlgYm9UzGbbePMZsp0xzB93f2b/CgxMOg==} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app-types': 0.x + '@firebase/util': 1.x - '@inquirer/confirm@5.1.9': - resolution: {integrity: sha512-NgQCnHqFTjF7Ys2fsqK2WtnA8X1kHyInyG+nMIuHowVTIgIuS10T4AznI/PvbqSpJqjCUqNBlKGh1v3bwLFL4w==} - engines: {node: '>=18'} + '@firebase/auth@1.12.0': + resolution: {integrity: sha512-zkvLpsrxynWHk07qGrUDfCSqKf4AvfZGEqJ7mVCtYGjNNDbGE71k0Yn84rg8QEZu4hQw1BC0qDEHzpNVBcSVmA==} + engines: {node: '>=20.0.0'} peerDependencies: - '@types/node': '>=18' + '@firebase/app': 0.x + '@react-native-async-storage/async-storage': ^2.2.0 peerDependenciesMeta: - '@types/node': + '@react-native-async-storage/async-storage': optional: true - '@inquirer/core@10.1.10': - resolution: {integrity: sha512-roDaKeY1PYY0aCqhRmXihrHjoSW2A00pV3Ke5fTpMCkzcGF64R8e0lw3dK+eLEHwS4vB5RnW1wuQmvzoRul8Mw==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/component@0.7.0': + resolution: {integrity: sha512-wR9En2A+WESUHexjmRHkqtaVH94WLNKt6rmeqZhSLBybg4Wyf0Umk04SZsS6sBq4102ZsDBFwoqMqJYj2IoDSg==} + engines: {node: '>=20.0.0'} - '@inquirer/editor@4.2.10': - resolution: {integrity: sha512-5GVWJ+qeI6BzR6TIInLP9SXhWCEcvgFQYmcRG6d6RIlhFjM5TyG18paTGBgRYyEouvCmzeco47x9zX9tQEofkw==} - engines: {node: '>=18'} + '@firebase/data-connect@0.3.12': + resolution: {integrity: sha512-baPddcoNLj/+vYo+HSJidJUdr5W4OkhT109c5qhR8T1dJoZcyJpkv/dFpYlw/VJ3dV66vI8GHQFrmAZw/xUS4g==} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app': 0.x - '@inquirer/expand@4.0.12': - resolution: {integrity: sha512-jV8QoZE1fC0vPe6TnsOfig+qwu7Iza1pkXoUJ3SroRagrt2hxiL+RbM432YAihNR7m7XnU0HWl/WQ35RIGmXHw==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/database-compat@2.1.0': + resolution: {integrity: sha512-8nYc43RqxScsePVd1qe1xxvWNf0OBnbwHxmXJ7MHSuuTVYFO3eLyLW3PiCKJ9fHnmIz4p4LbieXwz+qtr9PZDg==} + engines: {node: '>=20.0.0'} - '@inquirer/figures@1.0.11': - resolution: {integrity: sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==} - engines: {node: '>=18'} + '@firebase/database-types@1.0.16': + resolution: {integrity: sha512-xkQLQfU5De7+SPhEGAXFBnDryUWhhlFXelEg2YeZOQMCdoe7dL64DDAd77SQsR+6uoXIZY5MB4y/inCs4GTfcw==} - '@inquirer/input@4.1.9': - resolution: {integrity: sha512-mshNG24Ij5KqsQtOZMgj5TwEjIf+F2HOESk6bjMwGWgcH5UBe8UoljwzNFHqdMbGYbgAf6v2wU/X9CAdKJzgOA==} - engines: {node: '>=18'} + '@firebase/database@1.1.0': + resolution: {integrity: sha512-gM6MJFae3pTyNLoc9VcJNuaUDej0ctdjn3cVtILo3D5lpp0dmUHHLFN/pUKe7ImyeB1KAvRlEYxvIHNF04Filg==} + engines: {node: '>=20.0.0'} + + '@firebase/firestore-compat@0.4.3': + resolution: {integrity: sha512-1ylF/njF68Pmb6p0erP0U78XQv1w77Wap4bUmqZ7ZVkmN1oMgplyu0TyirWtCBoKFRV2+SUZfWXvIij/z39LYg==} + engines: {node: '>=20.0.0'} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app-compat': 0.x - '@inquirer/number@3.0.12': - resolution: {integrity: sha512-7HRFHxbPCA4e4jMxTQglHJwP+v/kpFsCf2szzfBHy98Wlc3L08HL76UDiA87TOdX5fwj2HMOLWqRWv9Pnn+Z5Q==} - engines: {node: '>=18'} + '@firebase/firestore-types@3.0.3': + resolution: {integrity: sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q==} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app-types': 0.x + '@firebase/util': 1.x - '@inquirer/password@4.0.12': - resolution: {integrity: sha512-FlOB0zvuELPEbnBYiPaOdJIaDzb2PmJ7ghi/SVwIHDDSQ2K4opGBkF+5kXOg6ucrtSUQdLhVVY5tycH0j0l+0g==} - engines: {node: '>=18'} + '@firebase/firestore@4.9.3': + resolution: {integrity: sha512-RVuvhcQzs1sD5Osr2naQS71H0bQMbSnib16uOWAKk3GaKb/WBPyCYSr2Ry7MqlxDP/YhwknUxECL07lw9Rq1nA==} + engines: {node: '>=20.0.0'} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app': 0.x - '@inquirer/prompts@7.5.0': - resolution: {integrity: sha512-tk8Bx7l5AX/CR0sVfGj3Xg6v7cYlFBkEahH+EgBB+cZib6Fc83dwerTbzj7f2+qKckjIUGsviWRI1d7lx6nqQA==} - engines: {node: '>=18'} + '@firebase/functions-compat@0.4.1': + resolution: {integrity: sha512-AxxUBXKuPrWaVNQ8o1cG1GaCAtXT8a0eaTDfqgS5VsRYLAR0ALcfqDLwo/QyijZj1w8Qf8n3Qrfy/+Im245hOQ==} + engines: {node: '>=20.0.0'} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app-compat': 0.x - '@inquirer/rawlist@4.1.0': - resolution: {integrity: sha512-6ob45Oh9pXmfprKqUiEeMz/tjtVTFQTgDDz1xAMKMrIvyrYjAmRbQZjMJfsictlL4phgjLhdLu27IkHNnNjB7g==} - engines: {node: '>=18'} + '@firebase/functions-types@0.6.3': + resolution: {integrity: sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg==} + + '@firebase/functions@0.13.1': + resolution: {integrity: sha512-sUeWSb0rw5T+6wuV2o9XNmh9yHxjFI9zVGFnjFi+n7drTEWpl7ZTz1nROgGrSu472r+LAaj+2YaSicD4R8wfbw==} + engines: {node: '>=20.0.0'} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app': 0.x - '@inquirer/search@3.0.12': - resolution: {integrity: sha512-H/kDJA3kNlnNIjB8YsaXoQI0Qccgf0Na14K1h8ExWhNmUg2E941dyFPrZeugihEa9AZNW5NdsD/NcvUME83OPQ==} - engines: {node: '>=18'} + '@firebase/installations-compat@0.2.19': + resolution: {integrity: sha512-khfzIY3EI5LePePo7vT19/VEIH1E3iYsHknI/6ek9T8QCozAZshWT9CjlwOzZrKvTHMeNcbpo/VSOSIWDSjWdQ==} peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true + '@firebase/app-compat': 0.x - '@inquirer/select@4.2.0': - resolution: {integrity: sha512-KkXQ4aSySWimpV4V/TUJWdB3tdfENZUU765GjOIZ0uPwdbGIG6jrxD4dDf1w68uP+DVtfNhr1A92B+0mbTZ8FA==} - engines: {node: '>=18'} + '@firebase/installations-types@0.5.3': + resolution: {integrity: sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA==} + peerDependencies: + '@firebase/app-types': 0.x + + '@firebase/installations@0.6.19': + resolution: {integrity: sha512-nGDmiwKLI1lerhwfwSHvMR9RZuIH5/8E3kgUWnVRqqL7kGVSktjLTWEMva7oh5yxQ3zXfIlIwJwMcaM5bK5j8Q==} + peerDependencies: + '@firebase/app': 0.x + + '@firebase/logger@0.5.0': + resolution: {integrity: sha512-cGskaAvkrnh42b3BA3doDWeBmuHFO/Mx5A83rbRDYakPjO9bJtRL3dX7javzc2Rr/JHZf4HlterTW2lUkfeN4g==} + engines: {node: '>=20.0.0'} + + '@firebase/messaging-compat@0.2.23': + resolution: {integrity: sha512-SN857v/kBUvlQ9X/UjAqBoQ2FEaL1ZozpnmL1ByTe57iXkmnVVFm9KqAsTfmf+OEwWI4kJJe9NObtN/w22lUgg==} + peerDependencies: + '@firebase/app-compat': 0.x + + '@firebase/messaging-interop-types@0.2.3': + resolution: {integrity: sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q==} + + '@firebase/messaging@0.12.23': + resolution: {integrity: sha512-cfuzv47XxqW4HH/OcR5rM+AlQd1xL/VhuaeW/wzMW1LFrsFcTn0GND/hak1vkQc2th8UisBcrkVcQAnOnKwYxg==} + peerDependencies: + '@firebase/app': 0.x + + '@firebase/performance-compat@0.2.22': + resolution: {integrity: sha512-xLKxaSAl/FVi10wDX/CHIYEUP13jXUjinL+UaNXT9ByIvxII5Ne5150mx6IgM8G6Q3V+sPiw9C8/kygkyHUVxg==} + peerDependencies: + '@firebase/app-compat': 0.x + + '@firebase/performance-types@0.2.3': + resolution: {integrity: sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ==} + + '@firebase/performance@0.7.9': + resolution: {integrity: sha512-UzybENl1EdM2I1sjYm74xGt/0JzRnU/0VmfMAKo2LSpHJzaj77FCLZXmYQ4oOuE+Pxtt8Wy2BVJEENiZkaZAzQ==} + peerDependencies: + '@firebase/app': 0.x + + '@firebase/remote-config-compat@0.2.20': + resolution: {integrity: sha512-P/ULS9vU35EL9maG7xp66uljkZgcPMQOxLj3Zx2F289baTKSInE6+YIkgHEi1TwHoddC/AFePXPpshPlEFkbgg==} + peerDependencies: + '@firebase/app-compat': 0.x + + '@firebase/remote-config-types@0.5.0': + resolution: {integrity: sha512-vI3bqLoF14L/GchtgayMiFpZJF+Ao3uR8WCde0XpYNkSokDpAKca2DxvcfeZv7lZUqkUwQPL2wD83d3vQ4vvrg==} + + '@firebase/remote-config@0.7.0': + resolution: {integrity: sha512-dX95X6WlW7QlgNd7aaGdjAIZUiQkgWgNS+aKNu4Wv92H1T8Ue/NDUjZHd9xb8fHxLXIHNZeco9/qbZzr500MjQ==} + peerDependencies: + '@firebase/app': 0.x + + '@firebase/storage-compat@0.4.0': + resolution: {integrity: sha512-vDzhgGczr1OfcOy285YAPur5pWDEvD67w4thyeCUh6Ys0izN9fNYtA1MJERmNBfqjqu0lg0FM5GLbw0Il21M+g==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x + + '@firebase/storage-types@0.8.3': + resolution: {integrity: sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg==} + peerDependencies: + '@firebase/app-types': 0.x + '@firebase/util': 1.x + + '@firebase/storage@0.14.0': + resolution: {integrity: sha512-xWWbb15o6/pWEw8H01UQ1dC5U3rf8QTAzOChYyCpafV6Xki7KVp3Yaw2nSklUwHEziSWE9KoZJS7iYeyqWnYFA==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + + '@firebase/util@1.13.0': + resolution: {integrity: sha512-0AZUyYUfpMNcztR5l09izHwXkZpghLgCUaAGjtMwXnCg3bj4ml5VgiwqOMOxJ+Nw4qN/zJAaOQBcJ7KGkWStqQ==} + engines: {node: '>=20.0.0'} + + '@firebase/webchannel-wrapper@1.0.5': + resolution: {integrity: sha512-+uGNN7rkfn41HLO0vekTFhTxk61eKa8mTpRGLO0QSqlQdKvIoGAvLp3ppdVIWbTGYJWM6Kp0iN+PjMIOcnVqTw==} + + '@glideapps/ts-necessities@2.2.3': + resolution: {integrity: sha512-gXi0awOZLHk3TbW55GZLCPP6O+y/b5X1pBXKBVckFONSwF1z1E5ND2BGJsghQFah+pW7pkkyFb2VhUQI2qhL5w==} + + '@google-cloud/common@6.0.0': + resolution: {integrity: sha512-IXh04DlkLMxWgYLIUYuHHKXKOUwPDzDgke1ykkkJPe48cGIS9kkL2U/o0pm4ankHLlvzLF/ma1eO86n/bkumIA==} + engines: {node: '>=18'} + + '@google-cloud/precise-date@5.0.0': + resolution: {integrity: sha512-9h0Gvw92EvPdE8AK8AgZPbMnH5ftDyPtKm7/KUfcJVaPEPjwGDsJd1QV0H8esBDV4II41R/2lDWH1epBqIoKUw==} + engines: {node: '>=18'} + + '@google-cloud/projectify@4.0.0': + resolution: {integrity: sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==} + engines: {node: '>=14.0.0'} + + '@google-cloud/projectify@5.0.0': + resolution: {integrity: sha512-XXQLaIcLrOAMWvRrzz+mlUGtN6vlVNja3XQbMqRi/V7XJTAVwib3VcKd7oRwyZPkp7rBVlHGcaqdyGRrcnkhlA==} + engines: {node: '>=18'} + + '@google-cloud/promisify@4.1.0': + resolution: {integrity: sha512-G/FQx5cE/+DqBbOpA5jKsegGwdPniU6PuIEMt+qxWgFxvxuFOzVmp6zYchtYuwAWV5/8Dgs0yAmjvNZv3uXLQg==} + engines: {node: '>=18'} + + '@google-cloud/promisify@5.0.0': + resolution: {integrity: sha512-N8qS6dlORGHwk7WjGXKOSsLjIjNINCPicsOX6gyyLiYk7mq3MtII96NZ9N2ahwA2vnkLmZODOIH9rlNniYWvCQ==} + engines: {node: '>=18'} + + '@google-cloud/spanner@8.0.0': + resolution: {integrity: sha512-IJn+8A3QZJfe7FUtWqHVNo3xJs7KFpurCWGWCiCz3oEh+BkRymKZ1QxfAbU2yGMDzTytLGQ2IV6T2r3cuo75/w==} + engines: {node: '>=18'} + + '@google/genai@1.33.0': + resolution: {integrity: sha512-ThUjFZ1N0DU88peFjnQkb8K198EWaW2RmmnDShFQ+O+xkIH9itjpRe358x3L/b4X/A7dimkvq63oz49Vbh7Cog==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@modelcontextprotocol/sdk': ^1.24.0 + peerDependenciesMeta: + '@modelcontextprotocol/sdk': + optional: true + + '@grpc/grpc-js@1.14.3': + resolution: {integrity: sha512-Iq8QQQ/7X3Sac15oB6p0FmUg/klxQvXLeileoqrTRGJYLV+/9tubbr9ipz0GKHjmXVsgFPo/+W+2cA8eNcR+XA==} + engines: {node: '>=12.10.0'} + + '@grpc/grpc-js@1.9.15': + resolution: {integrity: sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==} + engines: {node: ^8.13.0 || >=10.10.0} + + '@grpc/proto-loader@0.7.15': + resolution: {integrity: sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==} + engines: {node: '>=6'} + hasBin: true + + '@grpc/proto-loader@0.8.0': + resolution: {integrity: sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==} + engines: {node: '>=6'} + hasBin: true + + '@hapi/bourne@3.0.0': + resolution: {integrity: sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==} + + '@hono/node-server@1.19.7': + resolution: {integrity: sha512-vUcD0uauS7EU2caukW8z5lJKtoGMokxNbJtBiwHgpqxEXokaHCBkQUmCHhjFB1VUTWdqj25QoMkMKzgjq+uhrw==} + engines: {node: '>=18.14.1'} + peerDependencies: + hono: ^4 + + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.7': + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} + + '@inquirer/ansi@1.0.2': + resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==} + engines: {node: '>=18'} + + '@inquirer/ansi@2.0.2': + resolution: {integrity: sha512-SYLX05PwJVnW+WVegZt1T4Ip1qba1ik+pNJPDiqvk6zS5Y/i8PhRzLpGEtVd7sW0G8cMtkD8t4AZYhQwm8vnww==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + + '@inquirer/checkbox@4.3.2': + resolution: {integrity: sha512-VXukHf0RR1doGe6Sm4F0Em7SWYLTHSsbGfJdS9Ja2bX5/D5uwVOEjr07cncLROdBvmnvCATYEWlHqYmXv2IlQA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/checkbox@5.0.3': + resolution: {integrity: sha512-xtQP2eXMFlOcAhZ4ReKP2KZvDIBb1AnCfZ81wWXG3DXLVH0f0g4obE0XDPH+ukAEMRcZT0kdX2AS1jrWGXbpxw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@5.1.21': + resolution: {integrity: sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.0.3': + resolution: {integrity: sha512-lyEvibDFL+NA5R4xl8FUmNhmu81B+LDL9L/MpKkZlQDJZXzG8InxiqYxiAlQYa9cqLLhYqKLQwZqXmSTqCLjyw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@10.3.2': + resolution: {integrity: sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@11.1.0': + resolution: {integrity: sha512-+jD/34T1pK8M5QmZD/ENhOfXdl9Zr+BrQAUc5h2anWgi7gggRq15ZbiBeLoObj0TLbdgW7TAIQRU2boMc9uOKQ==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' peerDependenciesMeta: '@types/node': optional: true - '@inquirer/type@1.5.5': - resolution: {integrity: sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==} + '@inquirer/editor@4.2.23': + resolution: {integrity: sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==} engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.0.3': + resolution: {integrity: sha512-wYyQo96TsAqIciP/r5D3cFeV8h4WqKQ/YOvTg5yOfP2sqEbVVpbxPpfV3LM5D0EP4zUI3EZVHyIUIllnoIa8OQ==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true - '@inquirer/type@3.0.6': - resolution: {integrity: sha512-/mKVCtVpyBu3IDarv0G+59KC4stsD5mDsGpYh+GKs1NZT88Jh52+cuoA1AtLk2Q0r/quNl+1cSUyLRHBFeD0XA==} + '@inquirer/expand@4.0.23': + resolution: {integrity: sha512-nRzdOyFYnpeYTTR2qFwEVmIWypzdAx/sIkCMeTNTcflFOovfqUk+HcFhQQVBftAh9gmGrpFj6QcGEqrDMDOiew==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -1949,6 +2257,193 @@ packages: '@types/node': optional: true + '@inquirer/expand@5.0.3': + resolution: {integrity: sha512-2oINvuL27ujjxd95f6K2K909uZOU2x1WiAl7Wb1X/xOtL8CgQ1kSxzykIr7u4xTkXkXOAkCuF45T588/YKee7w==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@1.0.3': + resolution: {integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@2.0.2': + resolution: {integrity: sha512-X/fMXK7vXomRWEex1j8mnj7s1mpnTeP4CO/h2gysJhHLT2WjBnLv4ZQEGpm/kcYI8QfLZ2fgW+9kTKD+jeopLg==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@1.0.15': + resolution: {integrity: sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==} + engines: {node: '>=18'} + + '@inquirer/figures@2.0.2': + resolution: {integrity: sha512-qXm6EVvQx/FmnSrCWCIGtMHwqeLgxABP8XgcaAoywsL0NFga9gD5kfG0gXiv80GjK9Hsoz4pgGwF/+CjygyV9A==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + + '@inquirer/input@4.3.1': + resolution: {integrity: sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/input@5.0.3': + resolution: {integrity: sha512-4R0TdWl53dtp79Vs6Df2OHAtA2FVNqya1hND1f5wjHWxZJxwDMSNB1X5ADZJSsQKYAJ5JHCTO+GpJZ42mK0Otw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@3.0.23': + resolution: {integrity: sha512-5Smv0OK7K0KUzUfYUXDXQc9jrf8OHo4ktlEayFlelCjwMXz0299Y8OrI+lj7i4gCBY15UObk76q0QtxjzFcFcg==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.0.3': + resolution: {integrity: sha512-TjQLe93GGo5snRlu83JxE38ZPqj5ZVggL+QqqAF2oBA5JOJoxx25GG3EGH/XN/Os5WOmKfO8iLVdCXQxXRZIMQ==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@4.0.23': + resolution: {integrity: sha512-zREJHjhT5vJBMZX/IUbyI9zVtVfOLiTO66MrF/3GFZYZ7T4YILW5MSkEYHceSii/KtRk+4i3RE7E1CUXA2jHcA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.0.3': + resolution: {integrity: sha512-rCozGbUMAHedTeYWEN8sgZH4lRCdgG/WinFkit6ZPsp8JaNg2T0g3QslPBS5XbpORyKP/I+xyBO81kFEvhBmjA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@7.10.1': + resolution: {integrity: sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.1.0': + resolution: {integrity: sha512-LsZMdKcmRNF5LyTRuZE5nWeOjganzmN3zwbtNfcs6GPh3I2TsTtF1UYZlbxVfhxd+EuUqLGs/Lm3Xt4v6Az1wA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@4.1.11': + resolution: {integrity: sha512-+LLQB8XGr3I5LZN/GuAHo+GpDJegQwuPARLChlMICNdwW7OwV2izlCSCxN6cqpL0sMXmbKbFcItJgdQq5EBXTw==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.1.0': + resolution: {integrity: sha512-yUCuVh0jW026Gr2tZlG3kHignxcrLKDR3KBp+eUgNz+BAdSeZk0e18yt2gyBr+giYhj/WSIHCmPDOgp1mT2niQ==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@3.2.2': + resolution: {integrity: sha512-p2bvRfENXCZdWF/U2BXvnSI9h+tuA8iNqtUKb9UWbmLYCRQxd8WkvwWvYn+3NgYaNwdUkHytJMGG4MMLucI1kA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.0.3': + resolution: {integrity: sha512-lzqVw0YwuKYetk5VwJ81Ba+dyVlhseHPx9YnRKQgwXdFS0kEavCz2gngnNhnMIxg8+j1N/rUl1t5s1npwa7bqg==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@4.4.2': + resolution: {integrity: sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.0.3': + resolution: {integrity: sha512-M+ynbwS0ecQFDYMFrQrybA0qL8DV0snpc4kKevCCNaTpfghsRowRY7SlQBeIYNzHqXtiiz4RG9vTOeb/udew7w==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@3.0.10': + resolution: {integrity: sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.0.2': + resolution: {integrity: sha512-cae7mzluplsjSdgFA6ACLygb5jC8alO0UUnFPyu0E7tNRPrL+q/f8VcSXp+cjZQ7l5CMpDpi2G1+IQvkOiL1Lw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/balanced-match@4.0.1': + resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} + engines: {node: 20 || >=22} + + '@isaacs/brace-expansion@5.0.0': + resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} + engines: {node: 20 || >=22} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1961,26 +2456,24 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - '@jridgewell/gen-mapping@0.3.8': - resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} - engines: {node: '>=6.0.0'} + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - - '@jridgewell/source-map@0.3.6': - resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} + '@jridgewell/source-map@0.3.11': + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} @@ -1994,14 +2487,32 @@ packages: peerDependencies: tslib: '2' - '@jsonjoy.com/json-pack@1.2.0': - resolution: {integrity: sha512-io1zEbbYcElht3tdlqEOFxZ0dMTYrHz9iMf0gqn1pPjZFTCgM5R4R5IMA20Chb2UPYYsxjzs8CgZ7Nb5n2K2rA==} + '@jsonjoy.com/buffers@1.2.1': + resolution: {integrity: sha512-12cdlDwX4RUM3QxmUbVJWqZ/mrK6dFQH4Zxq6+r1YXKXYBNgZXndx2qbCJwh3+WWkCSn67IjnlG3XYTvmvYtgA==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + + '@jsonjoy.com/codegen@1.0.0': + resolution: {integrity: sha512-E8Oy+08cmCf0EK/NMxpaJZmOxPqM+6iSe2S4nlSBrPZOORoDJILxtbSUEDKQyTamm/BVAhIGllOBNU79/dwf0g==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + + '@jsonjoy.com/json-pack@1.21.0': + resolution: {integrity: sha512-+AKG+R2cfZMShzrF2uQw34v3zbeDYUqnQ+jg7ORic3BGtfw9p/+N6RJbq/kkV8JmYZaINknaEQ2m0/f693ZPpg==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + + '@jsonjoy.com/json-pointer@1.0.2': + resolution: {integrity: sha512-Fsn6wM2zlDzY1U+v4Nc8bo3bVqgfNTGcn6dMgs6FjrEnt4ZCe60o6ByKRjOGlI2gow0aE/Q41QOigdTqkyK5fg==} engines: {node: '>=10.0'} peerDependencies: tslib: '2' - '@jsonjoy.com/util@1.6.0': - resolution: {integrity: sha512-sw/RMbehRhN68WRtcKCpQOPfnH6lLP4GJfqzi3iYej8tnzpZUDr6UkZYJjcjjC0FWEJOJbyM3PTIwxucUmDG2A==} + '@jsonjoy.com/util@1.9.0': + resolution: {integrity: sha512-pLuQo+VPRnN8hfPqUTLTHk126wuYdXVxE6aDmjSeV4NCAgyxWbiOIeNJVtID3h1Vzpoi9m4jXezf73I6LgabgQ==} engines: {node: '>=10.0'} peerDependencies: tslib: '2' @@ -2009,53 +2520,57 @@ packages: '@leichtgewicht/ip-codec@2.0.5': resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} - '@listr2/prompt-adapter-inquirer@2.0.22': - resolution: {integrity: sha512-hV36ZoY+xKL6pYOt1nPNnkciFkn89KZwqLhAFzJvYysAvL5uBQdiADZx/8bIDXIukzzwG0QlPYolgMzQUtKgpQ==} - engines: {node: '>=18.0.0'} + '@listr2/prompt-adapter-inquirer@3.0.5': + resolution: {integrity: sha512-WELs+hj6xcilkloBXYf9XXK8tYEnKsgLj01Xl5ONUJpKjmT5hGVUzNUS5tooUxs7pGMrw+jFD/41WpqW4V3LDA==} + engines: {node: '>=20.0.0'} peerDependencies: '@inquirer/prompts': '>= 3 < 8' + listr2: 9.0.5 - '@lmdb/lmdb-darwin-arm64@3.3.0': - resolution: {integrity: sha512-LipbQobyEfQtu8WixasaFUZZ+JCGlho4OWwWIQ5ol0rB1RKkcZvypu7sS1CBvofBGVAa3vbOh8IOGQMrbmL5dg==} + '@lmdb/lmdb-darwin-arm64@3.4.4': + resolution: {integrity: sha512-XaKL705gDWd6XVls3ATDj13ZdML/LqSIxwgnYpG8xTzH2ifArx8fMMDdvqGE/Emd+W6R90W2fveZcJ0AyS8Y0w==} cpu: [arm64] os: [darwin] - '@lmdb/lmdb-darwin-x64@3.3.0': - resolution: {integrity: sha512-yA+9P+ZeA3vg76BLXWeUomIAjxfmSmR2eg8fueHXDg5Xe1Xmkl9JCKuHXUhtJ+mMVcH12d5k4kJBLbyXTadfGQ==} + '@lmdb/lmdb-darwin-x64@3.4.4': + resolution: {integrity: sha512-GPHGEVcwJlkD01GmIr7B4kvbIcUDS2+kBadVEd7lU4can1RZaZQLDDBJRrrNfS2Kavvl0VLI/cMv7UASAXGrww==} cpu: [x64] os: [darwin] - '@lmdb/lmdb-linux-arm64@3.3.0': - resolution: {integrity: sha512-OeWvSgjXXZ/zmtLqqL78I3910F6UYpUubmsUU+iBHo6nTtjkpXms95rJtGrjkWQqwswKBD7xSMplbYC4LEsiPA==} + '@lmdb/lmdb-linux-arm64@3.4.4': + resolution: {integrity: sha512-mALqr7DE42HsiwVTKpQWxacjHoJk+e9p00RWIJqTACh/hpucxp/0lK/XMh5XzWnU/TDCZLukq1+vNqnNumTP/Q==} cpu: [arm64] os: [linux] - '@lmdb/lmdb-linux-arm@3.3.0': - resolution: {integrity: sha512-EDYrW9kle+8wI19JCj/PhRnGoCN9bked5cdOPdo1wdgH/HzjgoLPFTn9DHlZccgTEVhp3O+bpWXdN/rWySVvjw==} + '@lmdb/lmdb-linux-arm@3.4.4': + resolution: {integrity: sha512-cmev5/dZr5ACKri9f6GU6lZCXTjMhV72xujlbOhFCgFXrt4W0TxGsmY8kA1BITvH60JBKE50cSxsiulybAbrrw==} cpu: [arm] os: [linux] - '@lmdb/lmdb-linux-x64@3.3.0': - resolution: {integrity: sha512-wDd02mt5ScX4+xd6g78zKBr6ojpgCJCTrllCAabjgap5FzuETqOqaQfKhO+tJuGWv/J5q+GIds6uY7rNFueOxg==} + '@lmdb/lmdb-linux-x64@3.4.4': + resolution: {integrity: sha512-QjLs8OcmCNcraAcLoZyFlo0atzBJniQLLwhtR+ymQqS5kLYpV5RqwriL87BW+ZiR9ZiGgZx3evrz5vnWPtJ1fQ==} cpu: [x64] os: [linux] - '@lmdb/lmdb-win32-arm64@3.3.0': - resolution: {integrity: sha512-COotWhHJgzXULLiEjOgWQwqig6PoA+6ji6W+sDl6M1HhMXWIymEVHGs0edsVSNtsNSCAWMxJgR3asv6FNX/2EA==} + '@lmdb/lmdb-win32-arm64@3.4.4': + resolution: {integrity: sha512-tr/pwHDlZ33forLGAr0tI04cRmP4SgF93yHbb+2zvZiDEyln5yMHhbKDySxY66aUOkhvBvTuHq9q/3YmTj6ZHQ==} cpu: [arm64] os: [win32] - '@lmdb/lmdb-win32-x64@3.3.0': - resolution: {integrity: sha512-kqUgQH+l8HDbkAapx+aoko7Ez4X4DqkIraOqY/k0QY5EN/iialVlFpBUXh4wFXzirdmEVjbIUMrceUh0Kh8LeA==} + '@lmdb/lmdb-win32-x64@3.4.4': + resolution: {integrity: sha512-KRzfocJzB/mgoTCqnMawuLSKheHRVTqWfSmouIgYpFs6Hx4zvZSvsZKSCEb5gHmICy7qsx9l06jk3MFTtiFVAQ==} cpu: [x64] os: [win32] - '@mdn/browser-compat-data@6.0.12': - resolution: {integrity: sha512-lQ6p212jKeJBG+L7UYRKchTCcnQbp6yOj5swKxGLjvuW4SmbgWgd/WyA1Dxq1GGT86C7jVTEaKry36LmsBp8SQ==} - - '@modelcontextprotocol/sdk@1.11.0': - resolution: {integrity: sha512-k/1pb70eD638anoi0e8wUGAlbMJXyvdV4p62Ko+EZ7eBe1xMx8Uhak1R5DgfoofsK5IBBnRwsYGTaLZl+6/+RQ==} + '@modelcontextprotocol/sdk@1.25.0': + resolution: {integrity: sha512-z0Zhn/LmQ3yz91dEfd5QgS7DpSjA4pk+3z2++zKgn5L6iDFM9QapsVoAQSbKLvlrFsZk9+ru6yHHWNq2lCYJKQ==} engines: {node: '>=18'} + peerDependencies: + '@cfworker/json-schema': ^4.1.1 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + '@cfworker/json-schema': + optional: true '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3': resolution: {integrity: sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==} @@ -2087,106 +2602,126 @@ packages: cpu: [x64] os: [win32] - '@napi-rs/nice-android-arm-eabi@1.0.1': - resolution: {integrity: sha512-5qpvOu5IGwDo7MEKVqqyAxF90I6aLj4n07OzpARdgDRfz8UbBztTByBp0RC59r3J1Ij8uzYi6jI7r5Lws7nn6w==} + '@mswjs/interceptors@0.39.8': + resolution: {integrity: sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA==} + engines: {node: '>=18'} + + '@napi-rs/nice-android-arm-eabi@1.1.1': + resolution: {integrity: sha512-kjirL3N6TnRPv5iuHw36wnucNqXAO46dzK9oPb0wj076R5Xm8PfUVA9nAFB5ZNMmfJQJVKACAPd/Z2KYMppthw==} engines: {node: '>= 10'} cpu: [arm] os: [android] - '@napi-rs/nice-android-arm64@1.0.1': - resolution: {integrity: sha512-GqvXL0P8fZ+mQqG1g0o4AO9hJjQaeYG84FRfZaYjyJtZZZcMjXW5TwkL8Y8UApheJgyE13TQ4YNUssQaTgTyvA==} + '@napi-rs/nice-android-arm64@1.1.1': + resolution: {integrity: sha512-blG0i7dXgbInN5urONoUCNf+DUEAavRffrO7fZSeoRMJc5qD+BJeNcpr54msPF6qfDD6kzs9AQJogZvT2KD5nw==} engines: {node: '>= 10'} cpu: [arm64] os: [android] - '@napi-rs/nice-darwin-arm64@1.0.1': - resolution: {integrity: sha512-91k3HEqUl2fsrz/sKkuEkscj6EAj3/eZNCLqzD2AA0TtVbkQi8nqxZCZDMkfklULmxLkMxuUdKe7RvG/T6s2AA==} + '@napi-rs/nice-darwin-arm64@1.1.1': + resolution: {integrity: sha512-s/E7w45NaLqTGuOjC2p96pct4jRfo61xb9bU1unM/MJ/RFkKlJyJDx7OJI/O0ll/hrfpqKopuAFDV8yo0hfT7A==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@napi-rs/nice-darwin-x64@1.0.1': - resolution: {integrity: sha512-jXnMleYSIR/+TAN/p5u+NkCA7yidgswx5ftqzXdD5wgy/hNR92oerTXHc0jrlBisbd7DpzoaGY4cFD7Sm5GlgQ==} + '@napi-rs/nice-darwin-x64@1.1.1': + resolution: {integrity: sha512-dGoEBnVpsdcC+oHHmW1LRK5eiyzLwdgNQq3BmZIav+9/5WTZwBYX7r5ZkQC07Nxd3KHOCkgbHSh4wPkH1N1LiQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@napi-rs/nice-freebsd-x64@1.0.1': - resolution: {integrity: sha512-j+iJ/ezONXRQsVIB/FJfwjeQXX7A2tf3gEXs4WUGFrJjpe/z2KB7sOv6zpkm08PofF36C9S7wTNuzHZ/Iiccfw==} + '@napi-rs/nice-freebsd-x64@1.1.1': + resolution: {integrity: sha512-kHv4kEHAylMYmlNwcQcDtXjklYp4FCf0b05E+0h6nDHsZ+F0bDe04U/tXNOqrx5CmIAth4vwfkjjUmp4c4JktQ==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] - '@napi-rs/nice-linux-arm-gnueabihf@1.0.1': - resolution: {integrity: sha512-G8RgJ8FYXYkkSGQwywAUh84m946UTn6l03/vmEXBYNJxQJcD+I3B3k5jmjFG/OPiU8DfvxutOP8bi+F89MCV7Q==} + '@napi-rs/nice-linux-arm-gnueabihf@1.1.1': + resolution: {integrity: sha512-E1t7K0efyKXZDoZg1LzCOLxgolxV58HCkaEkEvIYQx12ht2pa8hoBo+4OB3qh7e+QiBlp1SRf+voWUZFxyhyqg==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@napi-rs/nice-linux-arm64-gnu@1.0.1': - resolution: {integrity: sha512-IMDak59/W5JSab1oZvmNbrms3mHqcreaCeClUjwlwDr0m3BoR09ZiN8cKFBzuSlXgRdZ4PNqCYNeGQv7YMTjuA==} + '@napi-rs/nice-linux-arm64-gnu@1.1.1': + resolution: {integrity: sha512-CIKLA12DTIZlmTaaKhQP88R3Xao+gyJxNWEn04wZwC2wmRapNnxCUZkVwggInMJvtVElA+D4ZzOU5sX4jV+SmQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] - '@napi-rs/nice-linux-arm64-musl@1.0.1': - resolution: {integrity: sha512-wG8fa2VKuWM4CfjOjjRX9YLIbysSVV1S3Kgm2Fnc67ap/soHBeYZa6AGMeR5BJAylYRjnoVOzV19Cmkco3QEPw==} + '@napi-rs/nice-linux-arm64-musl@1.1.1': + resolution: {integrity: sha512-+2Rzdb3nTIYZ0YJF43qf2twhqOCkiSrHx2Pg6DJaCPYhhaxbLcdlV8hCRMHghQ+EtZQWGNcS2xF4KxBhSGeutg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] - '@napi-rs/nice-linux-ppc64-gnu@1.0.1': - resolution: {integrity: sha512-lxQ9WrBf0IlNTCA9oS2jg/iAjQyTI6JHzABV664LLrLA/SIdD+I1i3Mjf7TsnoUbgopBcCuDztVLfJ0q9ubf6Q==} + '@napi-rs/nice-linux-ppc64-gnu@1.1.1': + resolution: {integrity: sha512-4FS8oc0GeHpwvv4tKciKkw3Y4jKsL7FRhaOeiPei0X9T4Jd619wHNe4xCLmN2EMgZoeGg+Q7GY7BsvwKpL22Tg==} engines: {node: '>= 10'} cpu: [ppc64] os: [linux] + libc: [glibc] - '@napi-rs/nice-linux-riscv64-gnu@1.0.1': - resolution: {integrity: sha512-3xs69dO8WSWBb13KBVex+yvxmUeEsdWexxibqskzoKaWx9AIqkMbWmE2npkazJoopPKX2ULKd8Fm9veEn0g4Ig==} + '@napi-rs/nice-linux-riscv64-gnu@1.1.1': + resolution: {integrity: sha512-HU0nw9uD4FO/oGCCk409tCi5IzIZpH2agE6nN4fqpwVlCn5BOq0MS1dXGjXaG17JaAvrlpV5ZeyZwSon10XOXw==} engines: {node: '>= 10'} cpu: [riscv64] os: [linux] + libc: [glibc] - '@napi-rs/nice-linux-s390x-gnu@1.0.1': - resolution: {integrity: sha512-lMFI3i9rlW7hgToyAzTaEybQYGbQHDrpRkg+1gJWEpH0PLAQoZ8jiY0IzakLfNWnVda1eTYYlxxFYzW8Rqczkg==} + '@napi-rs/nice-linux-s390x-gnu@1.1.1': + resolution: {integrity: sha512-2YqKJWWl24EwrX0DzCQgPLKQBxYDdBxOHot1KWEq7aY2uYeX+Uvtv4I8xFVVygJDgf6/92h9N3Y43WPx8+PAgQ==} engines: {node: '>= 10'} cpu: [s390x] os: [linux] + libc: [glibc] - '@napi-rs/nice-linux-x64-gnu@1.0.1': - resolution: {integrity: sha512-XQAJs7DRN2GpLN6Fb+ZdGFeYZDdGl2Fn3TmFlqEL5JorgWKrQGRUrpGKbgZ25UeZPILuTKJ+OowG2avN8mThBA==} + '@napi-rs/nice-linux-x64-gnu@1.1.1': + resolution: {integrity: sha512-/gaNz3R92t+dcrfCw/96pDopcmec7oCcAQ3l/M+Zxr82KT4DljD37CpgrnXV+pJC263JkW572pdbP3hP+KjcIg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] - '@napi-rs/nice-linux-x64-musl@1.0.1': - resolution: {integrity: sha512-/rodHpRSgiI9o1faq9SZOp/o2QkKQg7T+DK0R5AkbnI/YxvAIEHf2cngjYzLMQSQgUhxym+LFr+UGZx4vK4QdQ==} + '@napi-rs/nice-linux-x64-musl@1.1.1': + resolution: {integrity: sha512-xScCGnyj/oppsNPMnevsBe3pvNaoK7FGvMjT35riz9YdhB2WtTG47ZlbxtOLpjeO9SqqQ2J2igCmz6IJOD5JYw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] + + '@napi-rs/nice-openharmony-arm64@1.1.1': + resolution: {integrity: sha512-6uJPRVwVCLDeoOaNyeiW0gp2kFIM4r7PL2MczdZQHkFi9gVlgm+Vn+V6nTWRcu856mJ2WjYJiumEajfSm7arPQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [openharmony] - '@napi-rs/nice-win32-arm64-msvc@1.0.1': - resolution: {integrity: sha512-rEcz9vZymaCB3OqEXoHnp9YViLct8ugF+6uO5McifTedjq4QMQs3DHz35xBEGhH3gJWEsXMUbzazkz5KNM5YUg==} + '@napi-rs/nice-win32-arm64-msvc@1.1.1': + resolution: {integrity: sha512-uoTb4eAvM5B2aj/z8j+Nv8OttPf2m+HVx3UjA5jcFxASvNhQriyCQF1OB1lHL43ZhW+VwZlgvjmP5qF3+59atA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@napi-rs/nice-win32-ia32-msvc@1.0.1': - resolution: {integrity: sha512-t7eBAyPUrWL8su3gDxw9xxxqNwZzAqKo0Szv3IjVQd1GpXXVkb6vBBQUuxfIYaXMzZLwlxRQ7uzM2vdUE9ULGw==} + '@napi-rs/nice-win32-ia32-msvc@1.1.1': + resolution: {integrity: sha512-CNQqlQT9MwuCsg1Vd/oKXiuH+TcsSPJmlAFc5frFyX/KkOh0UpBLEj7aoY656d5UKZQMQFP7vJNa1DNUNORvug==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] - '@napi-rs/nice-win32-x64-msvc@1.0.1': - resolution: {integrity: sha512-JlF+uDcatt3St2ntBG8H02F1mM45i5SF9W+bIKiReVE6wiy3o16oBP/yxt+RZ+N6LbCImJXJ6bXNO2kn9AXicg==} + '@napi-rs/nice-win32-x64-msvc@1.1.1': + resolution: {integrity: sha512-vB+4G/jBQCAh0jelMTY3+kgFy00Hlx2f2/1zjMoH821IbplbWZOkLiTYXQkygNTzQJTq5cvwBDgn2ppHD+bglQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@napi-rs/nice@1.0.1': - resolution: {integrity: sha512-zM0mVWSXE0a0h9aKACLwKmD6nHcRiKrPpCfvaKqG1CqDEyjEawId0ocXxVzPMCAm6kkWr2P025msfxXEnt8UGQ==} + '@napi-rs/nice@1.1.1': + resolution: {integrity: sha512-xJIPs+bYuc9ASBl+cvGsKbGrJmS6fAKaSZCnT0lhahT5rhA2VVy9/EcIgd2JhtEuFOJNx7UHNn/qiTPTY4nrQw==} engines: {node: '>= 10'} + '@napi-rs/wasm-runtime@1.1.0': + resolution: {integrity: sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -2199,124 +2734,153 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@npmcli/agent@3.0.0': - resolution: {integrity: sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/agent@4.0.0': + resolution: {integrity: sha512-kAQTcEN9E8ERLVg5AsGwLNoFb+oEG6engbqAU2P43gD4JEIkNGMHdVQ096FsOAAYpZPB0RSt0zgInKIAS1l5QA==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/fs@4.0.0': - resolution: {integrity: sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/fs@5.0.0': + resolution: {integrity: sha512-7OsC1gNORBEawOa5+j2pXN9vsicaIOH5cPXxoR6fJOmH6/EXpJB2CajXOu1fPRFun2m1lktEFX11+P89hqO/og==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/git@6.0.3': - resolution: {integrity: sha512-GUYESQlxZRAdhs3UhbB6pVRNUELQOHXwK9ruDkwmCv2aZ5y0SApQzUJCg02p3A7Ue2J5hxvlk1YI53c00NmRyQ==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/git@7.0.1': + resolution: {integrity: sha512-+XTFxK2jJF/EJJ5SoAzXk3qwIDfvFc5/g+bD274LZ7uY7LE8sTfG6Z8rOanPl2ZEvZWqNvmEdtXC25cE54VcoA==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/installed-package-contents@3.0.0': - resolution: {integrity: sha512-fkxoPuFGvxyrH+OQzyTkX2LUEamrF4jZSmxjAtPPHHGO0dqsQ8tTKjnIS8SAnPHdk2I03BDtSMR5K/4loKg79Q==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/installed-package-contents@4.0.0': + resolution: {integrity: sha512-yNyAdkBxB72gtZ4GrwXCM0ZUedo9nIbOMKfGjt6Cu6DXf0p8y1PViZAKDC8q8kv/fufx0WTjRBdSlyrvnP7hmA==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true - '@npmcli/node-gyp@4.0.0': - resolution: {integrity: sha512-+t5DZ6mO/QFh78PByMq1fGSAub/agLJZDRfJRMeOSNCt8s9YVlTjmGpIPwPhvXTGUIJk+WszlT0rQa1W33yzNA==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/node-gyp@5.0.0': + resolution: {integrity: sha512-uuG5HZFXLfyFKqg8QypsmgLQW7smiRjVc45bqD/ofZZcR/uxEjgQU8qDPv0s9TEeMUiAAU/GC5bR6++UdTirIQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/package-json@6.1.1': - resolution: {integrity: sha512-d5qimadRAUCO4A/Txw71VM7UrRZzV+NPclxz/dc+M6B2oYwjWTjqh8HA/sGQgs9VZuJ6I/P7XIAlJvgrl27ZOw==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/package-json@7.0.4': + resolution: {integrity: sha512-0wInJG3j/K40OJt/33ax47WfWMzZTm6OQxB9cDhTt5huCP2a9g2GnlsxmfN+PulItNPIpPrZ+kfwwUil7eHcZQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/promise-spawn@8.0.2': - resolution: {integrity: sha512-/bNJhjc+o6qL+Dwz/bqfTQClkEO5nTQ1ZEcdCkAQjhkZMHIh22LPG7fNh1enJP1NKWDqYiiABnjFCY7E0zHYtQ==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/promise-spawn@9.0.1': + resolution: {integrity: sha512-OLUaoqBuyxeTqUvjA3FZFiXUfYC1alp3Sa99gW3EUDz3tZ3CbXDdcZ7qWKBzicrJleIgucoWamWH1saAmH/l2Q==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/redact@3.2.2': - resolution: {integrity: sha512-7VmYAmk4csGv08QzrDKScdzn11jHPFGyqJW39FyPgPuAp3zIaUmuCo1yxw9aGs+NEJuTGQ9Gwqpt93vtJubucg==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/redact@4.0.0': + resolution: {integrity: sha512-gOBg5YHMfZy+TfHArfVogwgfBeQnKbbGo3pSUyK/gSI0AVu+pEiDVcKlQb0D8Mg1LNRZILZ6XG8I5dJ4KuAd9Q==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/run-script@9.1.0': - resolution: {integrity: sha512-aoNSbxtkePXUlbZB+anS1LqsJdctG5n3UVhfU47+CDdwMi6uNTBMF9gPcQRnqghQd2FGzcwwIFBruFMxjhBewg==} - engines: {node: ^18.17.0 || >=20.5.0} + '@npmcli/run-script@10.0.3': + resolution: {integrity: sha512-ER2N6itRkzWbbtVmZ9WKaWxVlKlOeBFF1/7xx+KA5J1xKa4JjUwBdb6tDpk0v1qA+d+VDwHI9qmLcXSWcmi+Rw==} + engines: {node: ^20.17.0 || >=22.9.0} - '@octokit/auth-token@5.1.2': - resolution: {integrity: sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==} - engines: {node: '>= 18'} + '@octokit/auth-app@8.1.2': + resolution: {integrity: sha512-db8VO0PqXxfzI6GdjtgEFHY9tzqUql5xMFXYA12juq8TeTgPAuiiP3zid4h50lwlIP457p5+56PnJOgd2GGBuw==} + engines: {node: '>= 20'} - '@octokit/core@6.1.5': - resolution: {integrity: sha512-vvmsN0r7rguA+FySiCsbaTTobSftpIDIpPW81trAmsv9TGxg3YCujAxRYp/Uy8xmDgYCzzgulG62H7KYUFmeIg==} - engines: {node: '>= 18'} + '@octokit/auth-oauth-app@9.0.3': + resolution: {integrity: sha512-+yoFQquaF8OxJSxTb7rnytBIC2ZLbLqA/yb71I4ZXT9+Slw4TziV9j/kyGhUFRRTF2+7WlnIWsePZCWHs+OGjg==} + engines: {node: '>= 20'} - '@octokit/endpoint@10.1.4': - resolution: {integrity: sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==} - engines: {node: '>= 18'} + '@octokit/auth-oauth-device@8.0.3': + resolution: {integrity: sha512-zh2W0mKKMh/VWZhSqlaCzY7qFyrgd9oTWmTmHaXnHNeQRCZr/CXy2jCgHo4e4dJVTiuxP5dLa0YM5p5QVhJHbw==} + engines: {node: '>= 20'} - '@octokit/graphql@8.2.2': - resolution: {integrity: sha512-Yi8hcoqsrXGdt0yObxbebHXFOiUA+2v3n53epuOg1QUgOB6c4XzvisBNVXJSl8RYA5KrDuSL2yq9Qmqe5N0ryA==} - engines: {node: '>= 18'} + '@octokit/auth-oauth-user@6.0.2': + resolution: {integrity: sha512-qLoPPc6E6GJoz3XeDG/pnDhJpTkODTGG4kY0/Py154i/I003O9NazkrwJwRuzgCalhzyIeWQ+6MDvkUmKXjg/A==} + engines: {node: '>= 20'} - '@octokit/openapi-types@24.2.0': - resolution: {integrity: sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==} + '@octokit/auth-token@6.0.0': + resolution: {integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==} + engines: {node: '>= 20'} - '@octokit/openapi-types@25.0.0': - resolution: {integrity: sha512-FZvktFu7HfOIJf2BScLKIEYjDsw6RKc7rBJCdvCTfKsVnx2GEB/Nbzjr29DUdb7vQhlzS/j8qDzdditP0OC6aw==} + '@octokit/core@7.0.6': + resolution: {integrity: sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==} + engines: {node: '>= 20'} - '@octokit/plugin-paginate-rest@11.6.0': - resolution: {integrity: sha512-n5KPteiF7pWKgBIBJSk8qzoZWcUkza2O6A0za97pMGVrGfPdltxrfmfF5GucHYvHGZD8BdaZmmHGz5cX/3gdpw==} - engines: {node: '>= 18'} + '@octokit/endpoint@11.0.2': + resolution: {integrity: sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ==} + engines: {node: '>= 20'} + + '@octokit/graphql-schema@15.26.1': + resolution: {integrity: sha512-RFDC2MpRBd4AxSRvUeBIVeBU7ojN/SxDfALUd7iVYOSeEK3gZaqR2MGOysj4Zh2xj2RY5fQAUT+Oqq7hWTraMA==} + + '@octokit/graphql@9.0.3': + resolution: {integrity: sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==} + engines: {node: '>= 20'} + + '@octokit/oauth-authorization-url@8.0.0': + resolution: {integrity: sha512-7QoLPRh/ssEA/HuHBHdVdSgF8xNLz/Bc5m9fZkArJE5bb6NmVkDm3anKxXPmN1zh6b5WKZPRr3697xKT/yM3qQ==} + engines: {node: '>= 20'} + + '@octokit/oauth-methods@6.0.2': + resolution: {integrity: sha512-HiNOO3MqLxlt5Da5bZbLV8Zarnphi4y9XehrbaFMkcoJ+FL7sMxH/UlUsCVxpddVu4qvNDrBdaTVE2o4ITK8ng==} + engines: {node: '>= 20'} + + '@octokit/openapi-types@27.0.0': + resolution: {integrity: sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==} + + '@octokit/plugin-paginate-rest@14.0.0': + resolution: {integrity: sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==} + engines: {node: '>= 20'} peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-request-log@5.3.1': - resolution: {integrity: sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==} - engines: {node: '>= 18'} + '@octokit/plugin-request-log@6.0.0': + resolution: {integrity: sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==} + engines: {node: '>= 20'} peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-rest-endpoint-methods@13.5.0': - resolution: {integrity: sha512-9Pas60Iv9ejO3WlAX3maE1+38c5nqbJXV5GrncEfkndIpZrJ/WPMRd2xYDcPPEt5yzpxcjw9fWNoPhsSGzqKqw==} - engines: {node: '>= 18'} + '@octokit/plugin-rest-endpoint-methods@17.0.0': + resolution: {integrity: sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==} + engines: {node: '>= 20'} peerDependencies: '@octokit/core': '>=6' - '@octokit/request-error@6.1.8': - resolution: {integrity: sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==} - engines: {node: '>= 18'} + '@octokit/request-error@7.1.0': + resolution: {integrity: sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==} + engines: {node: '>= 20'} - '@octokit/request@9.2.3': - resolution: {integrity: sha512-Ma+pZU8PXLOEYzsWf0cn/gY+ME57Wq8f49WTXA8FMHp2Ps9djKw//xYJ1je8Hm0pR2lU9FUGeJRWOtxq6olt4w==} - engines: {node: '>= 18'} + '@octokit/request@10.0.7': + resolution: {integrity: sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA==} + engines: {node: '>= 20'} - '@octokit/rest@21.1.1': - resolution: {integrity: sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==} - engines: {node: '>= 18'} + '@octokit/rest@22.0.1': + resolution: {integrity: sha512-Jzbhzl3CEexhnivb1iQ0KJ7s5vvjMWcmRtq5aUsKmKDrRW6z3r84ngmiFKFvpZjpiU/9/S6ITPFRpn5s/3uQJw==} + engines: {node: '>= 20'} - '@octokit/types@13.10.0': - resolution: {integrity: sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==} + '@octokit/types@16.0.0': + resolution: {integrity: sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==} - '@octokit/types@14.0.0': - resolution: {integrity: sha512-VVmZP0lEhbo2O1pdq63gZFiGCKkm8PPp8AUOijlwPO6hojEVjspA0MWKP7E4hbvGxzFKNqKr6p0IYtOH/Wf/zA==} + '@open-draft/deferred-promise@2.2.0': + resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + + '@open-draft/logger@0.3.0': + resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + + '@open-draft/until@2.1.0': + resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} '@opentelemetry/api@1.9.0': resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==} engines: {node: '>=8.0.0'} - '@opentelemetry/context-async-hooks@1.30.1': - resolution: {integrity: sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==} - engines: {node: '>=14'} + '@opentelemetry/context-async-hooks@2.2.0': + resolution: {integrity: sha512-qRkLWiUEZNAmYapZ7KGS5C4OmBLcP/H2foXeOEaowYCR0wi89fHejrfYfbuLVCMLp/dWZXKvQusdbUEZjERfwQ==} + engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' - '@opentelemetry/core@1.30.1': - resolution: {integrity: sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==} - engines: {node: '>=14'} + '@opentelemetry/core@2.2.0': + resolution: {integrity: sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==} + engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' - '@opentelemetry/semantic-conventions@1.28.0': - resolution: {integrity: sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==} + '@opentelemetry/semantic-conventions@1.38.0': + resolution: {integrity: sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==} engines: {node: '>=14'} - '@opentelemetry/semantic-conventions@1.32.0': - resolution: {integrity: sha512-s0OpmpQFSfMrmedAn9Lhg4KWJELHCU6uU9dtIJ28N8UGhf9Y55im5X8fEzwhwDwiSqN+ZPSNrDJF7ivf/AuRPQ==} - engines: {node: '>=14'} + '@oxc-project/types@0.102.0': + resolution: {integrity: sha512-8Skrw405g+/UJPKWJ1twIk3BIH2nXdiVlVNtYT23AXVwpsd79es4K+KYt06Fbnkc5BaTvk/COT2JuCLYdwnCdA==} '@parcel/watcher-android-arm64@2.5.1': resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==} @@ -2347,36 +2911,42 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.1': resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.1': resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.1': resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.1': resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.1': resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [musl] '@parcel/watcher-win32-arm64@2.5.1': resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==} @@ -2400,10 +2970,33 @@ packages: resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} engines: {node: '>= 10.0.0'} + '@pinojs/redact@0.4.0': + resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@pnpm/crypto.hash@1000.2.1': + resolution: {integrity: sha512-Kgo3bgYbdKkC5xFvvQshbHa+Nru7k50D91+yyq7enp4Ur2EMp4wg5oXleaC5xu5hC9A/1eSCRI8npCioplxG4A==} + engines: {node: '>=18.12'} + + '@pnpm/crypto.polyfill@1000.1.0': + resolution: {integrity: sha512-tNe7a6U4rCpxLMBaR0SIYTdjxGdL0Vwb3G1zY8++sPtHSvy7qd54u8CIB0Z+Y6t5tc9pNYMYCMwhE/wdSY7ltg==} + engines: {node: '>=18.12'} + + '@pnpm/dependency-path@1001.1.8': + resolution: {integrity: sha512-+/SabdOsq4ycO/s1F82mUTmYb9KTE7e74qbXE9caM6slbaJesVqQOKDxSP4RqCy5jkjDz26kpkWzxeNJLowdNQ==} + engines: {node: '>=18.12'} + + '@pnpm/graceful-fs@1000.0.1': + resolution: {integrity: sha512-JnzaAVFJIEgwTcB55eww8N3h5B6qJdZqDA2wYkSK+OcTvvMSQb9c2STMhBP6GfkWygG1fs3w8D7JRx9SPZnxJg==} + engines: {node: '>=18.12'} + + '@pnpm/types@1001.2.0': + resolution: {integrity: sha512-UIju+OadUVS0q5q/MbRAzMS5M9HZcZyT6evyrgPUH0DV9przkcW7/LH1Sj33Q2MpJO9Nzqw4b4w72x8mvtUAew==} + engines: {node: '>=18.12'} + '@protobufjs/aspromise@1.1.2': resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -2434,22 +3027,106 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@puppeteer/browsers@2.10.3': - resolution: {integrity: sha512-iPpnFpX25gKIVsHsqVjHV+/GzW36xPgsscWkCnrrETndcdxNsXLdCrTwhkCJNR/FGWr122dJUBeyV4niz/j3TA==} + '@puppeteer/browsers@2.11.0': + resolution: {integrity: sha512-n6oQX6mYkG8TRPuPXmbPidkUbsSRalhmaaVAQxvH1IkQy63cwsH+kOjB3e4cpCDHg0aSvsiX9bQ4s2VB6mGWUQ==} engines: {node: '>=18'} hasBin: true - '@rollup/plugin-alias@5.1.1': - resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} + '@rolldown/binding-android-arm64@1.0.0-beta.54': + resolution: {integrity: sha512-zZRx/ur3Fai3fxiEmVp48+6GCBR48PRWJR1X3TTMn9yiq2bBHlYPgBaQtDOYWXv5H3J5dXujeTyGnuoY+kdGCg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-beta.54': + resolution: {integrity: sha512-zMyFEJmbIs91x22HAA/eUvmZHgjX8tGsD3TJ+WC9aY4bCdl3w84H9vMZmChSHAF1dYvGNH4KQDI2IubeZaCYtg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.54': + resolution: {integrity: sha512-Ex7QttdaVnEpmE/zroUT5Qm10e2+Vjd9q0LX9eXm59SitxDODMpC8GI1Rct5RrLf4GLU4DzdXBj6DGzuR+6g6w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.54': + resolution: {integrity: sha512-E1XO10ryM/Vxw3Q1wvs9s2mSpVBfbHtzkbJcdu26qh17ZmVwNWLiIoqEcbkXm028YwkReG4Gd2gCZ3NxgTQ28Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.54': + resolution: {integrity: sha512-oS73Uks8jczQR9pg0Bj718vap/x71exyJ5yuxu4X5V4MhwRQnky7ANSPm6ARUfraxOqt49IBfcMeGnw2rTSqdA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.54': + resolution: {integrity: sha512-pY8N2X5C+/ZQcy0eRdfOzOP//OFngP1TaIqDjFwfBPws2UNavKS8SpxhPEgUaYIaT0keVBd/TB+eVy9z+CIOtw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.54': + resolution: {integrity: sha512-cgTooAFm2MUmFriB7IYaWBNyqrGlRPKG+yaK2rGFl2rcdOcO24urY4p3eyB0ogqsRLvJbIxwjjYiWiIP7Eo1Cw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.54': + resolution: {integrity: sha512-nGyLT1Qau0W+kEL44V2jhHmvfS3wyJW08E4WEu2E6NuIy+uChKN1X0aoxzFIDi2owDsYaZYez/98/f268EupIQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.54': + resolution: {integrity: sha512-KH374P0TUjDXssROT/orvzaWrzGOptD13PTrltgKwbDprJTMknoLiYsOD6Ttz92O2VuAcCtFuJ1xbyFM2Uo/Xg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.54': + resolution: {integrity: sha512-oMAVO4wbfAbhpBxPsSp8R7ntL2DchpNfO+tGhN8/sI9jsbYwOv78uIW1fTwOBslhjTVFltGJ+l23mubNQcYNaQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.54': + resolution: {integrity: sha512-MYY/FmY+HehHiQkNx04W5oLy/Fqd1hXYqZmmorSDXvAHnxMbSgmdFicKsSYOg/sVGHBMEP1tTn6kV5sWrS45rA==} engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.54': + resolution: {integrity: sha512-66o3uKxUmcYskT9exskxs3OVduXf5x0ndlMkYOjSpBgqzhLtkub136yDvZkNT1OkNDET0odSwcU7aWdpnwzAyg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.54': + resolution: {integrity: sha512-FbbbrboChLBXfeEsOfaypBGqzbdJ/CcSA2BPLCggojnIHy58Jo+AXV7HATY8opZk7194rRbokIT8AfPJtZAWtg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-beta.54': + resolution: {integrity: sha512-AHgcZ+w7RIRZ65ihSQL8YuoKcpD9Scew4sEeP1BBUT9QdTo6KjwHrZZXjID6nL10fhKessCH6OPany2QKwAwTQ==} + + '@rollup/plugin-alias@6.0.0': + resolution: {integrity: sha512-tPCzJOtS7uuVZd+xPhoy5W4vThe6KWXNmsFCNktaAh5RTqcLiSfT4huPQIXkgJ6YCOjJHvecOAzQxLFhPxKr+g==} + engines: {node: '>=20.19.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + rollup: '>=4.0.0' peerDependenciesMeta: rollup: optional: true - '@rollup/plugin-commonjs@28.0.3': - resolution: {integrity: sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==} + '@rollup/plugin-commonjs@29.0.0': + resolution: {integrity: sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==} engines: {node: '>=16.0.0 || 14 >= 14.17'} peerDependencies: rollup: ^2.68.0||^3.0.0||^4.0.0 @@ -2475,8 +3152,8 @@ packages: rollup: optional: true - '@rollup/plugin-node-resolve@16.0.1': - resolution: {integrity: sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==} + '@rollup/plugin-node-resolve@16.0.3': + resolution: {integrity: sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 @@ -2484,8 +3161,17 @@ packages: rollup: optional: true - '@rollup/pluginutils@5.1.4': - resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} + '@rollup/pluginutils@5.2.0': + resolution: {integrity: sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/pluginutils@5.3.0': + resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -2493,147 +3179,179 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.40.2': - resolution: {integrity: sha512-JkdNEq+DFxZfUwxvB58tHMHBHVgX23ew41g1OQinthJ+ryhdRk67O31S7sYw8u2lTjHUPFxwar07BBt1KHp/hg==} + '@rollup/rollup-android-arm-eabi@4.53.5': + resolution: {integrity: sha512-iDGS/h7D8t7tvZ1t6+WPK04KD0MwzLZrG0se1hzBjSi5fyxlsiggoJHwh18PCFNn7tG43OWb6pdZ6Y+rMlmyNQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.40.2': - resolution: {integrity: sha512-13unNoZ8NzUmnndhPTkWPWbX3vtHodYmy+I9kuLxN+F+l+x3LdVF7UCu8TWVMt1POHLh6oDHhnOA04n8oJZhBw==} + '@rollup/rollup-android-arm64@4.53.5': + resolution: {integrity: sha512-wrSAViWvZHBMMlWk6EJhvg8/rjxzyEhEdgfMMjREHEq11EtJ6IP6yfcCH57YAEca2Oe3FNCE9DSTgU70EIGmVw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.40.2': - resolution: {integrity: sha512-Gzf1Hn2Aoe8VZzevHostPX23U7N5+4D36WJNHK88NZHCJr7aVMG4fadqkIf72eqVPGjGc0HJHNuUaUcxiR+N/w==} + '@rollup/rollup-darwin-arm64@4.53.5': + resolution: {integrity: sha512-S87zZPBmRO6u1YXQLwpveZm4JfPpAa6oHBX7/ghSiGH3rz/KDgAu1rKdGutV+WUI6tKDMbaBJomhnT30Y2t4VQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.40.2': - resolution: {integrity: sha512-47N4hxa01a4x6XnJoskMKTS8XZ0CZMd8YTbINbi+w03A2w4j1RTlnGHOz/P0+Bg1LaVL6ufZyNprSg+fW5nYQQ==} + '@rollup/rollup-darwin-x64@4.53.5': + resolution: {integrity: sha512-YTbnsAaHo6VrAczISxgpTva8EkfQus0VPEVJCEaboHtZRIb6h6j0BNxRBOwnDciFTZLDPW5r+ZBmhL/+YpTZgA==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.40.2': - resolution: {integrity: sha512-8t6aL4MD+rXSHHZUR1z19+9OFJ2rl1wGKvckN47XFRVO+QL/dUSpKA2SLRo4vMg7ELA8pzGpC+W9OEd1Z/ZqoQ==} + '@rollup/rollup-freebsd-arm64@4.53.5': + resolution: {integrity: sha512-1T8eY2J8rKJWzaznV7zedfdhD1BqVs1iqILhmHDq/bqCUZsrMt+j8VCTHhP0vdfbHK3e1IQ7VYx3jlKqwlf+vw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.40.2': - resolution: {integrity: sha512-C+AyHBzfpsOEYRFjztcYUFsH4S7UsE9cDtHCtma5BK8+ydOZYgMmWg1d/4KBytQspJCld8ZIujFMAdKG1xyr4Q==} + '@rollup/rollup-freebsd-x64@4.53.5': + resolution: {integrity: sha512-sHTiuXyBJApxRn+VFMaw1U+Qsz4kcNlxQ742snICYPrY+DDL8/ZbaC4DVIB7vgZmp3jiDaKA0WpBdP0aqPJoBQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.40.2': - resolution: {integrity: sha512-de6TFZYIvJwRNjmW3+gaXiZ2DaWL5D5yGmSYzkdzjBDS3W+B9JQ48oZEsmMvemqjtAFzE16DIBLqd6IQQRuG9Q==} + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': + resolution: {integrity: sha512-dV3T9MyAf0w8zPVLVBptVlzaXxka6xg1f16VAQmjg+4KMSTWDvhimI/Y6mp8oHwNrmnmVl9XxJ/w/mO4uIQONA==} cpu: [arm] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.40.2': - resolution: {integrity: sha512-urjaEZubdIkacKc930hUDOfQPysezKla/O9qV+O89enqsqUmQm8Xj8O/vh0gHg4LYfv7Y7UsE3QjzLQzDYN1qg==} + '@rollup/rollup-linux-arm-musleabihf@4.53.5': + resolution: {integrity: sha512-wIGYC1x/hyjP+KAu9+ewDI+fi5XSNiUi9Bvg6KGAh2TsNMA3tSEs+Sh6jJ/r4BV/bx/CyWu2ue9kDnIdRyafcQ==} cpu: [arm] os: [linux] + libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.40.2': - resolution: {integrity: sha512-KlE8IC0HFOC33taNt1zR8qNlBYHj31qGT1UqWqtvR/+NuCVhfufAq9fxO8BMFC22Wu0rxOwGVWxtCMvZVLmhQg==} + '@rollup/rollup-linux-arm64-gnu@4.53.5': + resolution: {integrity: sha512-Y+qVA0D9d0y2FRNiG9oM3Hut/DgODZbU9I8pLLPwAsU0tUKZ49cyV1tzmB/qRbSzGvY8lpgGkJuMyuhH7Ma+Vg==} cpu: [arm64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.40.2': - resolution: {integrity: sha512-j8CgxvfM0kbnhu4XgjnCWJQyyBOeBI1Zq91Z850aUddUmPeQvuAy6OiMdPS46gNFgy8gN1xkYyLgwLYZG3rBOg==} + '@rollup/rollup-linux-arm64-musl@4.53.5': + resolution: {integrity: sha512-juaC4bEgJsyFVfqhtGLz8mbopaWD+WeSOYr5E16y+1of6KQjc0BpwZLuxkClqY1i8sco+MdyoXPNiCkQou09+g==} cpu: [arm64] os: [linux] + libc: [musl] - '@rollup/rollup-linux-loongarch64-gnu@4.40.2': - resolution: {integrity: sha512-Ybc/1qUampKuRF4tQXc7G7QY9YRyeVSykfK36Y5Qc5dmrIxwFhrOzqaVTNoZygqZ1ZieSWTibfFhQ5qK8jpWxw==} + '@rollup/rollup-linux-loong64-gnu@4.53.5': + resolution: {integrity: sha512-rIEC0hZ17A42iXtHX+EPJVL/CakHo+tT7W0pbzdAGuWOt2jxDFh7A/lRhsNHBcqL4T36+UiAgwO8pbmn3dE8wA==} cpu: [loong64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-powerpc64le-gnu@4.40.2': - resolution: {integrity: sha512-3FCIrnrt03CCsZqSYAOW/k9n625pjpuMzVfeI+ZBUSDT3MVIFDSPfSUgIl9FqUftxcUXInvFah79hE1c9abD+Q==} + '@rollup/rollup-linux-ppc64-gnu@4.53.5': + resolution: {integrity: sha512-T7l409NhUE552RcAOcmJHj3xyZ2h7vMWzcwQI0hvn5tqHh3oSoclf9WgTl+0QqffWFG8MEVZZP1/OBglKZx52Q==} cpu: [ppc64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.40.2': - resolution: {integrity: sha512-QNU7BFHEvHMp2ESSY3SozIkBPaPBDTsfVNGx3Xhv+TdvWXFGOSH2NJvhD1zKAT6AyuuErJgbdvaJhYVhVqrWTg==} + '@rollup/rollup-linux-riscv64-gnu@4.53.5': + resolution: {integrity: sha512-7OK5/GhxbnrMcxIFoYfhV/TkknarkYC1hqUw1wU2xUN3TVRLNT5FmBv4KkheSG2xZ6IEbRAhTooTV2+R5Tk0lQ==} cpu: [riscv64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.40.2': - resolution: {integrity: sha512-5W6vNYkhgfh7URiXTO1E9a0cy4fSgfE4+Hl5agb/U1sa0kjOLMLC1wObxwKxecE17j0URxuTrYZZME4/VH57Hg==} + '@rollup/rollup-linux-riscv64-musl@4.53.5': + resolution: {integrity: sha512-GwuDBE/PsXaTa76lO5eLJTyr2k8QkPipAyOrs4V/KJufHCZBJ495VCGJol35grx9xryk4V+2zd3Ri+3v7NPh+w==} cpu: [riscv64] os: [linux] + libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.40.2': - resolution: {integrity: sha512-B7LKIz+0+p348JoAL4X/YxGx9zOx3sR+o6Hj15Y3aaApNfAshK8+mWZEf759DXfRLeL2vg5LYJBB7DdcleYCoQ==} + '@rollup/rollup-linux-s390x-gnu@4.53.5': + resolution: {integrity: sha512-IAE1Ziyr1qNfnmiQLHBURAD+eh/zH1pIeJjeShleII7Vj8kyEm2PF77o+lf3WTHDpNJcu4IXJxNO0Zluro8bOw==} cpu: [s390x] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.40.2': - resolution: {integrity: sha512-lG7Xa+BmBNwpjmVUbmyKxdQJ3Q6whHjMjzQplOs5Z+Gj7mxPtWakGHqzMqNER68G67kmCX9qX57aRsW5V0VOng==} + '@rollup/rollup-linux-x64-gnu@4.53.5': + resolution: {integrity: sha512-Pg6E+oP7GvZ4XwgRJBuSXZjcqpIW3yCBhK4BcsANvb47qMvAbCjR6E+1a/U2WXz1JJxp9/4Dno3/iSJLcm5auw==} cpu: [x64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.40.2': - resolution: {integrity: sha512-tD46wKHd+KJvsmije4bUskNuvWKFcTOIM9tZ/RrmIvcXnbi0YK/cKS9FzFtAm7Oxi2EhV5N2OpfFB348vSQRXA==} + '@rollup/rollup-linux-x64-musl@4.53.5': + resolution: {integrity: sha512-txGtluxDKTxaMDzUduGP0wdfng24y1rygUMnmlUJ88fzCCULCLn7oE5kb2+tRB+MWq1QDZT6ObT5RrR8HFRKqg==} cpu: [x64] os: [linux] + libc: [musl] + + '@rollup/rollup-openharmony-arm64@4.53.5': + resolution: {integrity: sha512-3DFiLPnTxiOQV993fMc+KO8zXHTcIjgaInrqlG8zDp1TlhYl6WgrOHuJkJQ6M8zHEcntSJsUp1XFZSY8C1DYbg==} + cpu: [arm64] + os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.40.2': - resolution: {integrity: sha512-Bjv/HG8RRWLNkXwQQemdsWw4Mg+IJ29LK+bJPW2SCzPKOUaMmPEppQlu/Fqk1d7+DX3V7JbFdbkh/NMmurT6Pg==} + '@rollup/rollup-win32-arm64-msvc@4.53.5': + resolution: {integrity: sha512-nggc/wPpNTgjGg75hu+Q/3i32R00Lq1B6N1DO7MCU340MRKL3WZJMjA9U4K4gzy3dkZPXm9E1Nc81FItBVGRlA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.40.2': - resolution: {integrity: sha512-dt1llVSGEsGKvzeIO76HToiYPNPYPkmjhMHhP00T9S4rDern8P2ZWvWAQUEJ+R1UdMWJ/42i/QqJ2WV765GZcA==} + '@rollup/rollup-win32-ia32-msvc@4.53.5': + resolution: {integrity: sha512-U/54pTbdQpPLBdEzCT6NBCFAfSZMvmjr0twhnD9f4EIvlm9wy3jjQ38yQj1AGznrNO65EWQMgm/QUjuIVrYF9w==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.40.2': - resolution: {integrity: sha512-bwspbWB04XJpeElvsp+DCylKfF4trJDa2Y9Go8O6A7YLX2LIKGcNK/CYImJN6ZP4DcuOHB4Utl3iCbnR62DudA==} + '@rollup/rollup-win32-x64-gnu@4.53.5': + resolution: {integrity: sha512-2NqKgZSuLH9SXBBV2dWNRCZmocgSOx8OJSdpRaEcRlIfX8YrKxUT6z0F1NpvDVhOsl190UFTRh2F2WDWWCYp3A==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.53.5': + resolution: {integrity: sha512-JRpZUhCfhZ4keB5v0fe02gQJy05GqboPOaxvjugW04RLSYYoB/9t2lx2u/tMs/Na/1NXfY8QYjgRljRpN+MjTQ==} cpu: [x64] os: [win32] - '@rollup/wasm-node@4.40.2': - resolution: {integrity: sha512-rl60ew3oh38IrtETrAf0A0qTByOsHSi7Sx1BZH4+vrIzL/DqxFx+FgTUFVViL3ZQqs95gIOm9mZQ1fUOopnkmA==} + '@rollup/wasm-node@4.54.0': + resolution: {integrity: sha512-CeEdHzNY+ZIR6NWpIOiJuCrr6tTK7cRGeOf6GYg5f73+UwJLqn5a4d5Ovf/hOWDyHM1KcySbxHQESJ9krhe0+A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} - '@sigstore/bundle@3.1.0': - resolution: {integrity: sha512-Mm1E3/CmDDCz3nDhFKTuYdB47EdRFRQMOE/EAbiG1MJW77/w1b3P7Qx7JSrVJs8PfwOLOVcKQCHErIwCTyPbag==} - engines: {node: ^18.17.0 || >=20.5.0} + '@sigstore/bundle@4.0.0': + resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/core@2.0.0': - resolution: {integrity: sha512-nYxaSb/MtlSI+JWcwTHQxyNmWeWrUXJJ/G4liLrGG7+tS4vAz6LF3xRXqLH6wPIVUoZQel2Fs4ddLx4NCpiIYg==} - engines: {node: ^18.17.0 || >=20.5.0} + '@sigstore/core@3.1.0': + resolution: {integrity: sha512-o5cw1QYhNQ9IroioJxpzexmPjfCe7gzafd2RY3qnMpxr4ZEja+Jad/U8sgFpaue6bOaF+z7RVkyKVV44FN+N8A==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/protobuf-specs@0.4.1': - resolution: {integrity: sha512-7MJXQhIm7dWF9zo7rRtMYh8d2gSnc3+JddeQOTIg6gUN7FjcuckZ9EwGq+ReeQtbbl3Tbf5YqRrWxA1DMfIn+w==} + '@sigstore/protobuf-specs@0.5.0': + resolution: {integrity: sha512-MM8XIwUjN2bwvCg1QvrMtbBmpcSHrkhFSCu1D11NyPvDQ25HEc4oG5/OcQfd/Tlf/OxmKWERDj0zGE23jQaMwA==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/sign@3.1.0': - resolution: {integrity: sha512-knzjmaOHOov1Ur7N/z4B1oPqZ0QX5geUfhrVaqVlu+hl0EAoL4o+l0MSULINcD5GCWe3Z0+YJO8ues6vFlW0Yw==} - engines: {node: ^18.17.0 || >=20.5.0} + '@sigstore/sign@4.1.0': + resolution: {integrity: sha512-Vx1RmLxLGnSUqx/o5/VsCjkuN5L7y+vxEEwawvc7u+6WtX2W4GNa7b9HEjmcRWohw/d6BpATXmvOwc78m+Swdg==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/tuf@3.1.1': - resolution: {integrity: sha512-eFFvlcBIoGwVkkwmTi/vEQFSva3xs5Ot3WmBcjgjVdiaoelBLQaQ/ZBfhlG0MnG0cmTYScPpk7eDdGDWUcFUmg==} - engines: {node: ^18.17.0 || >=20.5.0} + '@sigstore/tuf@4.0.1': + resolution: {integrity: sha512-OPZBg8y5Vc9yZjmWCHrlWPMBqW5yd8+wFNl+thMdtcWz3vjVSoJQutF8YkrzI0SLGnkuFof4HSsWUhXrf219Lw==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/verify@2.1.1': - resolution: {integrity: sha512-hVJD77oT67aowHxwT4+M6PGOp+E2LtLdTK3+FC0lBO9T7sYwItDMXZ7Z07IDCvR1M717a4axbIWckrW67KMP/w==} - engines: {node: ^18.17.0 || >=20.5.0} + '@sigstore/verify@3.1.0': + resolution: {integrity: sha512-mNe0Iigql08YupSOGv197YdHpPPr+EzDZmfCgMc7RPNaZTw5aLN01nBl6CHJOh3BGtnMIj83EeN4butBchc8Ag==} + engines: {node: ^20.17.0 || >=22.9.0} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} '@socket.io/component-emitter@3.1.2': resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==} - '@stylistic/eslint-plugin@4.2.0': - resolution: {integrity: sha512-8hXezgz7jexGHdo5WN6JBEIPHCSFyyU4vgbxevu4YLVS5vl+sxqAAGyXSzfNDyR6xMNSH5H1x67nsXcYMOHtZA==} + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@stylistic/eslint-plugin@5.6.1': + resolution: {integrity: sha512-JCs+MqoXfXrRPGbGmho/zGS/jMcn3ieKl/A8YImqib76C8kjgZwq5uUFzc30lJkMvcchuRn6/v8IApLxli3Jyw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=9.0.0' + '@szmarczak/http-timer@4.0.6': + resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} + engines: {node: '>=10'} + '@tootallnate/once@2.0.0': resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} @@ -2641,8 +3359,8 @@ packages: '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} - '@tsconfig/node10@1.0.11': - resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + '@tsconfig/node10@1.0.12': + resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} '@tsconfig/node12@1.0.11': resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} @@ -2657,9 +3375,12 @@ packages: resolution: {integrity: sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==} engines: {node: ^16.14.0 || >=18.0.0} - '@tufjs/models@3.0.1': - resolution: {integrity: sha512-UUYHISyhCU3ZgN8yaear3cGATHb3SMuKHsQ/nVbHXcmnBf+LzQ/cQfhNG+rfaSHgqGKNEm2cOCLVLELStUQ1JA==} - engines: {node: ^18.17.0 || >=20.5.0} + '@tufjs/models@4.1.0': + resolution: {integrity: sha512-Y8cK9aggNRsqJVaKUlEYs4s7CvQ1b1ta2DVPyAimb0I2qhzjNk+A+mxvll/klL0RlfuIUei8BF7YWiua4kQqww==} + engines: {node: ^20.17.0 || >=22.9.0} + + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} '@types/accepts@1.3.7': resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} @@ -2676,23 +3397,26 @@ packages: '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - '@types/babel__traverse@7.20.7': - resolution: {integrity: sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==} + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} '@types/big.js@6.2.2': resolution: {integrity: sha512-e2cOW9YlVzFY2iScnGBBkplKsrn2CsObHQ2Hiw4V1sSyiGbgWL8IyqE3zFi1Pt5o1pdAtYkDAIsF3KKUPjdzaA==} - '@types/body-parser@1.19.5': - resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} + '@types/body-parser@1.19.6': + resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==} '@types/bonjour@3.5.13': resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} - '@types/browser-sync@2.29.0': - resolution: {integrity: sha512-d2V8FDX/LbDCSm343N2VChzDxvll0h76I8oSigYpdLgPDmcdcR6fywTggKBkUiDM3qAbHOq7NZvepj/HJM5e2g==} + '@types/browser-sync@2.29.1': + resolution: {integrity: sha512-jAMsEkLpNURfpS4XIN9BX7SY+uCoTkPjLIovwssV/3e/FPwg9hYusbCXmGNfC3T6W/6d3iP3clxy9cvevjFKtQ==} - '@types/caseless@0.12.5': - resolution: {integrity: sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/cli-progress@3.11.6': + resolution: {integrity: sha512-cE3+jb9WRlu+uOSAugewNpITJDt1VF8dHOopPO4IABFc3SXYL5WE/+PTz/FCdZRRfIujiWW3n3aMbv1eIGVRWA==} '@types/co-body@6.1.3': resolution: {integrity: sha512-UhuhrQ5hclX6UJctv5m4Rfp52AfG9o9+d9/HwjxhVB5NjXxr5t9oKgJxN8xRHgr35oo8meUEHUPFWiKg6y71aA==} @@ -2706,23 +3430,29 @@ packages: '@types/connect@3.4.38': resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} - '@types/content-disposition@0.5.8': - resolution: {integrity: sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==} + '@types/content-disposition@0.5.9': + resolution: {integrity: sha512-8uYXI3Gw35MhiVYhG3s295oihrxRyytcRHjSjqnqZVDDy/xcGBRny7+Xj1Wgfhv5QzRtN2hB2dVRBUX9XW3UcQ==} '@types/convert-source-map@2.0.3': resolution: {integrity: sha512-ag0BfJLZf6CQz8VIuRIEYQ5Ggwk/82uvTQf27RcpyDNbY0Vw49LIPqAxk5tqYfrCs9xDaIMvl4aj7ZopnYL8bA==} - '@types/cookies@0.9.0': - resolution: {integrity: sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==} + '@types/cookies@0.9.2': + resolution: {integrity: sha512-1AvkDdZM2dbyFybL4fxpuNCaWyv//0AwsuUk2DWeXyM1/5ZKm6W3z6mQi24RZ4l2ucY+bkSHzbDVpySqPGuV8A==} - '@types/cors@2.8.17': - resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} + '@types/cors@2.8.19': + resolution: {integrity: sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==} '@types/debounce@1.2.4': resolution: {integrity: sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==} - '@types/duplexify@3.6.4': - resolution: {integrity: sha512-2eahVPsd+dy3CL6FugAzJcxoraWhUghZGEQJns1kTKfCXWKJ5iG/VkaB05wRVrDKHfOFKqb0X0kXh91eE99RZg==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/duplexify@3.6.5': + resolution: {integrity: sha512-fB56ACzlW91UdZ5F3VXplVMDngO8QaX5Y2mjvADtN01TT2TMy4WjF0Lg+tFDvt4uMBeTe4SgaD+qCrA7dL5/tA==} + + '@types/ejs@3.1.5': + resolution: {integrity: sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==} '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} @@ -2730,23 +3460,29 @@ packages: '@types/eslint@9.6.1': resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} - '@types/estree@1.0.7': - resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==} + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/events@3.0.3': + resolution: {integrity: sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==} - '@types/express-serve-static-core@4.19.6': - resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} + '@types/express-serve-static-core@4.19.7': + resolution: {integrity: sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg==} - '@types/express-serve-static-core@5.0.6': - resolution: {integrity: sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==} + '@types/express-serve-static-core@5.1.0': + resolution: {integrity: sha512-jnHMsrd0Mwa9Cf4IdOzbz543y4XJepXrbia2T4b6+spXC2We3t1y6K44D3mR8XMFSXMCf3/l7rCgddfx7UNVBA==} - '@types/express@4.17.21': - resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} + '@types/express@4.17.25': + resolution: {integrity: sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==} - '@types/express@5.0.1': - resolution: {integrity: sha512-UZUw8vjpWFXuDnjFTh7/5c2TWDlQqeXHi6hcN7F2XSVT5P+WmUnnbFS3KA6Jnc6IsEqI2qCVu2bK0R0J4A8ZQQ==} + '@types/express@5.0.6': + resolution: {integrity: sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==} - '@types/glob@7.2.0': - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + '@types/folder-hash@4.0.4': + resolution: {integrity: sha512-c+PwHm51Dw3fXM8SDK+93PO3oXdk4XNouCCvV67lj4aijRkZz5g67myk+9wqWWnyv3go6q96hT6ywcd3XtoZiQ==} + + '@types/git-raw-commits@5.0.1': + resolution: {integrity: sha512-sd4kgxJbuZF0RDy6cX7KlKSGiwqB1mqn8nriUbxt5e1F+MO/N4hJlhaYn0Omw4g2biClFpT5Mre07x7OkGt8tg==} '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} @@ -2754,11 +3490,11 @@ packages: '@types/http-assert@1.5.6': resolution: {integrity: sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==} - '@types/http-errors@2.0.4': - resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + '@types/http-errors@2.0.5': + resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==} - '@types/http-proxy@1.17.16': - resolution: {integrity: sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==} + '@types/http-proxy@1.17.17': + resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} '@types/ini@4.1.1': resolution: {integrity: sha512-MIyNUZipBTbyUNnhvuXJTY7B6qNI78meck9Jbv3wk0OgNwRyOOVEKDutAkOs1snB/tx0FafyR6/SN4Ps0hZPeg==} @@ -2775,8 +3511,8 @@ packages: '@types/jasmine-reporters@2.5.3': resolution: {integrity: sha512-8aojAUdgdiD9VQbllBJb/9gny3lOjz9T5gyMcbYlKe6npwGVsarbr8v2JYSFJSZSuFYXcPVzFG2lLX3ib0j/DA==} - '@types/jasmine@5.1.8': - resolution: {integrity: sha512-u7/CnvRdh6AaaIzYjCgUuVbREFgulhX05Qtf6ZtW+aOcjCKKVvKgpkPYJBFTZSHtFBYimzU4zP0V2vrEsq9Wcg==} + '@types/jasmine@5.1.13': + resolution: {integrity: sha512-MYCcDkruFc92LeYZux5BC0dmqo2jk+M5UIZ4/oFnAPCXN9mCcQhLyj7F3/Za7rocVyt5YRr1MmqJqFlvQ9LVcg==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -2790,8 +3526,8 @@ packages: '@types/keygrip@1.0.6': resolution: {integrity: sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==} - '@types/koa-compose@3.2.8': - resolution: {integrity: sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==} + '@types/koa-compose@3.2.9': + resolution: {integrity: sha512-BroAZ9FTvPiCy0Pi8tjD1OfJ7bgU1gQf0eR6e1Vm+JJATy9eKOG3hQMFtMciMawiSOVnLMdmUOC46s7HBhSTsA==} '@types/koa@2.15.0': resolution: {integrity: sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g==} @@ -2799,14 +3535,11 @@ packages: '@types/less@3.0.8': resolution: {integrity: sha512-Gjm4+H9noDJgu5EdT3rUw5MhPBag46fiOy27BefvWkNL8mlZnKnCaVVVTLKj6RYXed9b62CPKnPav9govyQDzA==} - '@types/loader-utils@2.0.6': - resolution: {integrity: sha512-cgu0Xefgq9O5FjFR78jgI6X31aPjDWCaJ6LCfRtlj6BtyVVWiXagysSYlPACwGKAzRwsFLjKXcj4iGfcVt6cLw==} - - '@types/lodash@4.17.16': - resolution: {integrity: sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==} + '@types/loader-utils@3.0.0': + resolution: {integrity: sha512-oOi4OGpiLUbb+Q/cN9FIkkDFgOpOGZ2cUAzb5i03wrGstnG6Syx1WDMhSiB5rcP10XX7cw7Uev8mv++/aplnNg==} - '@types/long@4.0.2': - resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + '@types/lodash@4.17.21': + resolution: {integrity: sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==} '@types/micromatch@2.3.35': resolution: {integrity: sha512-J749bHo/Zu56w0G0NI/IGHLQPiSsjx//0zJhfEVAN95K/xM5C8ZDmhkXtU3qns0sBOao7HuQzr8XV1/2o5LbXA==} @@ -2814,23 +3547,23 @@ packages: '@types/mime@1.3.5': resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} - '@types/minimatch@5.1.2': - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} + '@types/node-fetch@2.6.13': + resolution: {integrity: sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==} - '@types/node-fetch@2.6.12': - resolution: {integrity: sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==} + '@types/node-forge@1.3.14': + resolution: {integrity: sha512-mhVF2BnD4BO+jtOp7z1CdzaK4mbuK0LLQYAvdOLqHTavxFNq4zA1EmYkpnFjP8HOUzedfQkRnp0E2ulSAYSzAw==} - '@types/node-forge@1.3.11': - resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} + '@types/node@22.19.3': + resolution: {integrity: sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==} - '@types/node@20.17.44': - resolution: {integrity: sha512-50sE4Ibb4BgUMxHrcJQSAU0Fu7fLcTdwcXwRzEF7wnVMWvImFLg2Rxc7SW0vpvaJm4wvhoWEZaQiPpBpocZiUA==} + '@types/node@24.10.4': + resolution: {integrity: sha512-vnDVpYPMzs4wunl27jHrfmwojOGKya0xyM3sH+UE5iv5uPS6vX7UIoh6m+vQc5LGBq52HBKPIn/zcSZVzeDEZg==} '@types/npm-package-arg@6.1.4': resolution: {integrity: sha512-vDgdbMy2QXHnAruzlv68pUtXCjmqUk3WrBAsRboRovsOmxbfn/WiYCjmecyKjGztnMps5dWp4Uq2prp+Ilo17Q==} - '@types/npm-registry-fetch@8.0.8': - resolution: {integrity: sha512-VL/chssZawBkaQ5gFD5njblJce/ny9OICBlWAG9X6/m/ypPNJMWYiM22SY2mhLIGoknd4AyEJyi+FGyrBnsr+A==} + '@types/npm-registry-fetch@8.0.9': + resolution: {integrity: sha512-7NxvodR5Yrop3pb6+n8jhJNyzwOX0+6F+iagNEoi9u1CGxruYAwZD8pvGc9prIkL0+FdX5Xp0p80J9QPrGUp/g==} '@types/npmlog@7.0.0': resolution: {integrity: sha512-hJWbrKFvxKyWwSUXjZMYTINsSOY6IclhvGOZ97M8ac2tmR9hMwmTnYaMdpGhvju9ctWLTPhCS+eLfQNluiEjQQ==} @@ -2844,87 +3577,74 @@ packages: '@types/parse5@6.0.3': resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} - '@types/picomatch@4.0.0': - resolution: {integrity: sha512-J1Bng+wlyEERWSgJQU1Pi0HObCLVcr994xT/M+1wcl/yNRTGBupsCxthgkdYG+GCOMaQH7iSVUY3LJVBBqG7MQ==} + '@types/picomatch@4.0.2': + resolution: {integrity: sha512-qHHxQ+P9PysNEGbALT8f8YOSHW0KJu6l2xU8DYY0fu/EmGxXdVnuTLvFUvBgPJMSqXq29SYHveejeAha+4AYgA==} '@types/progress@2.0.7': resolution: {integrity: sha512-iadjw02vte8qWx7U0YM++EybBha2CQLPGu9iJ97whVgJUT5Zq9MjAPYUnbfRI2Kpehimf1QjFJYxD0t8nqzu5w==} - '@types/pumpify@1.4.4': - resolution: {integrity: sha512-+cWbQUecD04MQYkjNBhPmcUIP368aloYmqm+ImdMKA8rMpxRNAhZAD6gIj+sAVTF1DliqrT/qUp6aGNi/9U3tw==} + '@types/pumpify@1.4.5': + resolution: {integrity: sha512-BGVAQyK5yJdfIII230fVYGY47V63hUNAhryuuS3b4lEN2LNwxUXFKsEf8QLDCjmZuimlj23BHppJgcrGvNtqKg==} '@types/q@0.0.32': resolution: {integrity: sha512-qYi3YV9inU/REEfxwVcGZzbS3KG/Xs90lv0Pr+lDtuVjBPGd1A+eciXzVSaRvLify132BfcvhvEjeVahrUl0Ug==} - '@types/qs@6.9.18': - resolution: {integrity: sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==} + '@types/qs@6.14.0': + resolution: {integrity: sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==} '@types/range-parser@1.2.7': resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} - '@types/request@2.48.12': - resolution: {integrity: sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==} - '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} '@types/resolve@1.20.6': resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==} + '@types/responselike@1.0.0': + resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} + '@types/retry@0.12.2': resolution: {integrity: sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==} '@types/selenium-webdriver@3.0.26': resolution: {integrity: sha512-dyIGFKXfUFiwkMfNGn1+F6b80ZjR3uSYv1j6xVJSDlft5waZ2cwkHW4e7zNzvq7hiEackcgvBpmnXZrI1GltPg==} - '@types/semver@7.7.0': - resolution: {integrity: sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==} + '@types/semver@7.7.1': + resolution: {integrity: sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==} - '@types/send@0.17.4': - resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} + '@types/send@0.17.6': + resolution: {integrity: sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==} + + '@types/send@1.2.1': + resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==} '@types/serve-index@1.9.4': resolution: {integrity: sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==} - '@types/serve-static@1.15.7': - resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} + '@types/serve-static@1.15.10': + resolution: {integrity: sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==} - '@types/shelljs@0.8.15': - resolution: {integrity: sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q==} + '@types/serve-static@2.2.0': + resolution: {integrity: sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==} '@types/sockjs@0.3.36': resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} - '@types/source-list-map@0.1.6': - resolution: {integrity: sha512-5JcVt1u5HDmlXkwOD2nslZVllBBc7HDuOICfiZah2Z0is8M8g+ddAEawbmd3VjedfDHBzxCaXLs07QEmb7y54g==} - '@types/ssri@7.1.5': resolution: {integrity: sha512-odD/56S3B51liILSk5aXJlnYt99S6Rt9EFDDqGtJM26rKHApHcwyU/UoYHrzKkdkHMAIquGWCuHtQTbes+FRQw==} '@types/stack-trace@0.0.33': resolution: {integrity: sha512-O7in6531Bbvlb2KEsJ0dq0CHZvc3iWSR5ZYMtvGgnHA56VgriAN/AU2LorfmcvAl2xc9N5fbCTRyMRRl8nd74g==} - '@types/supports-color@10.0.0': - resolution: {integrity: sha512-Kpp/hhA8/pcxqBBKmOCIgvwCOJAI5y6TWTHhhqnB6KmuYlKtixKgN/Z7VzhShdgONe2jYREnTQbsrb3E0nt/OQ==} - deprecated: This is a stub types definition. supports-color provides its own type definitions, so you do not need this installed. - - '@types/tapable@1.0.12': - resolution: {integrity: sha512-bTHG8fcxEqv1M9+TD14P8ok8hjxoOCkfKc8XXLaaD05kI7ohpeI956jtDOD3XHKBQrlyPughUtzm1jtVhHpA5Q==} - - '@types/tough-cookie@4.0.5': - resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/tar-stream@3.1.4': + resolution: {integrity: sha512-921gW0+g29mCJX0fRvqeHzBlE/XclDaAG0Ousy1LCghsOhvaKacDeRGEVzQP9IPfKn8Vysy7FEXAIxycpc/CMg==} - '@types/uglify-js@3.17.5': - resolution: {integrity: sha512-TU+fZFBTBcXj/GpDpDaBmgWk/gn96kMZ+uocaFUlV2f8a6WdMzzI44QBCmGcCiYR0Y6ZlNRiyUyKKt5nl/lbzQ==} + '@types/watchpack@2.4.5': + resolution: {integrity: sha512-8CarnGOIYYRL342jwQyHrGwz4vCD3y5uwwYmzQVzT2Z24DqSd6wwBva6m0eNJX4S5pVmrx9xUEbOsOoqBVhWsg==} - '@types/watchpack@2.4.4': - resolution: {integrity: sha512-SbuSavsPxfOPZwVHBgQUVuzYBe6+8KL7dwiJLXaj5rmv3DxktOMwX5WP1J6UontwUbewjVoc7pCgZvqy6rPn+A==} - - '@types/webpack-sources@3.2.3': - resolution: {integrity: sha512-4nZOdMwSPHZ4pTEZzSp0AsTM4K7Qmu40UKW4tJDiOVs20UzYF9l+qUe4s0ftfN0pin06n+5cWWDJXH+sbhAiDw==} - - '@types/webpack@4.41.40': - resolution: {integrity: sha512-u6kMFSBM9HcoTpUXnL6mt2HSzftqb3JgYV6oxIgL2dl6sX6aCa5k6SOkzv5DuZjBTPUE/dJltKtwwuqrkZHpfw==} + '@types/which@3.0.4': + resolution: {integrity: sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w==} '@types/ws@7.4.7': resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} @@ -2935,8 +3655,8 @@ packages: '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} - '@types/yargs@17.0.33': - resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + '@types/yargs@17.0.35': + resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} '@types/yarnpkg__lockfile@1.1.9': resolution: {integrity: sha512-GD4Fk15UoP5NLCNor51YdfL9MSdldKCqOC9EssrRw3HVfar9wUZ5y8Lfnp+qVD6hIinLr8ygklDYnmlnlQo12Q==} @@ -2944,162 +3664,187 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@8.32.0': - resolution: {integrity: sha512-/jU9ettcntkBFmWUzzGgsClEi2ZFiikMX5eEQsmxIAWMOn4H3D4rvHssstmAHGVvrYnaMqdWWWg0b5M6IN/MTQ==} + '@typescript-eslint/eslint-plugin@8.50.0': + resolution: {integrity: sha512-O7QnmOXYKVtPrfYzMolrCTfkezCJS9+ljLdKW/+DCvRsc3UAz+sbH6Xcsv7p30+0OwUbeWfUDAQE0vpabZ3QLg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + '@typescript-eslint/parser': ^8.50.0 eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/parser@8.32.0': - resolution: {integrity: sha512-B2MdzyWxCE2+SqiZHAjPphft+/2x2FlO9YBx7eKE1BCb+rqBlQdhtAEhzIEdozHd55DXPmxBdpMygFJjfjjA9A==} + '@typescript-eslint/parser@8.50.0': + resolution: {integrity: sha512-6/cmF2piao+f6wSxUsJLZjck7OQsYyRtcOZS02k7XINSNlz93v6emM8WutDQSXnroG2xwYlEVHJI+cPA7CPM3Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/project-service@8.50.0': + resolution: {integrity: sha512-Cg/nQcL1BcoTijEWyx4mkVC56r8dj44bFDvBdygifuS20f3OZCHmFbjF34DPSi07kwlFvqfv/xOLnJ5DquxSGQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/scope-manager@8.50.0': + resolution: {integrity: sha512-xCwfuCZjhIqy7+HKxBLrDVT5q/iq7XBVBXLn57RTIIpelLtEIZHXAF/Upa3+gaCpeV1NNS5Z9A+ID6jn50VD4A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.32.0': - resolution: {integrity: sha512-jc/4IxGNedXkmG4mx4nJTILb6TMjL66D41vyeaPWvDUmeYQzF3lKtN15WsAeTr65ce4mPxwopPSo1yUUAWw0hQ==} + '@typescript-eslint/tsconfig-utils@8.50.0': + resolution: {integrity: sha512-vxd3G/ybKTSlm31MOA96gqvrRGv9RJ7LGtZCn2Vrc5htA0zCDvcMqUkifcjrWNNKXHUU3WCkYOzzVSFBd0wa2w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/type-utils@8.32.0': - resolution: {integrity: sha512-t2vouuYQKEKSLtJaa5bB4jHeha2HJczQ6E5IXPDPgIty9EqcJxpr1QHQ86YyIPwDwxvUmLfP2YADQ5ZY4qddZg==} + '@typescript-eslint/type-utils@8.50.0': + resolution: {integrity: sha512-7OciHT2lKCewR0mFoBrvZJ4AXTMe/sYOe87289WAViOocEmDjjv8MvIOT2XESuKj9jp8u3SZYUSh89QA4S1kQw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/types@8.32.0': - resolution: {integrity: sha512-O5Id6tGadAZEMThM6L9HmVf5hQUXNSxLVKeGJYWNhhVseps/0LddMkp7//VDkzwJ69lPL0UmZdcZwggj9akJaA==} + '@typescript-eslint/types@8.50.0': + resolution: {integrity: sha512-iX1mgmGrXdANhhITbpp2QQM2fGehBse9LbTf0sidWK6yg/NE+uhV5dfU1g6EYPlcReYmkE9QLPq/2irKAmtS9w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.32.0': - resolution: {integrity: sha512-pU9VD7anSCOIoBFnhTGfOzlVFQIA1XXiQpH/CezqOBaDppRwTglJzCC6fUQGpfwey4T183NKhF1/mfatYmjRqQ==} + '@typescript-eslint/typescript-estree@8.50.0': + resolution: {integrity: sha512-W7SVAGBR/IX7zm1t70Yujpbk+zdPq/u4soeFSknWFdXIFuWsBGBOUu/Tn/I6KHSKvSh91OiMuaSnYp3mtPt5IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: 5.8.3 + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/utils@8.32.0': - resolution: {integrity: sha512-8S9hXau6nQ/sYVtC3D6ISIDoJzS1NsCK+gluVhLN2YkBPX+/1wkwyUiDKnxRh15579WoOIyVWnoyIf3yGI9REw==} + '@typescript-eslint/utils@8.50.0': + resolution: {integrity: sha512-87KgUXET09CRjGCi2Ejxy3PULXna63/bMYv72tCAlDJC3Yqwln0HiFJ3VJMst2+mEtNtZu5oFvX4qJGjKsnAgg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.8.3 + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/visitor-keys@8.32.0': - resolution: {integrity: sha512-1rYQTCLFFzOI5Nl0c8LUpJT8HxpwVRn9E4CkMsYfuN6ctmQqExjSTzzSk0Tz2apmXy7WU6/6fyaZVVA/thPN+w==} + '@typescript-eslint/visitor-keys@8.50.0': + resolution: {integrity: sha512-Xzmnb58+Db78gT/CCj/PVCvK+zxbnsw6F+O1oheYszJbBSdEjVhQi3C/Xttzxgi/GLmpvOggRs1RFpiJ8+c34Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@verdaccio/auth@8.0.0-next-8.15': - resolution: {integrity: sha512-vAfzGOHbPcPXMCI90jqm/qSZ1OUBnOGzudZA3+YtherncdwADekvXbdJlZVclcfmZ0sRbfVG5Xpf88aETiwfcw==} + '@verdaccio/auth@8.0.0-next-8.28': + resolution: {integrity: sha512-tM0URyKFq1dGFaoBN0whT1SDur1lBKG+pkQwxgJIXgH04DmefLCH63pn/K1iDDfLwqyxMewpmvMTBS390SSR+A==} engines: {node: '>=18'} - '@verdaccio/commons-api@10.2.0': - resolution: {integrity: sha512-F/YZANu4DmpcEV0jronzI7v2fGVWkQ5Mwi+bVmV+ACJ+EzR0c9Jbhtbe5QyLUuzR97t8R5E/Xe53O0cc2LukdQ==} - engines: {node: '>=8'} + '@verdaccio/config@8.0.0-next-8.28': + resolution: {integrity: sha512-yl7lcSOzT9y7EgUald4bZXIKxhZdAPRvtDZwmsPL433bc+CInyriqYCo6L4fZgFxYAdj9iDzvZIJtCtsFc+8NA==} + engines: {node: '>=18'} - '@verdaccio/config@8.0.0-next-8.15': - resolution: {integrity: sha512-oEzQB+xeqaFAy54veMshqpt1hlZCYNkqoKuwkt7O8J43Fo/beiLluKUVneXckzi+pg1yvvGT7lNCbvuUQrxxQg==} + '@verdaccio/core@8.0.0-next-8.21': + resolution: {integrity: sha512-n3Y8cqf84cwXxUUdTTfEJc8fV55PONPKijCt2YaC0jilb5qp1ieB3d4brqTOdCdXuwkmnG2uLCiGpUd/RuSW0Q==} engines: {node: '>=18'} - '@verdaccio/core@8.0.0-next-8.15': - resolution: {integrity: sha512-d5r/ZSkCri7s1hvV35enptquV5LJ81NqMYJnsjuryIUnvwn1yaqLlcdd6zIL08unzCSr7qDdUAdwGRRm6PKzng==} + '@verdaccio/core@8.0.0-next-8.28': + resolution: {integrity: sha512-W/wBvgF53CLr7m2zDV4QnHGYh0M/D3HTm5OuTxIjeclwDZGH2UHSdiI2BFFhvW7zt6MQVjfTQdgtcH4cmLGXhQ==} engines: {node: '>=18'} '@verdaccio/file-locking@10.3.1': resolution: {integrity: sha512-oqYLfv3Yg3mAgw9qhASBpjD50osj2AX4IwbkUtyuhhKGyoFU9eZdrbeW6tpnqUnj6yBMtAPm2eGD4BwQuX400g==} engines: {node: '>=12'} - '@verdaccio/file-locking@13.0.0-next-8.3': - resolution: {integrity: sha512-Sugx6XYp8nEJ9SmBoEOExEIQQ0T0q8fcyc/afWdiSNDGWviqqSx2IriCvtMwKZrE4XG0BQo6bXO+A8AOOoo7KQ==} + '@verdaccio/file-locking@13.0.0-next-8.6': + resolution: {integrity: sha512-F6xQWvsZnEyGjugrYfe+D/ChSVudXmBFWi8xuTIX6PAdp7dk9x9biOGQFW8O3GSAK8UhJ6WlRisQKJeYRa6vWQ==} engines: {node: '>=18'} - '@verdaccio/loaders@8.0.0-next-8.6': - resolution: {integrity: sha512-yuqD8uAZJcgzuNHjV6C438UNT5r2Ai9+SnUlO34AHZdWSYcluO3Zj5R3p5uf+C7YPCE31pUD27wBU74xVbUoBw==} + '@verdaccio/hooks@8.0.0-next-8.28': + resolution: {integrity: sha512-K+Cu9Pls8G2Wvu6pOYuelCTNBLpSOpmodJaPbUVv/kkhsTphgRiRENhOZGbiPhfVKehQeUCj9WiF8C7xzTf2Vg==} engines: {node: '>=18'} - '@verdaccio/local-storage-legacy@11.0.2': - resolution: {integrity: sha512-7AXG7qlcVFmF+Nue2oKaraprGRtaBvrQIOvc/E89+7hAe399V01KnZI6E/ET56u7U9fq0MSlp92HBcdotlpUXg==} - engines: {node: '>=12'} + '@verdaccio/loaders@8.0.0-next-8.18': + resolution: {integrity: sha512-p8o/DST+TPLz1pTqnduYKMggNxYO5ET+3a4UXLArVDWbhqNnYFRmZVyIW8r0JFOuRwUKdpcJMkXefufMRm8B8g==} + engines: {node: '>=18'} - '@verdaccio/logger-commons@8.0.0-next-8.15': - resolution: {integrity: sha512-nF7VgBC2cl5ufv+mZEwBHHyZFb1F0+kVkuRMf3Tyk+Qp4lXilC9MRZ0oc+RnzsDbNmJ6IZHgHNbs6aJrNfaRGg==} + '@verdaccio/local-storage-legacy@11.1.1': + resolution: {integrity: sha512-P6ahH2W6/KqfJFKP+Eid7P134FHDLNvHa+i8KVgRVBeo2/IXb6FEANpM1mCVNvPANu0LCAmNJBOXweoUKViaoA==} engines: {node: '>=18'} - '@verdaccio/logger-prettify@8.0.0-next-8.2': - resolution: {integrity: sha512-WMXnZPLw5W7GSIQE8UOTp6kRIwiTmnnoJbMmyMlGiNrsRaFKTqk09R5tKUgOyGgd4Lu6yncLbmdm5UjAuwHf1Q==} + '@verdaccio/logger-commons@8.0.0-next-8.28': + resolution: {integrity: sha512-GlIpSCKC6uKR4D9BZFbCiiJHeAaZ/n8izYqMKqFV5RKOrdMaMmYKjVFLvjGDpd22AFnCvSUfgrKCX1FXe8ZFqw==} engines: {node: '>=18'} - '@verdaccio/logger@8.0.0-next-8.15': - resolution: {integrity: sha512-3gjhqvB87JUNDHFMN3YG4IweS9EgbCpAWZatNYzcoIWOoGiEaFQQBSM592CaFiI0yf8acyqWkNa1V95L1NMbRg==} + '@verdaccio/logger-prettify@8.0.0-next-8.4': + resolution: {integrity: sha512-gjI/JW29fyalutn/X1PQ0iNuGvzeVWKXRmnLa7gXVKhdi4p37l/j7YZ7n44XVbbiLIKAK0pbavEg9Yr66QrYaA==} engines: {node: '>=18'} - '@verdaccio/middleware@8.0.0-next-8.15': - resolution: {integrity: sha512-xsCLGbnhqcYwE8g/u9wxNLfDcESpr9ptEZ8Ce7frVTphU7kYIL48QCDPMzug7U+AguNtCq4v4zcoY1PaOQ8mgw==} + '@verdaccio/logger@8.0.0-next-8.28': + resolution: {integrity: sha512-Iss+5mUJSvkDIwOWv6lk9OZjHl9PKHXf4FwM/YI5a77B06r5LYvdpppKVwGxBFn8jFcyGBl97zz8uqz6uD/rhQ==} engines: {node: '>=18'} - '@verdaccio/search-indexer@8.0.0-next-8.4': - resolution: {integrity: sha512-Oea9m9VDqdlDPyQ9+fpcxZk0sIYH2twVK+YbykHpSYpjZRzz9hJfIr/uUwAgpWq83zAl2YDbz4zR3TjzjrWQig==} + '@verdaccio/middleware@8.0.0-next-8.28': + resolution: {integrity: sha512-L2PL4JJQ6dKipNrA/weWTEw47ZUgiJrvKb7g/z3yuDR5O/C7AJ+mOxqsWww0kgq0cvQm+kOXMVY9Oq1g9a+Agw==} engines: {node: '>=18'} - '@verdaccio/signature@8.0.0-next-8.7': - resolution: {integrity: sha512-sqP+tNzUtVIwUtt1ZHwYoxsO3roDLK7GW8c8Hj0SNaON+9ele9z4NBhaor+g95zRuLy6xtw/RgOvpyLon/vPrA==} + '@verdaccio/search-indexer@8.0.0-next-8.5': + resolution: {integrity: sha512-0GC2tJKstbPg/W2PZl2yE+hoAxffD2ZWilEnEYSEo2e9UQpNIy2zg7KE/uMUq2P72Vf5EVfVzb8jdaH4KV4QeA==} + engines: {node: '>=18'} + + '@verdaccio/signature@8.0.0-next-8.20': + resolution: {integrity: sha512-1kwO+l7cLiDjXUwqVTvaKXvcI4C23u4cZCVnGGKXRcahrbVm7Hdh12wSIX5V9gV6O3VlWH458JxoimpPAo4Oxw==} engines: {node: '>=18'} '@verdaccio/streams@10.2.1': resolution: {integrity: sha512-OojIG/f7UYKxC4dYX8x5ax8QhRx1b8OYUAMz82rUottCuzrssX/4nn5QE7Ank0DUSX3C9l/HPthc4d9uKRJqJQ==} engines: {node: '>=12', npm: '>=5'} - '@verdaccio/tarball@13.0.0-next-8.15': - resolution: {integrity: sha512-oSNmq7zD/iPIC5HpJbOJjW/lb0JV9k3jLwI6sG7kPgm+UIxVAOV4fKQOAD18HpHl/WjkF247NA6zGlAB94Habw==} + '@verdaccio/tarball@13.0.0-next-8.28': + resolution: {integrity: sha512-89FHelT4xsrBeAk6WYhhUR6cgpky1IAgBiN3VtWs2b3KA8XesZeG7G0UDygTVEe2O0etXYtrz9vlqZ9nYEaAGA==} engines: {node: '>=18'} - '@verdaccio/ui-theme@8.0.0-next-8.15': - resolution: {integrity: sha512-k9BAM7rvbUqB2JPReNgXKUVTzBkdmIrNw0f6/7uyO+9cp7eVuarrPBnVF0oMc7jzVNBZRCpUksrhMZ0KwDZTpw==} + '@verdaccio/ui-theme@8.0.0-next-8.28': + resolution: {integrity: sha512-TzhdphchcvsI38UPP5hdNJh+LAFvRhYlfrtBuqlZy0BHeGM2i2MNioGl2il2NLVteqXAK9MqnuC5WGxCFXoDYw==} - '@verdaccio/url@13.0.0-next-8.15': - resolution: {integrity: sha512-1N/dGhw7cZMhupf/Xlm73beiL3oCaAiyo9DTumjF3aTcJnipVcT1hoj6CSj9RIX54824rUK9WVmo83dk0KPnjw==} + '@verdaccio/url@13.0.0-next-8.28': + resolution: {integrity: sha512-42wA5LkXWpY42pONEHQhAC5h8nFXdDHChP22swOitTp1xzvAs+PmwUlrol7kMXMWO04skDCSSW1Q54eNkTx/rA==} engines: {node: '>=18'} - '@verdaccio/utils@8.1.0-next-8.15': - resolution: {integrity: sha512-efg/bunOUMVXV+MlljJCrpuT+OQRrQS4wJyGL92B3epUGlgZ8DXs+nxN5v59v1a6AocAdSKwHgZS0g9txmBhOg==} + '@verdaccio/utils@8.1.0-next-8.28': + resolution: {integrity: sha512-/AYNGafG9T90NPGsq6eDMuXx+41tlWfiYsCchgwz074GWEitZ2nAZQWWNvYvFVB2hXzord52muEVTWjgaZPOdQ==} engines: {node: '>=18'} - '@vitejs/plugin-basic-ssl@2.0.0': - resolution: {integrity: sha512-gc9Tjg8bUxBVSTzeWT3Njc0Cl3PakHFKdNfABnZWiUgbxqmHDEn7uECv3fHVylxoYgNzAcmU7ZrILz+BwSo3sA==} + '@vitejs/plugin-basic-ssl@2.1.0': + resolution: {integrity: sha512-dOxxrhgyDIEUADhb/8OlV9JIqYLgos03YorAueTIeOUskLJSEsfwCByjbu98ctXitUN3znXKp0bYD/WHSudCeA==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} peerDependencies: - vite: ^6.0.0 + vite: ^6.0.0 || ^7.0.0 + + '@vitest/coverage-v8@4.0.15': + resolution: {integrity: sha512-FUJ+1RkpTFW7rQITdgTi93qOCWJobWhBirEPCeXh2SW2wsTlFxy51apDz5gzG+ZEYt/THvWeNmhdAoS9DTwpCw==} + peerDependencies: + '@vitest/browser': 4.0.15 + vitest: 4.0.15 + peerDependenciesMeta: + '@vitest/browser': + optional: true - '@vitest/expect@3.1.3': - resolution: {integrity: sha512-7FTQQuuLKmN1Ig/h+h/GO+44Q1IlglPlR2es4ab7Yvfx+Uk5xsv+Ykk+MEt/M2Yn/xGmzaLKxGw2lgy2bwuYqg==} + '@vitest/expect@4.0.15': + resolution: {integrity: sha512-Gfyva9/GxPAWXIWjyGDli9O+waHDC0Q0jaLdFP1qPAUUfo1FEXPXUfUkp3eZA0sSq340vPycSyOlYUeM15Ft1w==} - '@vitest/mocker@3.1.3': - resolution: {integrity: sha512-PJbLjonJK82uCWHjzgBJZuR7zmAOrSvKk1QBxrennDIgtH4uK0TB1PvYmc0XBCigxxtiAVPfWtAdy4lpz8SQGQ==} + '@vitest/mocker@4.0.15': + resolution: {integrity: sha512-CZ28GLfOEIFkvCFngN8Sfx5h+Se0zN+h4B7yOsPVCcgtiO7t5jt9xQh2E1UkFep+eb9fjyMfuC5gBypwb07fvQ==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 + vite: ^6.0.0 || ^7.0.0-0 peerDependenciesMeta: msw: optional: true vite: optional: true - '@vitest/pretty-format@3.1.3': - resolution: {integrity: sha512-i6FDiBeJUGLDKADw2Gb01UtUNb12yyXAqC/mmRWuYl+m/U9GS7s8us5ONmGkGpUUo7/iAYzI2ePVfOZTYvUifA==} + '@vitest/pretty-format@4.0.15': + resolution: {integrity: sha512-SWdqR8vEv83WtZcrfLNqlqeQXlQLh2iilO1Wk1gv4eiHKjEzvgHb2OVc3mIPyhZE6F+CtfYjNlDJwP5MN6Km7A==} - '@vitest/runner@3.1.3': - resolution: {integrity: sha512-Tae+ogtlNfFei5DggOsSUvkIaSuVywujMj6HzR97AHK6XK8i3BuVyIifWAm/sE3a15lF5RH9yQIrbXYuo0IFyA==} + '@vitest/runner@4.0.15': + resolution: {integrity: sha512-+A+yMY8dGixUhHmNdPUxOh0la6uVzun86vAbuMT3hIDxMrAOmn5ILBHm8ajrqHE0t8R9T1dGnde1A5DTnmi3qw==} - '@vitest/snapshot@3.1.3': - resolution: {integrity: sha512-XVa5OPNTYUsyqG9skuUkFzAeFnEzDp8hQu7kZ0N25B1+6KjGm4hWLtURyBbsIAOekfWQ7Wuz/N/XXzgYO3deWQ==} + '@vitest/snapshot@4.0.15': + resolution: {integrity: sha512-A7Ob8EdFZJIBjLjeO0DZF4lqR6U7Ydi5/5LIZ0xcI+23lYlsYJAfGn8PrIWTYdZQRNnSRlzhg0zyGu37mVdy5g==} - '@vitest/spy@3.1.3': - resolution: {integrity: sha512-x6w+ctOEmEXdWaa6TO4ilb7l9DxPR5bwEb6hILKuxfU1NqWT2mpJD9NJN7t3OTfxmVlOMrvtoFJGdgyzZ605lQ==} + '@vitest/spy@4.0.15': + resolution: {integrity: sha512-+EIjOJmnY6mIfdXtE/bnozKEvTC4Uczg19yeZ2vtCz5Yyb0QQ31QWVQ8hswJ3Ysx/K2EqaNsVanjr//2+P3FHw==} - '@vitest/utils@3.1.3': - resolution: {integrity: sha512-2Ltrpht4OmHO9+c/nmHtF09HWiyWdworqnHIwjfvDyWjuwKbdkcS9AnhsDn+8E2RM4x++foD1/tNuLPVvWG1Rg==} + '@vitest/utils@4.0.15': + resolution: {integrity: sha512-HXjPW2w5dxhTD0dLwtYHDnelK3j8sR8cWIaLxr22evTyY6q8pRCjZSmhRWVjBaOVXChQd6AwMzi9pucorXCPZA==} '@web/browser-logs@0.4.1': resolution: {integrity: sha512-ypmMG+72ERm+LvP+loj9A64MTXvWMXHUOu773cPO4L1SV/VWg6xA9Pv7vkvkXQX+ItJtCJt+KQ+U6ui2HhSFUw==} @@ -3146,8 +3891,8 @@ packages: resolution: {integrity: sha512-ZL9F6FXd0DBQvo/h/+mSfzFTSRVxzV9st/AHhpgABtUtV/AIpVE9to6+xdkpu6827kwjezdpuadPfg+PlrBWqQ==} engines: {node: '>=18.0.0'} - '@web/test-runner@0.20.1': - resolution: {integrity: sha512-MTN8D1WCeCdkUWJIeG9yauUbRkk9g0zGFnBbI5smtPE91NpXFMfRd8nShIvxQnHx9fNTmK+OCYKnOSlq5DLLVA==} + '@web/test-runner@0.20.2': + resolution: {integrity: sha512-zfEGYEDnS0EI8qgoWFjmtkIXhqP15W40NW3dCaKtbxj5eU0a7E53f3GV/tZGD0GlZKF8d4Fyw+AFrwOJU9Z4GA==} engines: {node: '>=18.0.0'} hasBin: true @@ -3196,8 +3941,8 @@ packages: '@webassemblyjs/wast-printer@1.14.1': resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} - '@xmldom/xmldom@0.8.10': - resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} + '@xmldom/xmldom@0.8.11': + resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==} engines: {node: '>=10.0.0'} '@xtuc/ieee754@1.2.0': @@ -3213,9 +3958,9 @@ packages: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true - abbrev@3.0.1: - resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} - engines: {node: ^18.17.0 || >=20.5.0} + abbrev@4.0.0: + resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==} + engines: {node: ^20.17.0 || >=22.9.0} abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -3229,6 +3974,12 @@ packages: resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} engines: {node: '>= 0.6'} + acorn-import-phases@1.0.4: + resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} + engines: {node: '>=10.13.0'} + peerDependencies: + acorn: ^8.14.0 + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3238,8 +3989,8 @@ packages: resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} engines: {node: '>=0.4.0'} - acorn@8.14.1: - resolution: {integrity: sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} hasBin: true @@ -3259,8 +4010,8 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} - agent-base@7.1.3: - resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} ajv-formats@2.1.1: @@ -3285,6 +4036,10 @@ packages: ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + algoliasearch@5.46.0: + resolution: {integrity: sha512-7ML6fa2K93FIfifG3GMWhDEwT5qQzPTmoHKCTvhzGEwdbQ4n0yYUWZlLYT75WllTGJCJtNUI0C1ybN4BCegqvg==} + engines: {node: '>= 14.0.0'} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -3293,8 +4048,8 @@ packages: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} - ansi-escapes@7.0.0: - resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} + ansi-escapes@7.2.0: + resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==} engines: {node: '>=18'} ansi-html-community@0.0.8: @@ -3310,8 +4065,8 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.1.0: - resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} ansi-styles@2.2.1: @@ -3322,8 +4077,8 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} anymatch@3.1.3: @@ -3352,11 +4107,15 @@ packages: resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} + array-differ@4.0.0: + resolution: {integrity: sha512-Q6VPTLMsmXZ47ENG3V+wQyZS1ZxXMxFyYzA+Z/GMrJ6yIutAIEf9wTyroTzmGjNfox9/h3GdGBCVh43GVFx4Uw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + array-flatten@1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} - array-includes@3.1.8: - resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} + array-includes@3.1.9: + resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} engines: {node: '>= 0.4'} array-union@1.0.2: @@ -3367,6 +4126,10 @@ packages: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + array-union@3.0.1: + resolution: {integrity: sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==} + engines: {node: '>=12'} + array-uniq@1.0.3: resolution: {integrity: sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==} engines: {node: '>=0.10.0'} @@ -3410,6 +4173,9 @@ packages: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} engines: {node: '>=4'} + ast-v8-to-istanbul@0.3.9: + resolution: {integrity: sha512-dSC6tJeOJxbZrPzPbv5mMd6CMiQ1ugaVXXPRad2fXUSsy1kstFn9XQWemV9VW7Y7kpxgQ/4WMoZfwdH8XSU48w==} + astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -3425,9 +4191,6 @@ packages: async@2.6.4: resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==} - async@3.2.4: - resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} - async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} @@ -3438,8 +4201,8 @@ packages: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} - autoprefixer@10.4.21: - resolution: {integrity: sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==} + autoprefixer@10.4.23: + resolution: {integrity: sha512-YYTXSFulfwytnjAPlw8QHncHJmlvFKtczb8InXaAx9Q0LbfDnfEYDE55omerIJKihhmU61Ft+cAOSzQVaBUmeA==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: @@ -3455,8 +4218,13 @@ packages: aws4@1.13.2: resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} - b4a@1.6.7: - resolution: {integrity: sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==} + b4a@1.7.3: + resolution: {integrity: sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==} + peerDependencies: + react-native-b4a: '*' + peerDependenciesMeta: + react-native-b4a: + optional: true babel-loader@10.0.0: resolution: {integrity: sha512-z8jt+EdS61AMw22nSfoNJAZ0vrtmhPRVi6ghL3rCeRZI8cdNYFiV5xeV3HbE7rlZZNmGH8BVccwWt8/ED0QOHA==} @@ -3465,29 +4233,34 @@ packages: '@babel/core': ^7.12.0 webpack: '>=5.61.0' - babel-plugin-polyfill-corejs2@0.4.13: - resolution: {integrity: sha512-3sX/eOms8kd3q2KZ6DAhKPc0dgm525Gqq5NtWKZ7QYYZEv57OQ54KtblzJzH1lQF/eQxO8KjWGIK9IPUJNus5g==} + babel-plugin-polyfill-corejs2@0.4.14: + resolution: {integrity: sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - babel-plugin-polyfill-corejs3@0.11.1: - resolution: {integrity: sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==} + babel-plugin-polyfill-corejs3@0.13.0: + resolution: {integrity: sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - babel-plugin-polyfill-regenerator@0.6.4: - resolution: {integrity: sha512-7gD3pRadPrbjhjLyxebmx/WrFYcuSjZ0XbdUujQMZ/fcE9oeewk2U/7PCvez84UeuK3oSjmPZ0Ch0dlupQvGzw==} + babel-plugin-polyfill-regenerator@0.6.5: + resolution: {integrity: sha512-ISqQ2frbiNU9vIJkzg7dlPpznPZ4jOiUQ1uSmB0fEHeowtN3COYRsXr/xexn64NpU13P06jc/L5TgiJXOgrbEg==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - bare-events@2.5.4: - resolution: {integrity: sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==} + bare-events@2.8.2: + resolution: {integrity: sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==} + peerDependencies: + bare-abort-controller: '*' + peerDependenciesMeta: + bare-abort-controller: + optional: true - bare-fs@4.1.4: - resolution: {integrity: sha512-r8+26Voz8dGX3AYpJdFb1ZPaUSM8XOLCZvy+YGpRTmwPHIxA7Z3Jov/oMPtV7hfRQbOnH8qGlLTzQAbgtdNN0Q==} + bare-fs@4.5.2: + resolution: {integrity: sha512-veTnRzkb6aPHOvSKIOy60KzURfBdUflr5VReI+NSaPL6xf+XLdONQgZgpYvUuZLVQ8dCqxpBAudaOM1+KpAUxw==} engines: {bare: '>=1.16.0'} peerDependencies: bare-buffer: '*' @@ -3495,15 +4268,15 @@ packages: bare-buffer: optional: true - bare-os@3.6.1: - resolution: {integrity: sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==} + bare-os@3.6.2: + resolution: {integrity: sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A==} engines: {bare: '>=1.14.0'} bare-path@3.0.0: resolution: {integrity: sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==} - bare-stream@2.6.5: - resolution: {integrity: sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==} + bare-stream@2.7.0: + resolution: {integrity: sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==} peerDependencies: bare-buffer: '*' bare-events: '*' @@ -3513,6 +4286,9 @@ packages: bare-events: optional: true + bare-url@2.3.2: + resolution: {integrity: sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -3520,8 +4296,9 @@ packages: resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} engines: {node: ^4.5.0 || >= 5.9} - baseline-browser-mapping@2.3.0: - resolution: {integrity: sha512-K6nnZh0g0B/ZxbHSjZfKuJK7q1wto+RBqmVk9u/G+/YSOVlVXls71j2Jbl25Dos6j4HPAtne0MYdXdNOOSJm5g==} + baseline-browser-mapping@2.9.11: + resolution: {integrity: sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==} + hasBin: true basic-ftp@5.0.5: resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} @@ -3536,21 +4313,24 @@ packages: bcryptjs@2.4.3: resolution: {integrity: sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==} - beasties@0.3.3: - resolution: {integrity: sha512-Mba3V4hTPrM7P2CSidueg71JZ0G+DyK7maBqp4/uax/PQznwdFti9cOW6Z3lTxBRH84kRICN0TyQ0MSSmufaAw==} + beasties@0.3.5: + resolution: {integrity: sha512-NaWu+f4YrJxEttJSm16AzMIFtVldCvaJ68b1L098KpqXmxt9xOLtKoLkKxb8ekhOrLqEJAbvT6n6SEvB/sac7A==} engines: {node: '>=14.0.0'} - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} + before-after-hook@4.0.0: + resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==} + + bidi-js@1.0.3: + resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} big.js@5.2.2: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} - big.js@6.2.2: - resolution: {integrity: sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==} + big.js@7.0.1: + resolution: {integrity: sha512-iFgV784tD8kq4ccF1xtNMZnXeZzVuXWWM+ERFzKQjv+A5G9HC8CY3DuV45vgzFFcW+u2tIvmF95+AzWgs6BjCg==} - bignumber.js@9.3.0: - resolution: {integrity: sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==} + bignumber.js@9.3.1: + resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==} binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} @@ -3568,8 +4348,12 @@ packages: resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - body-parser@2.2.0: - resolution: {integrity: sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==} + body-parser@1.20.4: + resolution: {integrity: sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + body-parser@2.2.1: + resolution: {integrity: sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==} engines: {node: '>=18'} bonjour-service@1.3.0: @@ -3578,11 +4362,11 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} - brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + brace-expansion@2.0.2: + resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} @@ -3606,8 +4390,8 @@ packages: browserify-zlib@0.1.4: resolution: {integrity: sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==} - browserslist@4.24.5: - resolution: {integrity: sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==} + browserslist@4.28.1: + resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -3632,6 +4416,10 @@ packages: buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + bufferutil@4.0.9: + resolution: {integrity: sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==} + engines: {node: '>=6.14.2'} + bundle-name@4.1.0: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} @@ -3640,18 +4428,22 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} - cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - - cacache@19.0.1: - resolution: {integrity: sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==} - engines: {node: ^18.17.0 || >=20.5.0} + cacache@20.0.3: + resolution: {integrity: sha512-3pUp4e8hv07k1QlijZu6Kn7c9+ZpWWk4j3F8N3xPuCExULobqJydKYOTj1FTq58srkJsXvO7LbGAH4C0ZU3WGw==} + engines: {node: ^20.17.0 || >=22.9.0} cache-content-type@1.0.1: resolution: {integrity: sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==} engines: {node: '>= 6.0.0'} + cacheable-lookup@6.1.0: + resolution: {integrity: sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==} + engines: {node: '>=10.6.0'} + + cacheable-request@7.0.2: + resolution: {integrity: sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==} + engines: {node: '>=8'} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -3676,15 +4468,15 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001717: - resolution: {integrity: sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==} + caniuse-lite@1.0.30001761: + resolution: {integrity: sha512-JF9ptu1vP2coz98+5051jZ4PwQgd2ni8A+gYSN7EA7dPKIMf0pDlSUxhdmVOaV3/fYK5uWBkgSXJaRLr4+3A6g==} caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} - chai@5.2.0: - resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==} - engines: {node: '>=12'} + chai@6.2.1: + resolution: {integrity: sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==} + engines: {node: '>=18'} chalk-template@0.4.0: resolution: {integrity: sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==} @@ -3698,16 +4490,12 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chalk@5.4.1: - resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - check-error@2.1.1: - resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} - engines: {node: '>= 16'} + chardet@2.1.1: + resolution: {integrity: sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==} checkpoint-stream@0.1.2: resolution: {integrity: sha512-eYXIcydL3mPjjEVLxHdi1ISgTwmxGJZ8vyJ3lYVvFTDRyTOZMTbKZdRJqiA7Gi1rPcwOyyzcrZmGLL8ff7e69w==} @@ -3720,13 +4508,13 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - chownr@3.0.0: resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} engines: {node: '>=18'} @@ -3740,8 +4528,8 @@ packages: resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} engines: {node: '>=6.0'} - chromium-bidi@5.1.0: - resolution: {integrity: sha512-9MSRhWRVoRPDG0TgzkHrshFSJJNZzfY5UFqUMuksg7zL1yoZIZ3jLB0YAgHclbiAxPI86pBnwDX1tbzoiV8aFw==} + chromium-bidi@12.0.1: + resolution: {integrity: sha512-fGg+6jr0xjQhzpy5N4ErZxQ4wF7KLEvhGZXD6EgvZKDhu7iOhZXnZhcDxPJDcwTcrD48NPzOCo84RP2lv3Z+Cg==} peerDependencies: devtools-protocol: '*' @@ -3753,13 +4541,17 @@ packages: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} engines: {node: '>=18'} - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} + cli-progress@3.12.0: + resolution: {integrity: sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==} + engines: {node: '>=4'} - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} + cli-spinners@3.3.0: + resolution: {integrity: sha512-/+40ljC3ONVnYIttjMWrlL51nItDAbBrq2upN8BPyvGU/2n5Oxw3tbNwORCaNuNqLJnxGqOfjUuhsv7l5Q4IsQ==} + engines: {node: '>=18.20'} + + cli-truncate@5.1.1: + resolution: {integrity: sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==} + engines: {node: '>=20'} cli-width@4.1.0: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} @@ -3778,13 +4570,16 @@ packages: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} + cliui@9.0.1: + resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} + engines: {node: '>=20'} + clone-deep@4.0.1: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} + clone-response@1.0.3: + resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} clone@2.1.2: resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} @@ -3827,13 +4622,16 @@ packages: resolution: {integrity: sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==} engines: {node: '>=12.20.0'} - commander@13.1.0: - resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} - engines: {node: '>=18'} + commander@14.0.2: + resolution: {integrity: sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==} + engines: {node: '>=20'} commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + common-path-prefix@3.0.0: + resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} + commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -3841,8 +4639,8 @@ packages: resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} engines: {node: '>= 0.6'} - compression@1.8.0: - resolution: {integrity: sha512-k6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+vIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+YHr7xTgOgGA==} + compression@1.8.1: + resolution: {integrity: sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==} engines: {node: '>= 0.8.0'} concat-map@0.0.1: @@ -3872,14 +4670,23 @@ packages: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} - content-disposition@1.0.0: - resolution: {integrity: sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==} - engines: {node: '>= 0.6'} + content-disposition@1.0.1: + resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} + engines: {node: '>=18'} content-type@1.0.5: resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} + conventional-commits-filter@5.0.0: + resolution: {integrity: sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q==} + engines: {node: '>=18'} + + conventional-commits-parser@6.2.1: + resolution: {integrity: sha512-20pyHgnO40rvfI0NGF/xiEoFMkXDtkF8FwHvk5BokoFoCuTQRI8vrNCNFWUOfuolKJMm1tPCHc8GgYEtr1XRNA==} + engines: {node: '>=18'} + hasBin: true + convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} @@ -3889,6 +4696,9 @@ packages: cookie-signature@1.0.6: resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + cookie-signature@1.0.7: + resolution: {integrity: sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==} + cookie-signature@1.2.2: resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} engines: {node: '>=6.6.0'} @@ -3908,17 +4718,14 @@ packages: copy-anything@2.0.6: resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==} - copy-webpack-plugin@13.0.0: - resolution: {integrity: sha512-FgR/h5a6hzJqATDGd9YG41SeDViH+0bkHn6WNXCi5zKAZkeESeSxLySSsFLHqLEVCh0E+rITmCf0dusXWYukeQ==} + copy-webpack-plugin@13.0.1: + resolution: {integrity: sha512-J+YV3WfhY6W/Xf9h+J1znYuqTye2xkBUIGyTPWuBAT27qajBa5mR4f8WBmfDY3YjRftT2kqZZiLi1qf0H+UOFw==} engines: {node: '>= 18.12.0'} peerDependencies: webpack: ^5.1.0 - core-js-compat@3.42.0: - resolution: {integrity: sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==} - - core-js@3.40.0: - resolution: {integrity: sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==} + core-js-compat@3.47.0: + resolution: {integrity: sha512-IGfuznZ/n7Kp9+nypamBhvwdwLsW6KC8IOaURw2doAK5e98AG3acVLdh0woOnEqCfUtS+Vu882JE4k/DAm3ItQ==} core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} @@ -3934,7 +4741,7 @@ packages: resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: - typescript: 5.8.3 + typescript: '>=4.9.5' peerDependenciesMeta: typescript: optional: true @@ -3948,10 +4755,6 @@ packages: cross-fetch@4.1.0: resolution: {integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==} - cross-spawn@6.0.6: - resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} - engines: {node: '>=4.8'} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -3968,11 +4771,15 @@ packages: webpack: optional: true - css-select@5.1.0: - resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + css-select@6.0.0: + resolution: {integrity: sha512-rZZVSLle8v0+EY8QAkDWrKhpgt6SA5OtHsgBnsj6ZaLb5dmDVOWUDtQitd9ydxxvEjhewNudS6eTVU7uOyzvXw==} + + css-tree@3.1.0: + resolution: {integrity: sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - css-what@6.1.0: - resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + css-what@7.0.0: + resolution: {integrity: sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==} engines: {node: '>= 6'} cssesc@3.0.0: @@ -3980,9 +4787,9 @@ packages: engines: {node: '>=4'} hasBin: true - cssstyle@4.3.1: - resolution: {integrity: sha512-ZgW+Jgdd7i52AaLYCriF8Mxqft0gD/R9i9wi6RWBhs1pqdPEzPjym7rvRKi397WmQFf3SlyUsszhw+VVCbx79Q==} - engines: {node: '>=18'} + cssstyle@5.3.5: + resolution: {integrity: sha512-GlsEptulso7Jg0VaOZ8BXQi3AkYM5BOJKEO/rjMidSCq70FkIC5y0eawrCXeYzxgt3OCf4Ls+eoxN+/05vN0Ag==} + engines: {node: '>=20'} custom-event@1.0.1: resolution: {integrity: sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==} @@ -3999,9 +4806,9 @@ packages: resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} engines: {node: '>= 14'} - data-urls@5.0.0: - resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} - engines: {node: '>=18'} + data-urls@6.0.0: + resolution: {integrity: sha512-BnBS08aLUM+DKamupXs3w2tJJoqU+AkaE/+6vQxi/G/DPmIZFJJp9Dkb1kM03AZx8ADehDUZgsNxju3mPXZYIA==} + engines: {node: '>=20'} data-view-buffer@1.0.2: resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} @@ -4068,16 +4875,34 @@ packages: supports-color: optional: true + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} - decimal.js@10.5.0: - resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==} + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} - deep-eql@5.0.2: - resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} - engines: {node: '>=6'} + decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} deep-equal@1.0.1: resolution: {integrity: sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==} @@ -4089,20 +4914,21 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - default-browser-id@5.0.0: - resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} engines: {node: '>=18'} - default-browser@5.2.1: - resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} + default-browser@5.4.0: + resolution: {integrity: sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg==} engines: {node: '>=18'} default-gateway@6.0.3: resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} engines: {node: '>= 10'} - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + defer-to-connect@2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} define-data-property@1.1.4: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} @@ -4163,8 +4989,8 @@ packages: engines: {node: '>=0.10'} hasBin: true - detect-libc@2.0.4: - resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} detect-node@2.1.0: @@ -4178,8 +5004,8 @@ packages: devtools-protocol@0.0.1045489: resolution: {integrity: sha512-D+PTmWulkuQW4D1NTiCRCFxF7pQPn0hgp4YyX4wAQ6xYXKOadSWPR3ENGDQ47MW/Ewc9v2rpC/UEEGahgBYpSQ==} - devtools-protocol@0.0.1439962: - resolution: {integrity: sha512-jJF48UdryzKiWhJ1bLKr7BFWUQCEIT5uCNbDLqkQJBtkFxYzILJH44WN0PDKMIlGDN7Utb8vyUY85C3w4R/t2g==} + devtools-protocol@0.0.1534754: + resolution: {integrity: sha512-26T91cV5dbOYnXdJi5qQHoTtUoNEqwkHcAyu/IKtjIAxiEqPMrDiRkDOPWVsGfNZGmlQVHQbZRSjD8sxagWVsQ==} di@0.0.1: resolution: {integrity: sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==} @@ -4250,11 +5076,16 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.150: - resolution: {integrity: sha512-rOOkP2ZUMx1yL4fCxXQKDHQ8ZXwisb2OycOQVKHgvB3ZI4CvehOd4y2tfnnLDieJ3Zs1RL1Dlp3cMkyIn7nnXA==} + ejs@3.1.10: + resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} + engines: {node: '>=0.10.0'} + hasBin: true + + electron-to-chromium@1.5.267: + resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} - emoji-regex@10.4.0: - resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@10.6.0: + resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -4277,8 +5108,8 @@ packages: encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} - end-of-stream@1.4.4: - resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + end-of-stream@1.4.5: + resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} engine.io-client@6.6.3: resolution: {integrity: sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==} @@ -4291,8 +5122,8 @@ packages: resolution: {integrity: sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==} engines: {node: '>=10.2.0'} - enhanced-resolve@5.18.1: - resolution: {integrity: sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==} + enhanced-resolve@5.18.4: + resolution: {integrity: sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==} engines: {node: '>=10.13.0'} ent@2.2.2: @@ -4303,16 +5134,16 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - entities@6.0.0: - resolution: {integrity: sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==} + entities@6.0.1: + resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} - envinfo@7.14.0: - resolution: {integrity: sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg==} + envinfo@7.15.0: + resolution: {integrity: sha512-chR+t7exF6y59kelhXw5I3849nTy7KIRO+ePdLMhCD+JRP/JvmkenDWP7QSFGlsHX+kxGxdDutOPrmj5j1HR6g==} engines: {node: '>=4'} hasBin: true @@ -4327,14 +5158,14 @@ packages: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true - error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} errorstacks@2.4.1: resolution: {integrity: sha512-jE4i0SMYevwu/xxAuzhly/KTwtj0xDhbzB6m1xPImxTkw8wcCbgarOQPfCVMi5JKVyW7in29pNJCCJrry3Ynnw==} - es-abstract@1.23.9: - resolution: {integrity: sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==} + es-abstract@1.24.1: + resolution: {integrity: sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==} engines: {node: '>= 0.4'} es-define-property@1.0.1: @@ -4348,6 +5179,9 @@ packages: es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + es-module-lexer@2.0.0: + resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} @@ -4370,13 +5204,13 @@ packages: es6-promisify@5.0.0: resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} - esbuild-wasm@0.25.4: - resolution: {integrity: sha512-2HlCS6rNvKWaSKhWaG/YIyRsTsL3gUrMP2ToZMBIjw9LM7vVcIs+rz8kE2vExvTJgvM8OKPqNpcHawY/BQc/qQ==} + esbuild-wasm@0.27.1: + resolution: {integrity: sha512-NjueSyuuMjX6F/mnqQ8g4rkwAFTct7JT/A/oXjXhGTFbWiTm3zU59BMulOrT+KuCHj+oShTBARQCxCDDvVxwFA==} engines: {node: '>=18'} hasBin: true - esbuild@0.25.4: - resolution: {integrity: sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==} + esbuild@0.27.1: + resolution: {integrity: sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==} engines: {node: '>=18'} hasBin: true @@ -4400,8 +5234,8 @@ packages: engines: {node: '>=6.0'} hasBin: true - eslint-config-prettier@10.1.2: - resolution: {integrity: sha512-Epgp/EofAUeEpIdZkW60MHKvPyru1ruQJxPL+WIycnaPApuseK0Zpkrh/FwL9oIpQvIhJwV7ptOy0DWUjTlCiA==} + eslint-config-prettier@10.1.8: + resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -4409,8 +5243,8 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-module-utils@2.12.0: - resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} + eslint-module-utils@2.12.1: + resolution: {integrity: sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -4435,8 +5269,8 @@ packages: peerDependencies: eslint: '>=7.7.0' - eslint-plugin-import@2.31.0: - resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} + eslint-plugin-import@2.32.0: + resolution: {integrity: sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -4449,20 +5283,20 @@ packages: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} - eslint-scope@8.3.0: - resolution: {integrity: sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==} + eslint-scope@8.4.0: + resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.2.0: - resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} + eslint-visitor-keys@4.2.1: + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.26.0: - resolution: {integrity: sha512-Hx0MOjPh6uK9oq9nVsATZKE/Wlbai7KFjfCuw9UHaguDW3x+HF0O5nIi3ud39TWgrTjTO5nHxmL3R1eANinWHQ==} + eslint@9.39.2: + resolution: {integrity: sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -4471,8 +5305,8 @@ packages: jiti: optional: true - espree@10.3.0: - resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} + espree@10.4.0: + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: @@ -4523,22 +5357,21 @@ packages: events-intercept@2.0.0: resolution: {integrity: sha512-blk1va0zol9QOrdZt0rFXo5KMkNPVSp92Eju/Qz8THwKWKRKeE0T8Br/1aW6+Edkyq9xHYgYxn2QtOnUKPUp+Q==} + events-universal@1.0.1: + resolution: {integrity: sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==} + events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - eventsource-parser@3.0.1: - resolution: {integrity: sha512-VARTJ9CYeuQYb0pZEPbzi740OWFgpHe7AYJ2WFZVnUDUQp5Dk2yJUgF36YsZ81cOyxT0QxmXD2EQpapAouzWVA==} + eventsource-parser@3.0.6: + resolution: {integrity: sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==} engines: {node: '>=18.0.0'} - eventsource@3.0.6: - resolution: {integrity: sha512-l19WpE2m9hSuyP06+FbuUUf1G+R0SFLrtQfbRb9PRr+oimOfxQhgGCbVaXg5IvZyyTThJsxh6L/srkMiCeBPDA==} + eventsource@3.0.7: + resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} engines: {node: '>=18.0.0'} - execa@1.0.0: - resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==} - engines: {node: '>=6'} - execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -4547,37 +5380,37 @@ packages: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} - expect-type@1.2.1: - resolution: {integrity: sha512-/kP8CAwxzLVEeFrMm4kMmy4CCDlpipyA7MYLVrdJIkV0fYF0UaigQHRsxHiuY/GEea+bh4KSv3TIlgr+2UL6bw==} + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} engines: {node: '>=12.0.0'} - exponential-backoff@3.1.2: - resolution: {integrity: sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==} + exponential-backoff@3.1.3: + resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==} express-rate-limit@5.5.1: resolution: {integrity: sha512-MTjE2eIbHv5DyfuFz4zLYWxpqVhEhkTiwFGuB74Q9CSou2WHO52nlE5y3Zlg6SIsiYUIPj6ifFxnkPz6O3sIUg==} - express-rate-limit@7.5.0: - resolution: {integrity: sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==} + express-rate-limit@7.5.1: + resolution: {integrity: sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==} engines: {node: '>= 16'} peerDependencies: - express: ^4.11 || 5 || ^5.0.0-beta.1 + express: '>= 4.11' express@4.21.2: resolution: {integrity: sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==} engines: {node: '>= 0.10.0'} - express@5.1.0: - resolution: {integrity: sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==} + express@4.22.1: + resolution: {integrity: sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==} + engines: {node: '>= 0.10.0'} + + express@5.2.1: + resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - extract-zip@2.0.1: resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} engines: {node: '>= 10.17.0'} @@ -4587,8 +5420,8 @@ packages: resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} engines: {'0': node >=0.6.0} - fast-content-type-parse@2.0.1: - resolution: {integrity: sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==} + fast-content-type-parse@3.0.0: + resolution: {integrity: sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==} fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -4606,12 +5439,8 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-redact@3.5.0: - resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} - engines: {node: '>=6'} - - fast-uri@3.0.6: - resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} + fast-uri@3.1.0: + resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} @@ -4623,8 +5452,9 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - fdir@6.4.4: - resolution: {integrity: sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -4639,6 +5469,9 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} + filelist@1.0.4: + resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -4655,18 +5488,26 @@ packages: resolution: {integrity: sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==} engines: {node: '>= 0.8'} - finalhandler@2.1.0: - resolution: {integrity: sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==} + finalhandler@1.3.2: + resolution: {integrity: sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==} engines: {node: '>= 0.8'} - find-cache-dir@3.3.2: - resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} - engines: {node: '>=8'} + finalhandler@2.1.1: + resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} + engines: {node: '>= 18.0.0'} + + find-cache-directory@6.0.0: + resolution: {integrity: sha512-CvFd5ivA6HcSHbD+59P7CyzINHXzwhuQK8RY7CxJZtgDSAtRlHiCaQpZQ2lMR/WRyUIEmzUvL6G2AGurMfegZA==} + engines: {node: '>=20'} find-replace@3.0.0: resolution: {integrity: sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==} engines: {node: '>=4.0.0'} + find-up-simple@1.0.1: + resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==} + engines: {node: '>=18'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -4675,6 +5516,9 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} + firebase@12.7.0: + resolution: {integrity: sha512-ZBZg9jFo8uH4Emd7caOqtalKJfDGHnHQSrCPiqRAdTFQd0wL3ERilUBfhnhBLnlernugkN/o7nJa0p+sE71Izg==} + flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -4686,8 +5530,13 @@ packages: flatted@3.3.3: resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} - follow-redirects@1.15.9: - resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + folder-hash@4.1.1: + resolution: {integrity: sha512-1ZSlKJSbET3XpglnEXC9g+QF4QRZhqHIjpFfa4pAMfO4tu/XYPafpeHEX6zOFS2EolOIXr0lPh1eSjmdWItX2w==} + engines: {node: '>=10.10.0'} + hasBin: true + + follow-redirects@1.15.11: + resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -4706,16 +5555,15 @@ packages: forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + form-data-encoder@1.7.2: + resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==} + form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} engines: {node: '>= 0.12'} - form-data@2.5.3: - resolution: {integrity: sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ==} - engines: {node: '>= 0.12'} - - form-data@4.0.2: - resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} + form-data@4.0.5: + resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} formdata-polyfill@4.0.10: @@ -4726,8 +5574,8 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} - fraction.js@4.3.7: - resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} + fraction.js@5.3.4: + resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} fresh@0.5.2: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} @@ -4747,10 +5595,6 @@ packages: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - fs-minipass@3.0.3: resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -4773,13 +5617,17 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - gaxios@6.7.1: - resolution: {integrity: sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==} - engines: {node: '>=14'} + gaxios@7.1.3: + resolution: {integrity: sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==} + engines: {node: '>=18'} - gcp-metadata@6.1.1: - resolution: {integrity: sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==} - engines: {node: '>=14'} + gcp-metadata@8.1.2: + resolution: {integrity: sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==} + engines: {node: '>=18'} + + generator-function@2.0.1: + resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} + engines: {node: '>= 0.4'} gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -4789,8 +5637,8 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.3.0: - resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + get-east-asian-width@1.4.0: + resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} get-intrinsic@1.3.0: @@ -4805,10 +5653,6 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - get-stream@4.1.0: - resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} - engines: {node: '>=6'} - get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -4821,13 +5665,21 @@ packages: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} - get-uri@6.0.4: - resolution: {integrity: sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==} + get-tsconfig@4.13.0: + resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==} + + get-uri@6.0.5: + resolution: {integrity: sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==} engines: {node: '>= 14'} getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + git-raw-commits@5.0.0: + resolution: {integrity: sha512-I2ZXrXeOc0KrCvC7swqtIFXFN+rbjnC7b2T943tvemIOVNl+XP8YnA9UVwqFhzzLClnSA60KR/qEjLpXzs73Qg==} + engines: {node: '>=18'} + hasBin: true + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -4836,27 +5688,33 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + glob-to-regex.js@1.2.0: + resolution: {integrity: sha512-QMwlOQKU/IzqMUOAZWubUOT8Qft+Y0KQWnX9nK3ch0CJg0tTp4TvGZsTfudYKv2NzoQSyPcnA6TYeIQ3jGichQ==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} - glob@10.4.5: - resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + glob@10.5.0: + resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} hasBin: true + glob@13.0.0: + resolution: {integrity: sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==} + engines: {node: 20 || >=22} + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@16.0.0: - resolution: {integrity: sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==} + globals@16.5.0: + resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==} engines: {node: '>=18'} globalthis@1.0.4: @@ -4871,27 +5729,38 @@ packages: resolution: {integrity: sha512-HJRTIH2EeH44ka+LWig+EqT2ONSYpVlNfx6pyd592/VF1TbfljJ7elwie7oSwcViLGqOdWocSdu2txwBF9bjmQ==} engines: {node: '>=0.10.0'} - google-auth-library@9.15.1: - resolution: {integrity: sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==} - engines: {node: '>=14'} + google-auth-library@10.5.0: + resolution: {integrity: sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==} + engines: {node: '>=18'} - google-gax@4.4.1: - resolution: {integrity: sha512-Phyp9fMfA00J3sZbJxbbB4jC55b7DBjE3F6poyL3wKMEBVKA79q6BGuHcTiM28yOzVql0NDbRL8MLLh8Iwk9Dg==} - engines: {node: '>=14'} + google-gax@5.0.6: + resolution: {integrity: sha512-1kGbqVQBZPAAu4+/R1XxPQKP0ydbNYoLAr4l0ZO2bMV0kLyLW4I1gAk++qBLWt7DPORTzmWRMsCZe86gDjShJA==} + engines: {node: '>=18'} - google-logging-utils@0.0.2: - resolution: {integrity: sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==} + google-logging-utils@1.1.3: + resolution: {integrity: sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==} engines: {node: '>=14'} gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + got-cjs@12.5.4: + resolution: {integrity: sha512-Uas6lAsP8bRCt5WXGMhjFf/qEHTrm4v4qxGR02rLG2kdG9qedctvlkdwXVcDJ7Cs84X+r4dPU7vdwGjCaspXug==} + engines: {node: '>=12'} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + graphql-tag@2.12.6: + resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + graphql@16.12.0: + resolution: {integrity: sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} grpc-gcp@1.0.1: resolution: {integrity: sha512-06r73IoGaAIpzT+DRPnw7V5BXvZ5mjy1OcKqSPX+ZHOgbLxT+lJfz8IN83z/sbA3t55ZX88MfDaaCjDGdveVIA==} @@ -4899,9 +5768,9 @@ packages: peerDependencies: protobufjs: '*' - gtoken@7.1.0: - resolution: {integrity: sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==} - engines: {node: '>=14.0.0'} + gtoken@8.0.0: + resolution: {integrity: sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==} + engines: {node: '>=18'} gunzip-maybe@1.4.2: resolution: {integrity: sha512-4haO1M4mLO91PW57BMsDFf75UmwoRX0GkdD+Faw+Lr+r/OZrOCS0pIBwOL1xCKQqnQzbNFGgK2V2CpBUPeFNTw==} @@ -4955,9 +5824,9 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - hosted-git-info@8.1.0: - resolution: {integrity: sha512-Rw/B2DNQaPBICNXEm8balFz9a6WpZrkCGpcWFpy7nCj+NyhSdqXipmfvtmWt9xGfp0wZnBxB+iVpLmQMYt47Tw==} - engines: {node: ^18.17.0 || >=20.5.0} + hosted-git-info@9.0.2: + resolution: {integrity: sha512-M422h7o/BR3rmCQ8UHi7cyyMqKltdP9Uo+J2fXK+RSAY+wTcKOIRyhTuKv4qn+DJf3g+PL890AzId5KZpX+CBg==} + engines: {node: ^20.17.0 || >=22.9.0} hpack.js@2.1.6: resolution: {integrity: sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==} @@ -4979,8 +5848,8 @@ packages: resolution: {integrity: sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==} engines: {node: '>= 0.8'} - http-cache-semantics@4.1.1: - resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + http-cache-semantics@4.2.0: + resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==} http-deceiver@1.2.7: resolution: {integrity: sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==} @@ -4997,6 +5866,10 @@ packages: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} + engines: {node: '>= 0.8'} + http-parser-js@0.5.10: resolution: {integrity: sha512-Pysuw9XpUq5dVc/2SMHpuTY01RFl8fttgcyunjL7eEMhGM3cI4eOmiCycJDVCo/7O7ClfQD3SaI6ftDzqOXYMA==} @@ -5033,12 +5906,13 @@ packages: resolution: {integrity: sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==} engines: {node: '>=0.10'} - http-status-codes@2.2.0: - resolution: {integrity: sha512-feERVo9iWxvnejp3SEfm/+oNG517npqL2/PIA8ORjyOZjGC7TwCRQsZylciLS64i6pJ0wRYz3rkXLRwbtFa8Ng==} - http-status-codes@2.3.0: resolution: {integrity: sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==} + http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + https-proxy-agent@2.2.4: resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} engines: {node: '>= 4.5.0'} @@ -5072,23 +5946,34 @@ packages: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} + iconv-lite@0.7.1: + resolution: {integrity: sha512-2Tth85cXwGFHfvRgZWszZSvdo+0Xsqmw8k8ZwxScfcBneNUraK+dxRxRm24nszx80Y0TVio8kKLt5sLE7ZCLlw==} + engines: {node: '>=0.10.0'} + icss-utils@5.1.0: resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 + idb@7.1.1: + resolution: {integrity: sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==} + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore-walk@7.0.0: - resolution: {integrity: sha512-T4gbf83A4NH95zvhVYZc+qWocBBGlpzUXLPGurJggw/WIOwicfXJChLDP/iBZnN5WqROSu5Bm3hhle4z8a8YGQ==} - engines: {node: ^18.17.0 || >=20.5.0} + ignore-walk@8.0.0: + resolution: {integrity: sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A==} + engines: {node: ^20.17.0 || >=22.9.0} ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} + engines: {node: '>= 4'} + image-size@0.5.5: resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} engines: {node: '>=0.10.0'} @@ -5101,8 +5986,8 @@ packages: resolution: {integrity: sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==} engines: {node: '>=0.10.0'} - immutable@5.1.2: - resolution: {integrity: sha512-qHKXW1q6liAk1Oys6umoaZbDRqjcjgSrbnrifHsfsttza7zcvRAsL7mMV6xWcyhwQy7Xj5v4hhbr6b+iDYwlmQ==} + immutable@5.1.4: + resolution: {integrity: sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==} import-fresh@3.3.1: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} @@ -5129,12 +6014,12 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - ini@5.0.0: - resolution: {integrity: sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==} - engines: {node: ^18.17.0 || >=20.5.0} + ini@6.0.0: + resolution: {integrity: sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==} + engines: {node: ^20.17.0 || >=22.9.0} - injection-js@2.5.0: - resolution: {integrity: sha512-UpY2ONt4xbht4GhSqQ2zMJ1rBIQq4uOY+DlR6aOeYyqK7xadXt7UQbJIyxmgk288bPMkIZKjViieHm0O0i72Jw==} + injection-js@2.6.1: + resolution: {integrity: sha512-dbR5bdhi7TWDoCye9cByZqeg/gAfamm8Vu3G1KZOTYkOif8WkuM8CD0oeDPtZYMzT5YH76JAFB7bkmyY9OJi2A==} internal-ip@6.2.0: resolution: {integrity: sha512-D8WGsR6yDt8uq7vDMu7mjcR+yRMm3dW8yufyChmszWRjcSHuxLBkR3GdS2HZAjodsaGuCvXeEJpueisXJULghg==} @@ -5144,12 +6029,8 @@ packages: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} - interpret@1.4.0: - resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} - engines: {node: '>= 0.10'} - - ip-address@9.0.5: - resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + ip-address@10.1.0: + resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==} engines: {node: '>= 12'} ip-regex@4.3.0: @@ -5160,8 +6041,8 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} + ipaddr.js@2.3.0: + resolution: {integrity: sha512-Zv/pA+ciVFbCSBBjGfaKUya/CcGmUHzTydLMaTwrUUEM2DIEO3iZvueGxmacvmN50fGpGVKeTXpb2LcYQxeVdg==} engines: {node: '>= 10'} is-array-buffer@3.0.5: @@ -5228,16 +6109,12 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-fullwidth-code-point@5.0.0: - resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + is-fullwidth-code-point@5.1.0: + resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} engines: {node: '>=18'} - is-generator-function@1.1.0: - resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} + is-generator-function@1.1.2: + resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} engines: {node: '>= 0.4'} is-glob@4.0.3: @@ -5248,14 +6125,18 @@ packages: resolution: {integrity: sha512-rcfALRIb1YewtnksfRIHGcIY93QnK8BIQ/2c9yDYcG/Y6+vRoJuTWBmmSEbyLLYtXm7q35pHOHbZFQBaLrhlWQ==} engines: {node: '>=0.10.0'} + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} hasBin: true - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} is-ip@3.1.0: resolution: {integrity: sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==} @@ -5268,10 +6149,17 @@ packages: is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - is-network-error@1.1.0: - resolution: {integrity: sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==} + is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + + is-network-error@1.3.0: + resolution: {integrity: sha512-6oIwpsgRfnDiyEDLMay/GqCl3HoAtH5+RUKW29gYkL0QA+ipzpDLA16yQs7/RHCSu+BwgbJaOUqa4A99qNVQVw==} engines: {node: '>=16'} + is-node-process@1.2.0: + resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} + is-number-like@1.0.8: resolution: {integrity: sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==} @@ -5334,10 +6222,6 @@ packages: is-stream-ended@0.1.4: resolution: {integrity: sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==} - is-stream@1.1.0: - resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} - engines: {node: '>=0.10.0'} - is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -5357,9 +6241,9 @@ packages: is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} is-url@1.2.4: resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} @@ -5391,8 +6275,9 @@ packages: resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} engines: {node: '>=16'} - is@3.3.0: - resolution: {integrity: sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==} + is@3.3.2: + resolution: {integrity: sha512-a2xr4E3s1PjDS8ORcGgXpWx6V+liNs+O3JRD2mb9aeugD7rtkkZ0zgLdYgw0tWsKhsdiezGYptSiMlVazCBTuQ==} + engines: {node: '>= 0.4'} isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} @@ -5404,8 +6289,8 @@ packages: resolution: {integrity: sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==} engines: {node: '>= 8.0.0'} - isbinaryfile@5.0.4: - resolution: {integrity: sha512-YKBKVkKhty7s8rxddb40oOkuP0NbaeXrQvLin6QMHL7Ypiy2RW9LwOVrVgZRyOrhQlayMd9t+D8yDy8MKFTSDQ==} + isbinaryfile@5.0.7: + resolution: {integrity: sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==} engines: {node: '>= 18.0.0'} isexe@2.0.0: @@ -5442,21 +6327,30 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} + istanbul-lib-source-maps@5.0.6: + resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} + engines: {node: '>=10'} + + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} engines: {node: '>=8'} jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jake@10.9.4: + resolution: {integrity: sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==} + engines: {node: '>=10'} + hasBin: true + jasmine-core@2.8.0: resolution: {integrity: sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ==} jasmine-core@4.6.1: resolution: {integrity: sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==} - jasmine-core@5.7.1: - resolution: {integrity: sha512-QnurrtpKsPoixxG2R3d1xP0St/2kcX5oTZyDyQJMY+Vzi/HUlu1kGm+2V8Tz+9lV991leB1l0xcsyz40s9xOOw==} + jasmine-core@5.13.0: + resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} jasmine-reporters@2.5.2: resolution: {integrity: sha512-qdewRUuFOSiWhiyWZX8Yx3YNQ9JG51ntBEO4ekLQRpktxFTwUHy24a86zD/Oi2BRTKksEdfWQZcQFqzjqIkPig==} @@ -5468,8 +6362,8 @@ packages: resolution: {integrity: sha512-KbdGQTf5jbZgltoHs31XGiChAPumMSY64OZMWLNYnEnMfG5uwGBhffePwuskexjT+/Jea/gU3qAU8344hNohSw==} hasBin: true - jasmine@5.7.1: - resolution: {integrity: sha512-E/4fkRNy/9ALz6z3Z3/tYXFAohoznVy7In9FWutG2fqBSkILJHFzbgZtHJUw5UrL3jgUQ4sdGYOVZ5KpSXYjGw==} + jasmine@5.13.0: + resolution: {integrity: sha512-oLCXIhEb5e0zzjn9GyuvcuisvLBwUjmgz7a0RNGWKwQtJCDld4m+vwKUpAIJVLB5vbmQFdtKhT86/tIZlJ5gYw==} hasBin: true jasminewd2@2.2.0: @@ -5480,40 +6374,38 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} - jiti@1.21.7: - resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true - js-base64@3.7.7: - resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} + jose@6.1.3: + resolution: {integrity: sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==} + + js-base64@3.7.8: + resolution: {integrity: sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==} js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true jsbn@0.1.1: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} - jsbn@1.1.0: - resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - - jsdom@26.1.0: - resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==} - engines: {node: '>=18'} + jsdom@27.3.0: + resolution: {integrity: sha512-GtldT42B8+jefDUC4yUKAvsaOrH7PDHmZxZXNgF2xMmymjUbRYJvpAybZAKEmXDGTM0mCsz8duOa4vTm5AY2Kg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} peerDependencies: canvas: ^3.0.0 peerDependenciesMeta: canvas: optional: true - jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} - engines: {node: '>=6'} - hasBin: true - jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} @@ -5528,9 +6420,9 @@ packages: json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - json-parse-even-better-errors@4.0.0: - resolution: {integrity: sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==} - engines: {node: ^18.17.0 || >=20.5.0} + json-parse-even-better-errors@5.0.0: + resolution: {integrity: sha512-ZF1nxZ28VhQouRWhUcVlUIN3qwSgPuswK05s/HIaoetAoE/9tngVmCHjSxmSQPav1nd+lPtTL0YZ/2AFdR/iYQ==} + engines: {node: ^20.17.0 || >=22.9.0} json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -5538,6 +6430,9 @@ packages: json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + json-schema-typed@8.0.2: + resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} + json-schema@0.4.0: resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} @@ -5590,11 +6485,11 @@ packages: jwa@2.0.1: resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} - jws@3.2.2: - resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} + jws@3.2.3: + resolution: {integrity: sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==} - jws@4.0.0: - resolution: {integrity: sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==} + jws@4.0.1: + resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==} karma-chrome-launcher@3.2.0: resolution: {integrity: sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q==} @@ -5627,6 +6522,7 @@ packages: keygrip@1.1.0: resolution: {integrity: sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==} engines: {node: '>= 0.6'} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -5653,12 +6549,12 @@ packages: resolution: {integrity: sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==} engines: {node: '>= 7.6.0'} - koa@2.16.1: - resolution: {integrity: sha512-umfX9d3iuSxTQP4pnzLOz0HKnPg0FaUUIKcye2lOiz3KPu1Y3M3xlz76dISdFPQs37P9eJz1wUpcTS6KDPn9fA==} + koa@2.16.3: + resolution: {integrity: sha512-zPPuIt+ku1iCpFBRwseMcPYQ1cJL8l60rSmKeOuGfOXyE6YnTBmf2aEFNL2HQGrD0cPcLO/t+v9RTgC+fwEh/g==} engines: {node: ^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4} - launch-editor@2.10.0: - resolution: {integrity: sha512-D7dBRJo/qcGX9xlvt/6wUYzQxjh5G1RvZPgPv8vi4KRU99DVQL/oW7tnVOCCTm2HGeo3C5HvGE5Yrh6UBoZ0vA==} + launch-editor@2.12.0: + resolution: {integrity: sha512-giOHXoOtifjdHqUamwKq6c49GzBdLjvxrd2D+Q4V6uOHopJv7p9VJxikDsQ/CBXZbEITgUqSVHXLTG3VhPP1Dg==} less-loader@12.3.0: resolution: {integrity: sha512-0M6+uYulvYIWs52y0LqN4+QM9TqWAohYSNTo4htE8Z7Cn3G/qQMEmktfHmyJT23k+20kU9zHH2wrfFXkxNLtVw==} @@ -5673,8 +6569,8 @@ packages: webpack: optional: true - less@4.3.0: - resolution: {integrity: sha512-X9RyH9fvemArzfdP8Pi3irr7lor2Ok4rOttDXBhlwDg+wKQsXOXgHWduAJE1EsF7JJx0w0bcO6BC6tCKKYnXKA==} + less@4.4.2: + resolution: {integrity: sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==} engines: {node: '>=14'} hasBin: true @@ -5702,16 +6598,16 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - listr2@8.3.3: - resolution: {integrity: sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ==} - engines: {node: '>=18.0.0'} + listr2@9.0.5: + resolution: {integrity: sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==} + engines: {node: '>=20.0.0'} - lmdb@3.3.0: - resolution: {integrity: sha512-MgJocUI6QEiSXQBFWLeyo1R7eQj8Rke5dlPxX0KFwli8/bsCxpM/KbXO5y0qmV/5llQ3wpneDWcTYxa+4vn8iQ==} + lmdb@3.4.4: + resolution: {integrity: sha512-+Y2DqovevLkb6DrSQ6SXTYLEd6kvlRbhsxzgJrk7BUfOVA/mt21ak6pFDZDKxiAczHMWxrb02kXBTSTIA0O94A==} hasBin: true - loader-runner@4.3.0: - resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} + loader-runner@4.3.1: + resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} engines: {node: '>=6.11.5'} loader-utils@2.0.4: @@ -5772,9 +6668,9 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} log-update@4.0.0: resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} @@ -5791,16 +6687,21 @@ packages: long@5.3.2: resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==} - loupe@3.1.3: - resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} - lowdb@1.0.0: resolution: {integrity: sha512-2+x8esE/Wb9SQ1F9IHaYWfsC9FIecLOPrK4g17FGEayjUWH172H6nwicRovGvSE2CPZouc2MCIqCI7h9d+GftQ==} engines: {node: '>=4'} + lowercase-keys@2.0.0: + resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} + engines: {node: '>=8'} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.2.4: + resolution: {integrity: sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==} + engines: {node: 20 || >=22} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -5812,17 +6713,16 @@ packages: resolution: {integrity: sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==} engines: {node: '>=16.14'} - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + magicast@0.5.1: + resolution: {integrity: sha512-xrHS24IxaLrvuo613F719wvOIv9xPHFWQHuvGUBmPnCA/3MQxKI3b+r7n1jAoDHmsbC5bRhTZYR77invLAxVnw==} make-dir@2.1.0: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} engines: {node: '>=6'} - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -5830,9 +6730,9 @@ packages: make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - make-fetch-happen@14.0.3: - resolution: {integrity: sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==} - engines: {node: ^18.17.0 || >=20.5.0} + make-fetch-happen@15.0.3: + resolution: {integrity: sha512-iyyEpDty1mwW3dGlYXAJqC/azFn5PPvgKVwXayOGBSmKLxhKZ9fg4qIan2ePpp1vJIwfFiO34LAPZgq9SZW9Aw==} + engines: {node: ^20.17.0 || >=22.9.0} marky@1.3.0: resolution: {integrity: sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==} @@ -5841,6 +6741,9 @@ packages: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} + mdn-data@2.12.2: + resolution: {integrity: sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==} + media-typer@0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} @@ -5849,9 +6752,12 @@ packages: resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} engines: {node: '>= 0.8'} - memfs@4.17.1: - resolution: {integrity: sha512-thuTRd7F4m4dReCIy7vv4eNYnU6XI/tHMLSMMHLiortw/Y0QxqKtinG523U2aerzwYWGi606oBP4oMPy4+edag==} - engines: {node: '>= 4.0.0'} + memfs@4.51.1: + resolution: {integrity: sha512-Eyt3XrufitN2ZL9c/uIRMyDwXanLI88h/L3MoWqNY747ha3dMR9dWqp8cRT5ntjZ0U1TNuq4U91ZXK0sMBjYOQ==} + + meow@13.2.0: + resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} + engines: {node: '>=18'} merge-descriptors@1.0.3: resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} @@ -5887,9 +6793,9 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} - mime-types@3.0.1: - resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==} - engines: {node: '>= 0.6'} + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} mime@1.6.0: resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} @@ -5914,8 +6820,16 @@ packages: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} - mini-css-extract-plugin@2.9.2: - resolution: {integrity: sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==} + mimic-response@1.0.1: + resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} + engines: {node: '>=4'} + + mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + + mini-css-extract-plugin@2.9.4: + resolution: {integrity: sha512-ZWYT7ln73Hptxqxk2DxPU9MmapXRhxkJD6tkSR04dnQxm8BGu2hzgKLugK5yySD97u/8yy7Ma7E76k9ZdvtjkQ==} engines: {node: '>= 12.13.0'} peerDependencies: webpack: ^5.0.0 @@ -5923,9 +6837,17 @@ packages: minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + minimatch@10.1.1: + resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} + engines: {node: 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + minimatch@7.4.6: resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} engines: {node: '>=10'} @@ -5941,9 +6863,9 @@ packages: resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} engines: {node: '>=16 || 14 >=14.17'} - minipass-fetch@4.0.1: - resolution: {integrity: sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==} - engines: {node: ^18.17.0 || >=20.5.0} + minipass-fetch@5.0.0: + resolution: {integrity: sha512-fiCdUALipqgPWrOVTz9fw0XhcazULXOSU6ie40DDbX1F49p1dBrSRBuswndTx1x3vEb/g0FT7vC4c4C2u/mh3A==} + engines: {node: ^20.17.0 || >=22.9.0} minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} @@ -5961,20 +6883,12 @@ packages: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - minizlib@3.0.2: - resolution: {integrity: sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==} + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} engines: {node: '>= 18'} mitt@1.2.0: @@ -5995,11 +6909,6 @@ packages: engines: {node: '>=10'} hasBin: true - mkdirp@3.0.1: - resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} - engines: {node: '>=10'} - hasBin: true - mrmime@2.0.1: resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} engines: {node: '>=10'} @@ -6017,21 +6926,25 @@ packages: resolution: {integrity: sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==} hasBin: true - msgpackr@1.11.2: - resolution: {integrity: sha512-F9UngXRlPyWCDEASDpTf6c9uNhGPTqnTeLVt7bN+bU1eajoR/8V9ys2BRaV5C/e5ihE6sJ9uPIKaYt6bFuO32g==} + msgpackr@1.11.8: + resolution: {integrity: sha512-bC4UGzHhVvgDNS7kn9tV8fAucIYUBuGojcaLiz7v+P63Lmtm0Xeji8B/8tYKddALXxJLpwIeBmUN3u64C4YkRA==} multicast-dns@7.2.5: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + multimatch@7.0.0: + resolution: {integrity: sha512-SYU3HBAdF4psHEL/+jXDKHO95/m5P2RvboHT2Y0WtTttvJLP4H/2WS9WlQPFvF6C8d6SpLw8vjCnQOnVIVOSJQ==} + engines: {node: '>=18'} mute-stream@2.0.0: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} + mute-stream@3.0.0: + resolution: {integrity: sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==} + engines: {node: ^20.17.0 || >=22.9.0} + nanocolors@0.2.13: resolution: {integrity: sha512-0n3mSAQLPpGLV9ORXT5+C/D4mwew7Ebws69Hx4E2sgz2ZA5+32Q80B9tL8PbL7XHnRDiAxH/pnrUJ9a4fkTNTA==} @@ -6067,21 +6980,22 @@ packages: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} - ng-packagr@20.0.0-rc.0: - resolution: {integrity: sha512-XxyqxmF229CYlqqdw2G7WLp2BSacMr0swSiLM7qJBu0jPJFAMmGOfvxOMD542suCekYRaFzzQ+WRpSLftEjV5A==} - engines: {node: ^20.11.1 || >=22.11.0} + ng-packagr@21.1.0-next.0: + resolution: {integrity: sha512-DuNSGSiZVEOiMOWFjNENx04AEXuK6A6d1iOxYFYuAotYXLSnG1ghUSDN83c5lmdE1ISRXLvbnJEGRKu0vqBK7g==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} hasBin: true peerDependencies: - '@angular/compiler-cli': ^20.0.0 || ^20.0.0-next.0 + '@angular/compiler-cli': ^21.1.0-next || ^21.0.0 tailwindcss: ^2.0.0 || ^3.0.0 || ^4.0.0 tslib: ^2.3.0 - typescript: 5.8.3 + typescript: '>=5.9 <6.0' peerDependenciesMeta: tailwindcss: optional: true - nice-try@1.0.5: - resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + nock@14.0.10: + resolution: {integrity: sha512-Q7HjkpyPeLa0ZVZC5qpxBt5EyLczFJ91MEewQiIi9taWuA0KB/MDJlUWtON+7dGouVdADTQsf9RA7TZk6D8VMw==} + engines: {node: '>=18.20.0 <20 || >=20.12.1'} node-addon-api@6.1.0: resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} @@ -6094,8 +7008,8 @@ packages: engines: {node: '>=10.5.0'} deprecated: Use your platform's native DOMException instead - node-fetch-native@1.6.6: - resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==} + node-fetch-native@1.6.7: + resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} @@ -6119,149 +7033,74 @@ packages: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-forge@1.3.1: - resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} + node-forge@1.3.3: + resolution: {integrity: sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==} engines: {node: '>= 6.13.0'} node-gyp-build-optional-packages@5.2.2: resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==} hasBin: true - node-gyp@11.2.0: - resolution: {integrity: sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==} - engines: {node: ^18.17.0 || >=20.5.0} + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true - node-releases@2.0.19: - resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + node-gyp@12.1.0: + resolution: {integrity: sha512-W+RYA8jBnhSr2vrTtlPYPc1K+CSjGpVDRZxcqJcERZ8ND3A1ThWPHRwctTx3qC3oW99jt726jhdz3Y6ky87J4g==} + engines: {node: ^20.17.0 || >=22.9.0} + hasBin: true - nopt@8.1.0: - resolution: {integrity: sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==} - engines: {node: ^18.17.0 || >=20.5.0} + node-releases@2.0.27: + resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + + nopt@9.0.0: + resolution: {integrity: sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - normalize-range@0.1.2: - resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} - engines: {node: '>=0.10.0'} - - npm-bundled@4.0.0: - resolution: {integrity: sha512-IxaQZDMsqfQ2Lz37VvyyEtKLe8FsRZuysmedy/N06TU1RyVppYKXrO4xIhR0F+7ubIBox6Q7nir6fQI3ej39iA==} - engines: {node: ^18.17.0 || >=20.5.0} + normalize-url@6.1.0: + resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} + engines: {node: '>=10'} - npm-install-checks@7.1.1: - resolution: {integrity: sha512-u6DCwbow5ynAX5BdiHQ9qvexme4U3qHW3MWe5NqH+NeBm0LbiH6zvGjNNew1fY+AZZUtVHbOPF3j7mJxbUzpXg==} - engines: {node: ^18.17.0 || >=20.5.0} + npm-bundled@5.0.0: + resolution: {integrity: sha512-JLSpbzh6UUXIEoqPsYBvVNVmyrjVZ1fzEFbqxKkTJQkWBO3xFzFT+KDnSKQWwOQNbuWRwt5LSD6HOTLGIWzfrw==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-normalize-package-bin@4.0.0: - resolution: {integrity: sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==} - engines: {node: ^18.17.0 || >=20.5.0} + npm-install-checks@8.0.0: + resolution: {integrity: sha512-ScAUdMpyzkbpxoNekQ3tNRdFI8SJ86wgKZSQZdUxT+bj0wVFpsEMWnkXP0twVe1gJyNF5apBWDJhhIbgrIViRA==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-package-arg@12.0.2: - resolution: {integrity: sha512-f1NpFjNI9O4VbKMOlA5QoBq/vSQPORHcTZ2feJpFkTHJ9eQkdlmZEKSjcAhxTGInC7RlEyScT9ui67NaOsjFWA==} - engines: {node: ^18.17.0 || >=20.5.0} + npm-normalize-package-bin@5.0.0: + resolution: {integrity: sha512-CJi3OS4JLsNMmr2u07OJlhcrPxCeOeP/4xq67aWNai6TNWWbTrlNDgl8NcFKVlcBKp18GPj+EzbNIgrBfZhsag==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-packlist@9.0.0: - resolution: {integrity: sha512-8qSayfmHJQTx3nJWYbbUmflpyarbLMBc6LCAjYsiGtXxDB68HaZpb8re6zeaLGxZzDuMdhsg70jryJe+RrItVQ==} - engines: {node: ^18.17.0 || >=20.5.0} + npm-package-arg@13.0.2: + resolution: {integrity: sha512-IciCE3SY3uE84Ld8WZU23gAPPV9rIYod4F+rc+vJ7h7cwAJt9Vk6TVsK60ry7Uj3SRS3bqRRIGuTp9YVlk6WNA==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-pick-manifest@10.0.0: - resolution: {integrity: sha512-r4fFa4FqYY8xaM7fHecQ9Z2nE9hgNfJR+EmoKv0+chvzWkBcORX3r0FpTByP+CbOVJDladMXnPQGVN8PBLGuTQ==} - engines: {node: ^18.17.0 || >=20.5.0} + npm-packlist@10.0.3: + resolution: {integrity: sha512-zPukTwJMOu5X5uvm0fztwS5Zxyvmk38H/LfidkOMt3gbZVCyro2cD/ETzwzVPcWZA3JOyPznfUN/nkyFiyUbxg==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-registry-fetch@18.0.2: - resolution: {integrity: sha512-LeVMZBBVy+oQb5R6FDV9OlJCcWDU+al10oKpe+nsvcHnG24Z3uM3SvJYKfGJlfGjVU8v9liejCrUR/M5HO5NEQ==} - engines: {node: ^18.17.0 || >=20.5.0} + npm-pick-manifest@11.0.3: + resolution: {integrity: sha512-buzyCfeoGY/PxKqmBqn1IUJrZnUi1VVJTdSSRPGI60tJdUhUoSQFhs0zycJokDdOznQentgrpf8LayEHyyYlqQ==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-run-path@2.0.2: - resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} - engines: {node: '>=4'} + npm-registry-fetch@19.1.1: + resolution: {integrity: sha512-TakBap6OM1w0H73VZVDf44iFXsOS3h+L4wVMXmbWOQroZgFhMch0juN6XSzBNlD965yIKvWg2dfu7NSiaYLxtw==} + engines: {node: ^20.17.0 || >=22.9.0} npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} - npm@11.3.0: - resolution: {integrity: sha512-luthFIP0nFX3+nTfYbWI3p4hP4CiVnKOZ5jdxnF2x7B+Shz8feiSJCLLzgJUNxQ2cDdTaVUiH6RRsMT++vIMZg==} - engines: {node: ^20.17.0 || >=22.9.0} - hasBin: true - bundledDependencies: - - '@isaacs/string-locale-compare' - - '@npmcli/arborist' - - '@npmcli/config' - - '@npmcli/fs' - - '@npmcli/map-workspaces' - - '@npmcli/package-json' - - '@npmcli/promise-spawn' - - '@npmcli/redact' - - '@npmcli/run-script' - - '@sigstore/tuf' - - abbrev - - archy - - cacache - - chalk - - ci-info - - cli-columns - - fastest-levenshtein - - fs-minipass - - glob - - graceful-fs - - hosted-git-info - - ini - - init-package-json - - is-cidr - - json-parse-even-better-errors - - libnpmaccess - - libnpmdiff - - libnpmexec - - libnpmfund - - libnpmorg - - libnpmpack - - libnpmpublish - - libnpmsearch - - libnpmteam - - libnpmversion - - make-fetch-happen - - minimatch - - minipass - - minipass-pipeline - - ms - - node-gyp - - nopt - - normalize-package-data - - npm-audit-report - - npm-install-checks - - npm-package-arg - - npm-pick-manifest - - npm-profile - - npm-registry-fetch - - npm-user-validate - - p-map - - pacote - - parse-conflict-json - - proc-log - - qrcode-terminal - - read - - semver - - spdx-expression-parse - - ssri - - supports-color - - tar - - text-table - - tiny-relative-date - - treeverse - - validate-npm-package-name - - which - nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nwsapi@2.2.20: - resolution: {integrity: sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==} - oauth-sign@0.9.0: resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} @@ -6300,6 +7139,9 @@ packages: obuf@1.1.2: resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + obug@2.1.1: + resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} + on-exit-leak-free@2.1.2: resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} engines: {node: '>=14.0.0'} @@ -6312,8 +7154,8 @@ packages: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} - on-headers@1.0.2: - resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} + on-headers@1.1.0: + resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==} engines: {node: '>= 0.8'} once@1.4.0: @@ -6330,10 +7172,14 @@ packages: only@0.0.2: resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} - open@10.1.2: - resolution: {integrity: sha512-cxN6aIDPz6rm8hbebcP7vrQNhvRcveZoJU72Y7vskh4oIm+BZwBECnx5nTmrlres1Qapvx27Qo1Auukpf8PKXw==} + open@10.2.0: + resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==} engines: {node: '>=18'} + open@11.0.0: + resolution: {integrity: sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==} + engines: {node: '>=20'} + open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} @@ -6346,21 +7192,28 @@ packages: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} + ora@9.0.0: + resolution: {integrity: sha512-m0pg2zscbYgWbqRR6ABga5c3sZdEon7bSgjnlXC64kxtxLOyjRcbbUkLj7HFyy/FTD+P2xdBWu8snGhYI0jc4A==} + engines: {node: '>=20'} - ordered-binary@1.5.3: - resolution: {integrity: sha512-oGFr3T+pYdTGJ+YFEILMpS3es+GiIbs9h/XQrclBXUtd44ey7XwfsMzM31f64I1SQOawDoDr/D823kNCADI8TA==} + ordered-binary@1.6.0: + resolution: {integrity: sha512-IQh2aMfMIDbPjI/8a3Edr+PiOpcsB7yo8NdW7aHWVaoR/pcDldunMvnnwbk/auPGqmKeAdxtZl7MHX/QmPwhvQ==} os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + outvariant@1.4.3: + resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} + own-keys@1.0.1: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} + p-cancelable@2.1.1: + resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} + engines: {node: '>=8'} + p-event@4.2.0: resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==} engines: {node: '>=8'} @@ -6385,8 +7238,8 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - p-map@7.0.3: - resolution: {integrity: sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==} + p-map@7.0.4: + resolution: {integrity: sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==} engines: {node: '>=18'} p-queue@6.6.2: @@ -6416,9 +7269,9 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - pacote@20.0.0: - resolution: {integrity: sha512-pRjC5UFwZCgx9kUFDVM9YEahv4guZ1nSLqwmWiLUnDbGsjs+U5w7z6Uc8HNR1a6x8qnu5y9xtGE6D1uAuYz+0A==} - engines: {node: ^18.17.0 || >=20.5.0} + pacote@21.0.4: + resolution: {integrity: sha512-RplP/pDW0NNNDh3pnaoIWYPvNenS7UqMbXyvMqJczosiFWTeGGwJC2NQBLqKf4rGLFfwCOnntw1aEp9Jiqm1MA==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true pako@0.2.9: @@ -6439,17 +7292,17 @@ packages: resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} engines: {node: '>= 0.10'} - parse5-html-rewriting-stream@7.1.0: - resolution: {integrity: sha512-2ifK6Jb+ONoqOy5f+cYHsqvx1obHQdvIk13Jmt/5ezxP0U9p+fqd+R6O73KblGswyuzBYfetmsfK9ThMgnuPPg==} + parse5-html-rewriting-stream@8.0.0: + resolution: {integrity: sha512-wzh11mj8KKkno1pZEu+l2EVeWsuKDfR5KNWZOTsslfUX8lPDZx77m9T0kIoAVkFtD1nx6YF8oh4BnPHvxMtNMw==} - parse5-sax-parser@7.0.0: - resolution: {integrity: sha512-5A+v2SNsq8T6/mG3ahcz8ZtQ0OUFTatxPbeidoMB7tkJSGDY3tdfl4MHovtLQHkEn5CGxijNWRQHhRQ6IRpXKg==} + parse5-sax-parser@8.0.0: + resolution: {integrity: sha512-/dQ8UzHZwnrzs3EvDj6IkKrD/jIZyTlB+8XrHJvcjNgRdmWruNdN9i9RK/JtxakmlUdPwKubKPTCqvbTgzGhrw==} parse5@6.0.1: resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} - parse5@7.3.0: - resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} + parse5@8.0.0: + resolution: {integrity: sha512-9m4m5GSgXjL4AjumKzq1Fgfp3Z8rsvjRNbnkVwfu2ImRqE5D0LnY2QfDen18FSY9C573YU5XxSapdHZTZ2WolA==} parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} @@ -6466,10 +7319,6 @@ packages: path-is-inside@1.0.2: resolution: {integrity: sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==} - path-key@2.0.1: - resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} - engines: {node: '>=4'} - path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -6481,12 +7330,15 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.1: + resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} + engines: {node: 20 || >=22} + path-to-regexp@0.1.12: resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} - path-to-regexp@8.2.0: - resolution: {integrity: sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==} - engines: {node: '>=16'} + path-to-regexp@8.3.0: + resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -6498,10 +7350,6 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pathval@2.0.0: - resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} - engines: {node: '>= 14.16'} - peek-stream@1.1.3: resolution: {integrity: sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==} @@ -6518,8 +7366,8 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} pify@2.3.0: @@ -6551,35 +7399,28 @@ packages: pino-std-serializers@7.0.0: resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==} - pino@9.6.0: - resolution: {integrity: sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==} + pino@9.14.0: + resolution: {integrity: sha512-8OEwKp5juEvb/MjpIc4hjqfgCNysrS94RIOMXYvpYCdm/jglrKEiAYmiumbmGhCvs+IcInsphYDFwqrjr7398w==} hasBin: true - piscina@4.9.2: - resolution: {integrity: sha512-Fq0FERJWFEUpB4eSY59wSNwXD4RYqR+nR/WiEVcZW8IWfVBxJJafcgTEZDQo8k3w0sUarJ8RyVbbUF4GQ2LGbQ==} + piscina@5.1.4: + resolution: {integrity: sha512-7uU4ZnKeQq22t9AsmHGD2w4OYQGonwFnTypDypaWi7Qr2EvQIFVtG8J5D/3bE7W123Wdc9+v4CZDu5hJXVCtBg==} + engines: {node: '>=20.x'} - piscina@5.0.0: - resolution: {integrity: sha512-R+arufwL7sZvGjAhSMK3TfH55YdGOqhpKXkcwQJr432AAnJX/xxX19PA4QisrmJ+BTTfZVggaz6HexbkQq1l1Q==} - engines: {node: '>=18.x'} - - pkce-challenge@5.0.0: - resolution: {integrity: sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==} + pkce-challenge@5.0.1: + resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} engines: {node: '>=16.20.0'} - pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - - pkginfo@0.4.1: - resolution: {integrity: sha512-8xCNE/aT/EXKenuMDZ+xTVwkT8gsoHN2z/Q29l80u0ppGEXVvsKRzNMbtKhg8LS8k1tJLAHHylf6p4VFmP6XUQ==} - engines: {node: '>= 0.4.0'} + pkg-dir@8.0.0: + resolution: {integrity: sha512-4peoBq4Wks0riS0z8741NVv+/8IiTvqnZAr8QGgtdifrtpdXbNw/FxRS1l6NFqm4EMzuS0EDqNNx4XGaz8cuyQ==} + engines: {node: '>=18'} pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - portfinder@1.0.37: - resolution: {integrity: sha512-yuGIEjDAYnnOex9ddMnKZEMFE0CcGo6zbfzDklkmT1m5z734ss6JMzN9rNB3+RR7iS+F10D4/BVIaXOyh8PQKw==} + portfinder@1.0.38: + resolution: {integrity: sha512-rEwq/ZHlJIKw++XtLAO8PPuOQA/zaPJOZJ37BVuN97nLpMJeuDVLVGRwbFoBgLudgdTMP2hdRJP++H+8QOA3vg==} engines: {node: '>= 10.12'} portscanner@2.2.0: @@ -6590,8 +7431,8 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} - postcss-loader@8.1.1: - resolution: {integrity: sha512-0IeqyAsG6tYiDRCYKQJLAmgQr47DX6N7sFSWvQxt6AcupX8DIdmykuk/o/tx0Lze3ErGHJEp5OSRxrelC6+NdQ==} + postcss-loader@8.2.0: + resolution: {integrity: sha512-tHX+RkpsXVcc7st4dSdDGliI+r4aAQDuv+v3vFYHixb6YgjreG5AG4SEB0kDK8u2s6htqEEpKlkhSBUTvWKYnA==} engines: {node: '>= 18.12.0'} peerDependencies: '@rspack/core': 0.x || 1.x @@ -6630,29 +7471,33 @@ packages: peerDependencies: postcss: ^8.1.0 - postcss-selector-parser@7.1.0: - resolution: {integrity: sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==} + postcss-selector-parser@7.1.1: + resolution: {integrity: sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==} engines: {node: '>=4'} postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - postcss@8.5.3: - resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + powershell-utils@0.1.0: + resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} + engines: {node: '>=20'} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.5.3: - resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} + prettier@3.7.4: + resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==} engines: {node: '>=14'} hasBin: true - proc-log@5.0.0: - resolution: {integrity: sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==} - engines: {node: ^18.17.0 || >=20.5.0} + proc-log@6.1.0: + resolution: {integrity: sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==} + engines: {node: ^20.17.0 || >=22.9.0} process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -6660,8 +7505,8 @@ packages: process-warning@1.0.0: resolution: {integrity: sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==} - process-warning@4.0.1: - resolution: {integrity: sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==} + process-warning@5.0.0: + resolution: {integrity: sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==} process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} @@ -6675,12 +7520,16 @@ packages: resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} engines: {node: '>=10'} - proto3-json-serializer@2.0.2: - resolution: {integrity: sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==} - engines: {node: '>=14.0.0'} + propagate@2.0.1: + resolution: {integrity: sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==} + engines: {node: '>= 8'} - protobufjs@7.4.0: - resolution: {integrity: sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==} + proto3-json-serializer@3.0.4: + resolution: {integrity: sha512-E1sbAYg3aEbXrq0n1ojJkRHQJGE1kaE/O6GLA94y8rnJBfgvOPTOd1b9hOceQK1FFZI9qMh1vBERCyO2ifubcw==} + engines: {node: '>=18'} + + protobufjs@7.5.4: + resolution: {integrity: sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==} engines: {node: '>=12.0.0'} protractor@7.0.0: @@ -6709,8 +7558,8 @@ packages: pump@2.0.1: resolution: {integrity: sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==} - pump@3.0.2: - resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==} + pump@3.0.3: + resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==} pumpify@1.5.1: resolution: {integrity: sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==} @@ -6726,14 +7575,14 @@ packages: resolution: {integrity: sha512-MRtTAZfQTluz3U2oU/X2VqVWPcR1+94nbA2V6ZrSZRVEwLqZ8eclZ551qGFQD/vD2PYqHJwWOW/fpC721uznVw==} engines: {node: '>=14.1.0'} - puppeteer-core@24.8.1: - resolution: {integrity: sha512-UP/VIxVk/Akrgql3a55ZAIuAIx7+yQevz6qEXFUtSTIynEcgsCJ6tlRdi7uKAAlovmNQG4iNMzq9f8WxZLnGGg==} + puppeteer-core@24.34.0: + resolution: {integrity: sha512-24evawO+mUGW4mvS2a2ivwLdX3gk8zRLZr9HP+7+VT2vBQnm0oh9jJEZmUE3ePJhRkYlZ93i7OMpdcoi2qNCLg==} engines: {node: '>=18'} puppeteer@18.2.1: resolution: {integrity: sha512-7+UhmYa7wxPh2oMRwA++k8UGVDxh3YdWFB52r9C3tM81T6BU7cuusUSxImz0GEYSOYUKk/YzIhkQ6+vc0gHbxQ==} engines: {node: '>=14.1.0'} - deprecated: < 22.8.2 is no longer supported + deprecated: < 24.15.0 is no longer supported q@1.4.1: resolution: {integrity: sha512-/CdEdaw49VZVmyIDGUQKDDT53c7qBkO6g5CefWz91Ae+l4+cRtcDYwMTXh6me4O8TMldeGHG3N2Bl84V78Ywbg==} @@ -6765,8 +7614,12 @@ packages: quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} - quicktype-core@23.1.3: - resolution: {integrity: sha512-0wL9YYx6SvfI3sd7e+mr1Ha514CXnOKdNJgHSiccMqoHfGumrChmVkQhD81HQHztdLQq1k+HMmACzFgfDJJLAA==} + quick-lru@5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + + quicktype-core@23.2.6: + resolution: {integrity: sha512-asfeSv7BKBNVb9WiYhFRBvBZHcRutPRBwJMxW0pefluK4kkKu4lv0IvZBwFKvw2XygLcL1Rl90zxWDHYgkwCmA==} randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -6779,10 +7632,14 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} - raw-body@3.0.0: - resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==} + raw-body@2.5.3: + resolution: {integrity: sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==} engines: {node: '>= 0.8'} + raw-body@3.0.2: + resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} + engines: {node: '>= 0.10'} + readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} @@ -6806,14 +7663,14 @@ packages: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} + readdirp@5.0.0: + resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} + engines: {node: '>= 20.19.0'} + real-require@0.2.0: resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} engines: {node: '>= 12.13.0'} - rechoir@0.6.2: - resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} - engines: {node: '>= 0.10'} - reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} @@ -6821,8 +7678,8 @@ packages: resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} engines: {node: '>= 0.4'} - regenerate-unicode-properties@10.2.0: - resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} + regenerate-unicode-properties@10.2.2: + resolution: {integrity: sha512-m03P+zhBeQd1RGnYxrGyDAPpWX/epKirLrp8e3qevZdVkKtnCrjjWczIbYc8+xd6vcTStVlqfycTx1KR4LOr0g==} engines: {node: '>=4'} regenerate@1.4.2: @@ -6835,15 +7692,15 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} - regexpu-core@6.2.0: - resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} + regexpu-core@6.4.0: + resolution: {integrity: sha512-0ghuzq67LI9bLXpOX/ISfve/Mq33a4aFRzoQYhnnok1JOFpmE/A2TBGkNVenOGEeSBCjIiWcc6MVOG5HEQv0sA==} engines: {node: '>=4'} regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} - regjsparser@0.12.0: - resolution: {integrity: sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==} + regjsparser@0.13.0: + resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==} hasBin: true request@2.88.2: @@ -6865,6 +7722,9 @@ packages: requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + resolve-alpn@1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -6873,12 +7733,15 @@ packages: resolution: {integrity: sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==} engines: {node: '>= 0.8'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve-url-loader@5.0.0: resolution: {integrity: sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==} engines: {node: '>=12'} - resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + resolve@1.22.11: + resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} hasBin: true @@ -6886,6 +7749,9 @@ packages: resolution: {integrity: sha512-U1+0kWC/+4ncRFYqQWTx/3qkfE6a4B/h3XXgmXypfa0SPZ3t7cbbaFk297PjQS/yov24R18h6OZe6iZwj3NSLw==} engines: {node: '>= 0.8.0'} + responselike@2.0.1: + resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} @@ -6894,9 +7760,9 @@ packages: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} - retry-request@7.0.2: - resolution: {integrity: sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==} - engines: {node: '>=14'} + retry-request@8.0.2: + resolution: {integrity: sha512-JzFPAfklk1kjR1w76f0QOIhoDkNkSqW8wYKT08n9yysTmZfB+RQ2QoXoTAeOi1HD9ZipTyTAZg3c4pM/jeqgSw==} + engines: {node: '>=18'} retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} @@ -6923,19 +7789,28 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true - rollup-license-plugin@3.0.2: - resolution: {integrity: sha512-68LWDlUKxqLO4Si3Extca4X7P99tU7s0KLnVUzN6h6SDihGAWYMQ0q73XLnHbUmG0IFgvC0AzuYvbogceQ9Hcw==} + rimraf@5.0.10: + resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==} + hasBin: true + + rolldown@1.0.0-beta.54: + resolution: {integrity: sha512-3lIvjCWgjPL3gmiATUdV1NeVBGJZy6FdtwgLPol25tAkn46Q/MsVGfCSNswXwFOxGrxglPaN20IeALSIFuFyEg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + rollup-license-plugin@3.1.0: + resolution: {integrity: sha512-wt0sqnedDjYVUnalyDEajrVAiup2V3O30I5PzXDS3syN9liSRKrZ8H6EECiV3OEZRs2fLauwT9t0QZGLuVTs2Q==} engines: {node: '>=18.0.0'} - rollup-plugin-dts@6.2.1: - resolution: {integrity: sha512-sR3CxYUl7i2CHa0O7bA45mCrgADyAQ0tVtGSqi3yvH28M+eg1+g5d7kQ9hLvEz5dorK3XVsH5L2jwHLQf72DzA==} + rollup-plugin-dts@6.3.0: + resolution: {integrity: sha512-d0UrqxYd8KyZ6i3M2Nx7WOMy708qsV/7fTHMHxCMCBOAe3V/U7OMPu5GkX8hC+cmkHhzGnfeYongl1IgiooddA==} engines: {node: '>=16'} peerDependencies: rollup: ^3.29.4 || ^4 - typescript: 5.8.3 + typescript: ^4.5 || ^5.0 - rollup-plugin-sourcemaps2@0.5.1: - resolution: {integrity: sha512-y8yq66AM3gD2636cb6+mqGvrTnYJrCQt7lhzXxFShKxOA52PGtfsQdooOYtZWtXYc5bWsNXpD7CEs1m36CGZmw==} + rollup-plugin-sourcemaps2@0.5.4: + resolution: {integrity: sha512-XK6ITvEsKtUFN1GQbYKoqilwh1yKxTS9BLaFlVsm0IaYUYe3eVnhBWzKP4AHbkBO2BNOheGNlf407K7wCj6Rrw==} engines: {node: '>=18.0.0'} peerDependencies: '@types/node': '>=18.0.0' @@ -6944,8 +7819,8 @@ packages: '@types/node': optional: true - rollup@4.40.2: - resolution: {integrity: sha512-tfUOg6DTP4rhQ3VjOO6B4wyrJnGOX85requAXvqYTHsOgb2TFJdZ3aWpT8W2kPoypSGP7dZUyzxJ9ee4buM5Fg==} + rollup@4.53.5: + resolution: {integrity: sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -6953,11 +7828,8 @@ packages: resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} engines: {node: '>= 18'} - rrweb-cssom@0.8.0: - resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} - - run-applescript@7.0.0: - resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} engines: {node: '>=18'} run-parallel@1.2.0: @@ -6994,8 +7866,8 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sass-loader@16.0.5: - resolution: {integrity: sha512-oL+CMBXrj6BZ/zOq4os+UECPL+bWqt6OAC6DWS8Ln8GZRcMDjlJ4JC3FBDuHJdYaFWIdKNIBYmtZtK2MaMkNIw==} + sass-loader@16.0.6: + resolution: {integrity: sha512-sglGzId5gmlfxNs4gK2U3h7HlVRfx278YK6Ono5lwzuvi1jxig80YiuHkaDBVsYIKFhx8wN7XSCI0M2IDS/3qA==} engines: {node: '>= 18.12.0'} peerDependencies: '@rspack/core': 0.x || 1.x @@ -7015,23 +7887,23 @@ packages: webpack: optional: true - sass@1.87.0: - resolution: {integrity: sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==} + sass@1.97.0: + resolution: {integrity: sha512-KR0igP1z4avUJetEuIeOdDlwaUDvkH8wSx7FdSjyYBS3dpyX3TzHfAMO0G1Q4/3cdjcmi3r7idh+KCmKqS+KeQ==} engines: {node: '>=14.0.0'} hasBin: true saucelabs@1.5.0: resolution: {integrity: sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==} - sax@1.4.1: - resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} + sax@1.4.3: + resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==} saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - schema-utils@4.3.2: - resolution: {integrity: sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==} + schema-utils@4.3.3: + resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} select-hose@2.0.0: @@ -7053,13 +7925,13 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.3: - resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + semver@7.7.2: + resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} engines: {node: '>=10'} hasBin: true - semver@7.7.1: - resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} engines: {node: '>=10'} hasBin: true @@ -7067,12 +7939,12 @@ packages: resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} engines: {node: '>= 0.8.0'} - send@0.19.1: - resolution: {integrity: sha512-p4rRk4f23ynFEfcD9LA0xRYngj+IyGiEYyqqOak8kaN0TvNmuxC2dcVeBn62GpCeR2CpWqyHCNScTP91QbAVFg==} + send@0.19.2: + resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==} engines: {node: '>= 0.8.0'} - send@1.2.0: - resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==} + send@1.2.1: + resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} engines: {node: '>= 18'} serialize-javascript@6.0.2: @@ -7086,8 +7958,12 @@ packages: resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} engines: {node: '>= 0.8.0'} - serve-static@2.2.0: - resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==} + serve-static@1.16.3: + resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==} + engines: {node: '>= 0.8.0'} + + serve-static@2.2.1: + resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} server-destroy@1.0.1: @@ -7121,31 +7997,18 @@ packages: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} - shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} - shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shell-quote@1.8.2: - resolution: {integrity: sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==} + shell-quote@1.8.3: + resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==} engines: {node: '>= 0.4'} - shelljs@0.9.2: - resolution: {integrity: sha512-S3I64fEiKgTZzKCC46zT/Ib9meqofLrQVbpSswtjFfAVDW+AZ54WTnAM/3/yENoxz/V1Cy6u3kiiEbQ4DNphvw==} - engines: {node: '>=18'} - hasBin: true - side-channel-list@1.0.0: resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} engines: {node: '>= 0.4'} @@ -7172,9 +8035,9 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - sigstore@3.1.0: - resolution: {integrity: sha512-ZpzWAFHIFqyFE56dXqgX/DkDRZdz+rRcjoIk/RQU4IX0wiCv1l8S7ZrXDHcCc+uaf+6o7w3h2l3g6GYG5TKN9Q==} - engines: {node: ^18.17.0 || >=20.5.0} + sigstore@4.1.0: + resolution: {integrity: sha512-/fUgUhYghuLzVT/gaJoeVehLCgZiUxPCPMcyVNY0lIf/cTCz58K/WTI7PefDarXxp9nUKpEwg1yyz3eSBMTtgA==} + engines: {node: ^20.17.0 || >=22.9.0} slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} @@ -7184,12 +8047,8 @@ packages: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - slice-ansi@7.1.0: - resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + slice-ansi@7.1.2: + resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} engines: {node: '>=18'} smart-buffer@4.2.0: @@ -7218,8 +8077,8 @@ packages: resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==} engines: {node: '>= 14'} - socks@2.8.4: - resolution: {integrity: sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==} + socks@2.8.7: + resolution: {integrity: sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} sonic-boom@3.8.1: @@ -7252,9 +8111,9 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - source-map@0.7.4: - resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} - engines: {node: '>= 8'} + source-map@0.7.6: + resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} + engines: {node: '>= 12'} spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} @@ -7268,8 +8127,8 @@ packages: spdx-expression-validate@2.0.0: resolution: {integrity: sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==} - spdx-license-ids@3.0.21: - resolution: {integrity: sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==} + spdx-license-ids@3.0.22: + resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} spdy-transport@3.0.0: resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} @@ -7288,17 +8147,18 @@ packages: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} - sprintf-js@1.1.3: - resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} - sshpk@1.18.0: resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} engines: {node: '>=0.10.0'} hasBin: true - ssri@12.0.0: - resolution: {integrity: sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==} - engines: {node: ^18.17.0 || >=20.5.0} + ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + + ssri@13.0.0: + resolution: {integrity: sha512-yizwGBpbCn4YomB2lzhZqrHLJoqFGXihNbib3ozhqF/cIp5ue+xSmOQrjNasEE62hFxsCcg/V/z23t4n8jMEng==} + engines: {node: ^20.17.0 || >=22.9.0} stack-trace@0.0.10: resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} @@ -7318,12 +8178,24 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} - std-env@3.9.0: - resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + + stdin-discarder@0.2.2: + resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} + engines: {node: '>=18'} steno@0.4.4: resolution: {integrity: sha512-EEHMVYHNXFHfGtgjNITnka0aHhiAlo93F7z2/Pwd+g0teG9CnM3JIINM7hVVB5/rhw9voufD7Wukwgtw2uqh6w==} + stop-iteration-iterator@1.1.0: + resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} + engines: {node: '>= 0.4'} + stream-events@1.0.5: resolution: {integrity: sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==} @@ -7339,8 +8211,11 @@ packages: resolution: {integrity: sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==} engines: {node: '>=8.0'} - streamx@2.22.0: - resolution: {integrity: sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==} + streamx@2.23.0: + resolution: {integrity: sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==} + + strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -7354,6 +8229,10 @@ packages: resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} engines: {node: '>=18'} + string-width@8.1.0: + resolution: {integrity: sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==} + engines: {node: '>=20'} + string.prototype.trim@1.2.10: resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} @@ -7380,18 +8259,14 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + strip-ansi@7.1.2: + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - strip-eof@1.0.0: - resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} - engines: {node: '>=0.10.0'} - strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} @@ -7403,8 +8278,8 @@ packages: stubs@3.0.0: resolution: {integrity: sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==} - supports-color@10.0.0: - resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==} + supports-color@10.2.2: + resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==} engines: {node: '>=18'} supports-color@2.0.0: @@ -7430,15 +8305,15 @@ packages: resolution: {integrity: sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==} engines: {node: '>=12.17'} - tapable@2.2.1: - resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + tapable@2.3.0: + resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} tar-fs@2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} - tar-fs@3.0.8: - resolution: {integrity: sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg==} + tar-fs@3.1.1: + resolution: {integrity: sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==} tar-stream@2.2.0: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} @@ -7447,20 +8322,16 @@ packages: tar-stream@3.1.7: resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - tar@7.4.3: - resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==} + tar@7.5.2: + resolution: {integrity: sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg==} engines: {node: '>=18'} - teeny-request@9.0.0: - resolution: {integrity: sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==} - engines: {node: '>=14'} + teeny-request@10.1.0: + resolution: {integrity: sha512-3ZnLvgWF29jikg1sAQ1g0o+lr5JX6sVgYvfUJazn7ZjJroDBUTWp44/+cFVX0bULjv4vci+rBD+oGVAkWqhUbw==} + engines: {node: '>=18'} - terser-webpack-plugin@5.3.14: - resolution: {integrity: sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==} + terser-webpack-plugin@5.3.16: + resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} engines: {node: '>= 10.13.0'} peerDependencies: '@swc/core': '*' @@ -7475,16 +8346,16 @@ packages: uglify-js: optional: true - terser@5.39.0: - resolution: {integrity: sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==} + terser@5.44.1: + resolution: {integrity: sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==} engines: {node: '>=10'} hasBin: true text-decoder@1.2.3: resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==} - thingies@1.21.0: - resolution: {integrity: sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==} + thingies@2.5.0: + resolution: {integrity: sha512-s+2Bwztg6PhWUD7XMfeYm5qliDdSiZm7M7n8KjTkIsm3l/2lgVRc2/Gx/v+ZX8lT4FMA+i8aQvhcWylldc+ZNw==} engines: {node: '>=10.18'} peerDependencies: tslib: ^2 @@ -7510,48 +8381,48 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.2: - resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyexec@1.0.2: + resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} + engines: {node: '>=18'} - tinyglobby@0.2.13: - resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} - tinypool@1.0.2: - resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} - engines: {node: ^18.0.0 || >=20.0.0} - - tinyrainbow@2.0.0: - resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} - engines: {node: '>=14.0.0'} - - tinyspy@3.0.2: - resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} + tinyrainbow@3.0.3: + resolution: {integrity: sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==} engines: {node: '>=14.0.0'} tldts-core@6.1.86: resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} + tldts-core@7.0.19: + resolution: {integrity: sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A==} + tldts@6.1.86: resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} hasBin: true + tldts@7.0.19: + resolution: {integrity: sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA==} + hasBin: true + tmp@0.0.30: resolution: {integrity: sha512-HXdTB7lvMwcb55XFfrTM8CPr/IYREk4hVBFaQ4b/6nInrluSL86hfHm7vu0luYKCfyBZp2trCjpc8caC3vVM3w==} engines: {node: '>=0.4.0'} - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - tmp@0.2.3: - resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} + tmp@0.2.5: + resolution: {integrity: sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==} engines: {node: '>=14.14'} to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + toad-cache@3.7.0: + resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} + engines: {node: '>=12'} + toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -7564,6 +8435,10 @@ packages: resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} engines: {node: '>=16'} + tough-cookie@6.0.0: + resolution: {integrity: sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==} + engines: {node: '>=16'} + tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -7571,8 +8446,12 @@ packages: resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} engines: {node: '>=18'} - tree-dump@1.0.2: - resolution: {integrity: sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==} + tr46@6.0.0: + resolution: {integrity: sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==} + engines: {node: '>=20'} + + tree-dump@1.1.0: + resolution: {integrity: sha512-rMuvhU4MCDbcbnleZTFezWsaZXRFemSqAM+7jPnzUl1fo9w3YEKOxAeui0fz3OI4EU4hf23iyA7uQRVko+UaBA==} engines: {node: '>=10.0'} peerDependencies: tslib: '2' @@ -7585,7 +8464,7 @@ packages: resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} engines: {node: '>=18.12'} peerDependencies: - typescript: 5.8.3 + typescript: '>=4.8.4' ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} @@ -7594,7 +8473,7 @@ packages: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' '@types/node': '*' - typescript: 5.8.3 + typescript: '>=2.7' peerDependenciesMeta: '@swc/core': optional: true @@ -7611,13 +8490,22 @@ packages: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} - tuf-js@3.0.1: - resolution: {integrity: sha512-+68OP1ZzSF84rTckf3FA95vJ1Zlx/uaXyiiKyPd1pA4rZNkpEvDAKmsu1xUSmbF/chCRYgZ6UZkDwC7PmzmAyA==} - engines: {node: ^18.17.0 || >=20.5.0} + tsx@4.21.0: + resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==} + engines: {node: '>=18.0.0'} + hasBin: true + + tuf-js@4.1.0: + resolution: {integrity: sha512-50QV99kCKH5P/Vs4E2Gzp7BopNV+KzTXqWeaxrfu5IQJBOULRsTIS9seSsOVT8ZnGXzCyx55nYWAi4qJzpZKEQ==} + engines: {node: ^20.17.0 || >=22.9.0} tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + tunnel@0.0.6: + resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} + engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} + tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} @@ -7665,8 +8553,8 @@ packages: typed-query-selector@2.12.0: resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==} - typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} hasBin: true @@ -7678,12 +8566,12 @@ packages: resolution: {integrity: sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==} engines: {node: '>=12.17'} - ua-parser-js@0.7.40: - resolution: {integrity: sha512-us1E3K+3jJppDBa3Tl0L3MOJiGhe1C6P0+nIvQAFYbxlMAx0h81eOwLmU57xgqToduDDPx3y5QsdjPfDu+FgOQ==} + ua-parser-js@0.7.41: + resolution: {integrity: sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==} hasBin: true - ua-parser-js@1.0.40: - resolution: {integrity: sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==} + ua-parser-js@1.0.41: + resolution: {integrity: sha512-LbBDqdIC5s8iROCUjMbW1f5dJQTEFB1+KO9ogbvlb3nm9n4YHa5p4KTvFPWvh2Hs8gZMBuiB1/8+pdfe/tDPug==} hasBin: true uglify-js@3.19.3: @@ -7698,11 +8586,15 @@ packages: unbzip2-stream@1.4.3: resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + + undici@5.29.0: + resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} + engines: {node: '>=14.0'} - undici@7.8.0: - resolution: {integrity: sha512-vFv1GA99b7eKO1HG/4RPu2Is3FBTWBrmzqzO0mz+rLxN3yXkE4mqRcb8g8fHxzX4blEysrNZLqg5RbJLqX5buA==} + undici@7.16.0: + resolution: {integrity: sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==} engines: {node: '>=20.18.1'} unenv@1.10.0: @@ -7716,30 +8608,33 @@ packages: resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==} engines: {node: '>=4'} - unicode-match-property-value-ecmascript@2.2.0: - resolution: {integrity: sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==} + unicode-match-property-value-ecmascript@2.2.1: + resolution: {integrity: sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==} engines: {node: '>=4'} unicode-properties@1.4.1: resolution: {integrity: sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==} - unicode-property-aliases-ecmascript@2.1.0: - resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==} + unicode-property-aliases-ecmascript@2.2.0: + resolution: {integrity: sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==} engines: {node: '>=4'} unicode-trie@2.0.0: resolution: {integrity: sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==} - unique-filename@4.0.0: - resolution: {integrity: sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==} - engines: {node: ^18.17.0 || >=20.5.0} + unique-filename@5.0.0: + resolution: {integrity: sha512-2RaJTAvAb4owyjllTfXzFClJ7WsGxlykkPvCr9pA//LD9goVq+m4PPAeBgNodGZ7nSrntT/auWpJ6Y5IFXcfjg==} + engines: {node: ^20.17.0 || >=22.9.0} - unique-slug@5.0.0: - resolution: {integrity: sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==} - engines: {node: ^18.17.0 || >=20.5.0} + unique-slug@6.0.0: + resolution: {integrity: sha512-4Lup7Ezn8W3d52/xBhZBVdx323ckxa7DEvd9kPQHppTkLoJXw6ltrBCyj5pnrxj0qKDxYMJ56CoxNuFCscdTiw==} + engines: {node: ^20.17.0 || >=22.9.0} - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} + universal-github-app-jwt@2.2.2: + resolution: {integrity: sha512-dcmbeSrOdTnsjGjUfAlqNDJrhxXizjAz94ija9Qw8YkZ1uu0d+GoZzyH+Jb9tIIqvGsadUfwg+22k5aDqqwzbw==} + + universal-user-agent@7.0.3: + resolution: {integrity: sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==} universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} @@ -7752,8 +8647,8 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - update-browserslist-db@1.1.3: - resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -7764,6 +8659,10 @@ packages: urijs@1.19.11: resolution: {integrity: sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==} + utf-8-validate@6.0.5: + resolution: {integrity: sha512-EYZR+OpIXp9Y1eG1iueg8KRsY8TuT8VNgnanZ0uA3STqhHQTLwbl+WX76/9X5OY12yQubymBpaBSmMPkSTQcKA==} + engines: {node: '>=6.14.2'} + util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -7780,10 +8679,6 @@ packages: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true - uuid@9.0.1: - resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} - hasBin: true - v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -7794,32 +8689,32 @@ packages: validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - validate-npm-package-name@6.0.0: - resolution: {integrity: sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==} - engines: {node: ^18.17.0 || >=20.5.0} + validate-npm-package-name@7.0.1: + resolution: {integrity: sha512-BM0Upcemlce8/9+HE+/VpWqn3u3mYh6Om/FEC8yPMnEHwf710fW5Q6fhjT1SQyRlZD1G9CJbgfH+rWgAcIvjlQ==} + engines: {node: ^20.17.0 || >=22.9.0} - validator@13.12.0: - resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} + validator@13.15.23: + resolution: {integrity: sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==} engines: {node: '>= 0.10'} vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - verdaccio-audit@13.0.0-next-8.15: - resolution: {integrity: sha512-Aeau0u0fi5l4PoSDyOV6glz2FDO9+ofvogJIELV4H6fhDXhgPc2MnoKuaUgOT//khESLle/a6YfcLY2/KNLs6g==} + verdaccio-audit@13.0.0-next-8.28: + resolution: {integrity: sha512-vcl+V4R43QFSrch0QggG92hEd+aGh7fGBqkA1pcF/m4eJ2JQw7+/8JD5VJ/qCnt7Udnz9Jmey6SvgFgxsB6ODA==} engines: {node: '>=18'} - verdaccio-auth-memory@10.2.2: - resolution: {integrity: sha512-JCAnSqwq2l1UPt0hQcPn1B3X9mYpJ5zMsDvuDdmnlWLkrIDx2Wev5fluW0HC9hcFMITFl/DJj/DyzYOOqwhFSQ==} - engines: {node: '>=8'} + verdaccio-auth-memory@10.3.1: + resolution: {integrity: sha512-3m4VH5lD3qdRkDvcvVzHP6YftcsRXgu3WZuspcrH0/76+ugI2wkVezgBDbu4WRwJqRvG0MEf8Zxoup9zVK5SVw==} + engines: {node: '>=18'} - verdaccio-htpasswd@13.0.0-next-8.15: - resolution: {integrity: sha512-rQg5oZ/rReDAM4g4W68hvtzReTbM6vduvVtobHsQxhbtbotEuUjP6O8uaROYtgZ60giGva5Tub2SOm2T9Ln9Dw==} + verdaccio-htpasswd@13.0.0-next-8.28: + resolution: {integrity: sha512-iAkhusaNUEvBeq+7Xn8YUqq4hXoVuAteZPrG4dwsqSjVliS7YQGdysQKYG89QnN9iMKAEvuSzhb+GP0c5dbL0g==} engines: {node: '>=18'} - verdaccio@6.1.2: - resolution: {integrity: sha512-HQCquycSQkA+tKRVqMjIVRzmhzTciLfScvKIhhiwZZ9Qd13e2KJQTOdB7QrSacfJuPpl94TA5EZ7XmVRQKk3ag==} + verdaccio@6.2.4: + resolution: {integrity: sha512-1riItDS5ZmkLVclEOI4ibmJPCTfg1f8iEbdZWo7mgaEDHs1KS2JJnGq+dnoDlbo4efJ5mCyy1g7p32k/xx2+wg==} engines: {node: '>=18'} hasBin: true @@ -7827,24 +8722,19 @@ packages: resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} - vite-node@3.1.3: - resolution: {integrity: sha512-uHV4plJ2IxCl4u1up1FQRrqclylKAogbtBfOTwcuJ28xFi+89PZ57BRh+naIRvH70HPwxy5QHYzg1OrEaC7AbA==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - - vite@6.3.5: - resolution: {integrity: sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + vite@7.3.0: + resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==} + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@types/node': ^20.19.0 || >=22.12.0 jiti: '>=1.21.0' - less: '*' + less: ^4.0.0 lightningcss: ^1.21.0 - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 terser: ^5.16.0 tsx: ^4.8.1 yaml: ^2.4.2 @@ -7872,26 +8762,32 @@ packages: yaml: optional: true - vitest@3.1.3: - resolution: {integrity: sha512-188iM4hAHQ0km23TN/adso1q5hhwKqUpv+Sd6p5sOuh6FhQnRNW3IsiIpvxqahtBabsJ2SLZgmGSpcYK4wQYJw==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + vitest@4.0.15: + resolution: {integrity: sha512-n1RxDp8UJm6N0IbJLQo+yzLZ2sQCDyl1o0LeugbPWf8+8Fttp29GghsQBjYJVmWq3gBFfe9Hs1spR44vovn2wA==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@types/debug': ^4.1.12 - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.1.3 - '@vitest/ui': 3.1.3 + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.0.15 + '@vitest/browser-preview': 4.0.15 + '@vitest/browser-webdriverio': 4.0.15 + '@vitest/ui': 4.0.15 happy-dom: '*' jsdom: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true - '@types/debug': + '@opentelemetry/api': optional: true '@types/node': optional: true - '@vitest/browser': + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': optional: true '@vitest/ui': optional: true @@ -7908,26 +8804,26 @@ packages: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} - watchpack@2.4.2: - resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==} + watchpack@2.4.4: + resolution: {integrity: sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==} engines: {node: '>=10.13.0'} wbuf@1.7.3: resolution: {integrity: sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==} - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - weak-lru-cache@1.2.2: resolution: {integrity: sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==} - web-features@2.34.2: - resolution: {integrity: sha512-OhPNkoNZYxfykP82LwJmpAXZHiO6eojkj9ZgDKB/u16i1rtoSZSzdgXjjTZI/gtTpZo5nuZNyDAZcNESJNylDg==} - web-streams-polyfill@3.3.3: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} + web-vitals@4.2.4: + resolution: {integrity: sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==} + + webdriver-bidi-protocol@0.3.10: + resolution: {integrity: sha512-5LAE43jAVLOhB/QqX4bwSiv0Hg1HBfMmOuwBSXHdvg4GMGu9Y0lIq7p4R/yySu6w74WmaR4GM4H9t2IwLW7hgw==} + webdriver-js-extender@2.1.0: resolution: {integrity: sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ==} engines: {node: '>=6.9.x'} @@ -7944,8 +8840,12 @@ packages: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} - webpack-dev-middleware@7.4.2: - resolution: {integrity: sha512-xOO8n6eggxnwYpy1NlzUKpvrjfJTvae5/D6WOK0S2LSo7vjmo5gCM1DbLUmFqrMTJP+W/0YZNctm7jasWvLuBA==} + webidl-conversions@8.0.0: + resolution: {integrity: sha512-n4W4YFyz5JzOfQeA8oN7dUYpR+MBP3PIUsn2jLjWXwK5ASUzt0Jc/A5sAUZoCYFJRGF0FBKJ+1JjN43rNdsQzA==} + engines: {node: '>=20'} + + webpack-dev-middleware@7.4.5: + resolution: {integrity: sha512-uxQ6YqGdE4hgDKNf7hUiPXOdtkXvBJXrfEGYSx7P7LC8hnUYGK70X6xQXUvXeNyBDDcsiQXpG2m3G9vxowaEuA==} engines: {node: '>= 18.12.0'} peerDependencies: webpack: ^5.0.0 @@ -7953,8 +8853,8 @@ packages: webpack: optional: true - webpack-dev-server@5.2.1: - resolution: {integrity: sha512-ml/0HIj9NLpVKOMq+SuBPLHcmbG+TGIjXRHsYfZwocUBIqEvws8NnS/V9AFQ5FKP+tgn5adwVwRrTEpGL33QFQ==} + webpack-dev-server@5.2.2: + resolution: {integrity: sha512-QcQ72gh8a+7JO63TAx/6XZf/CWhgMzu5m0QirvPfGvptOusAxG12w2+aua1Jkjr7hzaWDnJ2n6JFeexMHI+Zjg==} engines: {node: '>= 18.12.0'} hasBin: true peerDependencies: @@ -7970,8 +8870,8 @@ packages: resolution: {integrity: sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==} engines: {node: '>=18.0.0'} - webpack-sources@3.2.3: - resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} + webpack-sources@3.3.3: + resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} engines: {node: '>=10.13.0'} webpack-subresource-integrity@5.1.0: @@ -7984,8 +8884,8 @@ packages: html-webpack-plugin: optional: true - webpack@5.99.8: - resolution: {integrity: sha512-lQ3CPiSTpfOnrEGeXDwoq5hIGzSjmwD72GdfVzF7CQAI7t47rJG9eDWvcEkEn3CUQymAElVvDg3YNTlCYj+qUQ==} + webpack@5.104.0: + resolution: {integrity: sha512-5DeICTX8BVgNp6afSPYXAFjskIgWGlygQH58bcozPOXgo2r/6xx39Y1+cULZ3gTxUYQP88jmwLj2anu4Xaq84g==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -8014,6 +8914,10 @@ packages: resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} engines: {node: '>=18'} + whatwg-url@15.1.0: + resolution: {integrity: sha512-2ytDk0kiEj/yu90JOAp44PVPUkO9+jVhyf+SybKlRHSDlvOOZhdPIrr7xTH64l4WixO2cP+wQIcgujkGBPPz6g==} + engines: {node: '>=20'} + whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -8045,9 +8949,9 @@ packages: engines: {node: '>= 8'} hasBin: true - which@5.0.0: - resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==} - engines: {node: ^18.17.0 || >=20.5.0} + which@6.0.0: + resolution: {integrity: sha512-f+gEpIKMR9faW/JgAgPK1D7mekkFoqbmiwvNzuhsHetni20QSgzg9Vhn0g2JSJkkfehQnqdUAx7/e15qS1lPxg==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true why-is-node-running@2.3.0: @@ -8065,8 +8969,8 @@ packages: wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - wordwrapjs@5.1.0: - resolution: {integrity: sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==} + wordwrapjs@5.1.1: + resolution: {integrity: sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==} engines: {node: '>=12.17'} wrap-ansi@6.2.0: @@ -8081,8 +8985,8 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.0: - resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + wrap-ansi@9.0.2: + resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} engines: {node: '>=18'} wrappy@1.0.2: @@ -8112,8 +9016,8 @@ packages: utf-8-validate: optional: true - ws@8.18.2: - resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} + ws@8.18.3: + resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -8136,6 +9040,14 @@ packages: utf-8-validate: optional: true + wsl-utils@0.1.0: + resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==} + engines: {node: '>=18'} + + wsl-utils@0.3.0: + resolution: {integrity: sha512-3sFIGLiaDP7rTO4xh3g+b3AzhYDIUGGywE/WsmqzJWDxus5aJXVnPTNC/6L+r2WzrwXqVOdD262OaO+cEyPMSQ==} + engines: {node: '>=20'} + xhr2@0.2.1: resolution: {integrity: sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==} engines: {node: '>= 6'} @@ -8180,9 +9092,9 @@ packages: resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} engines: {node: '>=18'} - yaml@2.7.1: - resolution: {integrity: sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==} - engines: {node: '>= 14'} + yaml@2.8.2: + resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} + engines: {node: '>= 14.6'} hasBin: true yargs-parser@18.1.3: @@ -8197,6 +9109,10 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs-parser@22.0.0: + resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} @@ -8209,6 +9125,10 @@ packages: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yargs@18.0.0: + resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} @@ -8224,874 +9144,1038 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} + yoctocolors-cjs@2.1.3: + resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==} + engines: {node: '>=18'} + + yoctocolors@2.1.2: + resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} engines: {node: '>=18'} - zod-to-json-schema@3.24.5: - resolution: {integrity: sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==} + zod-to-json-schema@3.25.0: + resolution: {integrity: sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ==} peerDependencies: - zod: ^3.24.1 + zod: ^3.25 || ^4 + + zod@3.25.76: + resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} - zod@3.24.4: - resolution: {integrity: sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==} + zod@4.2.1: + resolution: {integrity: sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==} - zone.js@0.15.0: - resolution: {integrity: sha512-9oxn0IIjbCZkJ67L+LkhYWRyAy7axphb3VgE2MBDlOqnmHMPWGYMxJxBYFueFq/JGY2GMwS0rU+UCLunEmy5UA==} + zone.js@0.16.0: + resolution: {integrity: sha512-LqLPpIQANebrlxY6jKcYKdgN5DTXyyHAKnnWWjE5pPfEQ4n7j5zn7mOEEpwNZVKGqx3kKKmvplEmoBrvpgROTA==} snapshots: + '@acemir/cssom@0.9.29': {} + + '@actions/core@2.0.1': + dependencies: + '@actions/exec': 2.0.0 + '@actions/http-client': 3.0.0 + + '@actions/exec@2.0.0': + dependencies: + '@actions/io': 2.0.0 + + '@actions/http-client@3.0.0': + dependencies: + tunnel: 0.0.6 + undici: 5.29.0 + + '@actions/io@2.0.0': {} + + '@algolia/abtesting@1.12.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/client-abtesting@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/client-analytics@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/client-common@5.46.0': {} + + '@algolia/client-insights@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/client-personalization@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/client-query-suggestions@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/client-search@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/ingestion@1.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/monitoring@1.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/recommend@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + + '@algolia/requester-browser-xhr@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + + '@algolia/requester-fetch@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + + '@algolia/requester-node-http@5.46.0': + dependencies: + '@algolia/client-common': 5.46.0 + '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.8 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 - '@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))': + '@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))': dependencies: - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) tslib: 2.8.1 - '@angular/cdk@20.0.0-next.10(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2)': + '@angular/cdk@21.1.0-next.3(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2)': dependencies: - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) - parse5: 7.3.0 + '@angular/common': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) + '@angular/platform-browser': 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) + parse5: 8.0.0 rxjs: 7.8.2 tslib: 2.8.1 - '@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2)': + '@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2)': dependencies: - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) rxjs: 7.8.2 tslib: 2.8.1 - '@angular/compiler-cli@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3)': + '@angular/compiler-cli@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3)': dependencies: - '@angular/compiler': 20.0.0-next.9 - '@babel/core': 7.26.10 - '@jridgewell/sourcemap-codec': 1.5.0 - chokidar: 4.0.3 + '@angular/compiler': 21.1.0-next.4 + '@babel/core': 7.28.5 + '@jridgewell/sourcemap-codec': 1.5.5 + chokidar: 5.0.0 convert-source-map: 1.9.0 reflect-metadata: 0.2.2 - semver: 7.7.1 + semver: 7.7.3 tslib: 2.8.1 - typescript: 5.8.3 - yargs: 17.7.2 + yargs: 18.0.0 + optionalDependencies: + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@angular/compiler@20.0.0-next.9': + '@angular/compiler@21.1.0-next.4': dependencies: tslib: 2.8.1 - '@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)': + '@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)': dependencies: rxjs: 7.8.2 tslib: 2.8.1 - zone.js: 0.15.0 optionalDependencies: - '@angular/compiler': 20.0.0-next.9 + '@angular/compiler': 21.1.0-next.4 + zone.js: 0.16.0 - '@angular/forms@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2)': + '@angular/forms@21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2)': dependencies: - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) - '@angular/platform-browser': 20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + '@angular/common': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) + '@angular/platform-browser': 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) + '@standard-schema/spec': 1.1.0 rxjs: 7.8.2 tslib: 2.8.1 - '@angular/localize@20.0.0-next.9(@angular/compiler-cli@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3))(@angular/compiler@20.0.0-next.9)': + '@angular/localize@21.1.0-next.4(@angular/compiler-cli@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3))(@angular/compiler@21.1.0-next.4)': dependencies: - '@angular/compiler': 20.0.0-next.9 - '@angular/compiler-cli': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3) - '@babel/core': 7.26.10 + '@angular/compiler': 21.1.0-next.4 + '@angular/compiler-cli': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3) + '@babel/core': 7.28.5 '@types/babel__core': 7.20.5 - tinyglobby: 0.2.13 - yargs: 17.7.2 + tinyglobby: 0.2.15 + yargs: 18.0.0 transitivePeerDependencies: - supports-color - '@angular/material@20.0.0-next.10(xotmywbppgelv3sapeuqfwdbqe)': + '@angular/material@21.1.0-next.3(5911ac44acdb5e81564606f5886cc827)': dependencies: - '@angular/cdk': 20.0.0-next.10(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) - '@angular/forms': 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2) - '@angular/platform-browser': 20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + '@angular/cdk': 21.1.0-next.3(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) + '@angular/common': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) + '@angular/forms': 21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2) + '@angular/platform-browser': 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) rxjs: 7.8.2 tslib: 2.8.1 - '@angular/ng-dev@https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/1125d8dbec5e787d9579e5b218b60a3be64c50fa(encoding@0.1.13)': - dependencies: - '@google-cloud/spanner': 7.21.0(encoding@0.1.13)(supports-color@10.0.0) - '@octokit/rest': 21.1.1 - '@types/semver': 7.7.0 - '@types/supports-color': 10.0.0 + '@angular/ng-dev@https://codeload.github.com/angular/dev-infra-private-ng-dev-builds/tar.gz/ddc3809c1993612732eaae62d28e828b2ed789e5(@modelcontextprotocol/sdk@1.25.0(zod@4.2.1))': + dependencies: + '@actions/core': 2.0.1 + '@google-cloud/spanner': 8.0.0(supports-color@10.2.2) + '@google/genai': 1.33.0(@modelcontextprotocol/sdk@1.25.0(zod@4.2.1))(bufferutil@4.0.9)(supports-color@10.2.2)(utf-8-validate@6.0.5) + '@inquirer/prompts': 8.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) + '@octokit/auth-app': 8.1.2 + '@octokit/core': 7.0.6 + '@octokit/graphql': 9.0.3 + '@octokit/graphql-schema': 15.26.1 + '@octokit/openapi-types': 27.0.0 + '@octokit/plugin-paginate-rest': 14.0.0(@octokit/core@7.0.6) + '@octokit/plugin-rest-endpoint-methods': 17.0.0(@octokit/core@7.0.6) + '@octokit/request-error': 7.1.0 + '@octokit/rest': 22.0.1 + '@octokit/types': 16.0.0 + '@pnpm/dependency-path': 1001.1.8 + '@types/cli-progress': 3.11.6 + '@types/ejs': 3.1.5 + '@types/events': 3.0.3 + '@types/folder-hash': 4.0.4 + '@types/git-raw-commits': 5.0.1 + '@types/jasmine': 5.1.13 + '@types/node': 24.10.4 + '@types/semver': 7.7.1 + '@types/which': 3.0.4 + '@types/yargs': 17.0.35 + '@types/yarnpkg__lockfile': 1.1.9 '@yarnpkg/lockfile': 1.1.0 - chalk: 5.4.1 - semver: 7.7.1 - supports-color: 10.0.0 + bufferutil: 4.0.9 + cli-progress: 3.12.0 + conventional-commits-filter: 5.0.0 + conventional-commits-parser: 6.2.1 + ejs: 3.1.10 + encoding: 0.1.13 + fast-glob: 3.3.3 + firebase: 12.7.0 + folder-hash: 4.1.1(supports-color@10.2.2) + git-raw-commits: 5.0.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.2.1) + jasmine: 5.13.0 + jasmine-core: 5.13.0 + jasmine-reporters: 2.5.2 + jsonc-parser: 3.3.1 + minimatch: 10.1.1 + multimatch: 7.0.0 + nock: 14.0.10 + semver: 7.7.3 + supports-color: 10.2.2 + tsx: 4.21.0 typed-graphqlify: 3.1.6 - typescript: 5.8.3 - which: 5.0.0 - yaml: 2.7.1 + typescript: 5.9.3 + utf-8-validate: 6.0.5 + which: 6.0.0 + yaml: 2.8.2 + yargs: 18.0.0 transitivePeerDependencies: - - encoding + - '@modelcontextprotocol/sdk' + - '@react-native-async-storage/async-storage' - '@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))': + '@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))': dependencies: - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) + '@angular/common': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) tslib: 2.8.1 optionalDependencies: - '@angular/animations': 20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + '@angular/animations': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) - '@angular/platform-server@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/compiler@20.0.0-next.9)(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2)': + '@angular/platform-server@21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/compiler@21.1.0-next.4)(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2)': dependencies: - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/compiler': 20.0.0-next.9 - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) - '@angular/platform-browser': 20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + '@angular/common': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@angular/compiler': 21.1.0-next.4 + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) + '@angular/platform-browser': 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) rxjs: 7.8.2 tslib: 2.8.1 xhr2: 0.2.1 - '@angular/router@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(@angular/platform-browser@20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(rxjs@7.8.2)': + '@angular/router@21.1.0-next.4(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(@angular/platform-browser@21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(rxjs@7.8.2)': dependencies: - '@angular/common': 20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2) - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) - '@angular/platform-browser': 20.0.0-next.9(@angular/animations@20.0.0-next.9(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)))(@angular/common@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2))(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0)) + '@angular/common': 21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) + '@angular/platform-browser': 21.1.0-next.4(@angular/animations@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)))(@angular/common@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2))(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0)) rxjs: 7.8.2 tslib: 2.8.1 - '@angular/service-worker@20.0.0-next.9(@angular/core@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0))(rxjs@7.8.2)': + '@angular/service-worker@21.1.0-next.4(@angular/core@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0))(rxjs@7.8.2)': dependencies: - '@angular/core': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(rxjs@7.8.2)(zone.js@0.15.0) + '@angular/core': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(rxjs@7.8.2)(zone.js@0.16.0) rxjs: 7.8.2 tslib: 2.8.1 - '@asamuzakjp/css-color@3.1.7': + '@asamuzakjp/css-color@4.1.1': dependencies: - '@csstools/css-calc': 2.1.3(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-color-parser': 3.0.9(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 - lru-cache: 10.4.3 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-color-parser': 3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + lru-cache: 11.2.4 + + '@asamuzakjp/dom-selector@6.7.6': + dependencies: + '@asamuzakjp/nwsapi': 2.3.9 + bidi-js: 1.0.3 + css-tree: 3.1.0 + is-potential-custom-element-name: 1.0.1 + lru-cache: 11.2.4 + + '@asamuzakjp/nwsapi@2.3.9': {} '@babel/code-frame@7.27.1': dependencies: - '@babel/helper-validator-identifier': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.27.2': {} - - '@babel/core@7.26.10': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.27.1 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.27.1(@babel/core@7.26.10) - '@babel/helpers': 7.27.1 - '@babel/parser': 7.27.2 - '@babel/template': 7.27.2 - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 - convert-source-map: 2.0.0 - debug: 4.4.0(supports-color@10.0.0) - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + '@babel/compat-data@7.28.5': {} - '@babel/core@7.27.1': + '@babel/core@7.28.5': dependencies: - '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.27.1 - '@babel/generator': 7.27.1 + '@babel/generator': 7.28.5 '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) - '@babel/helpers': 7.27.1 - '@babel/parser': 7.27.2 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) + '@babel/helpers': 7.28.4 + '@babel/parser': 7.28.5 '@babel/template': 7.27.2 - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 + '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.27.1': + '@babel/generator@7.28.5': dependencies: - '@babel/parser': 7.27.2 - '@babel/types': 7.27.1 - '@jridgewell/gen-mapping': 0.3.8 - '@jridgewell/trace-mapping': 0.3.25 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 - '@babel/helper-annotate-as-pure@7.27.1': + '@babel/helper-annotate-as-pure@7.27.3': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@babel/helper-compilation-targets@7.27.2': dependencies: - '@babel/compat-data': 7.27.2 + '@babel/compat-data': 7.28.5 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.24.5 + browserslist: 4.28.1 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.27.1)': + '@babel/helper-create-class-features-plugin@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-annotate-as-pure': 7.27.1 - '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/core': 7.28.5 + '@babel/helper-annotate-as-pure': 7.27.3 + '@babel/helper-member-expression-to-functions': 7.28.5 '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-regexp-features-plugin@7.27.1(@babel/core@7.27.1)': + '@babel/helper-create-regexp-features-plugin@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-annotate-as-pure': 7.27.1 - regexpu-core: 6.2.0 + '@babel/core': 7.28.5 + '@babel/helper-annotate-as-pure': 7.27.3 + regexpu-core: 6.4.0 semver: 6.3.1 - '@babel/helper-define-polyfill-provider@0.6.4(@babel/core@7.27.1)': + '@babel/helper-define-polyfill-provider@0.6.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-compilation-targets': 7.27.2 '@babel/helper-plugin-utils': 7.27.1 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) lodash.debounce: 4.0.8 - resolve: 1.22.10 + resolve: 1.22.11 transitivePeerDependencies: - supports-color - '@babel/helper-member-expression-to-functions@7.27.1': - dependencies: - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/helper-globals@7.28.0': {} - '@babel/helper-module-imports@7.27.1': + '@babel/helper-member-expression-to-functions@7.28.5': dependencies: - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.27.1(@babel/core@7.26.10)': + '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.27.1(@babel/core@7.27.1)': + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color '@babel/helper-optimise-call-expression@7.27.1': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@babel/helper-plugin-utils@7.27.1': {} - '@babel/helper-remap-async-to-generator@7.27.1(@babel/core@7.27.1)': + '@babel/helper-remap-async-to-generator@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-annotate-as-pure': 7.27.1 - '@babel/helper-wrap-function': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/core': 7.28.5 + '@babel/helper-annotate-as-pure': 7.27.3 + '@babel/helper-wrap-function': 7.28.3 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.27.1(@babel/core@7.27.1)': + '@babel/helper-replace-supers@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/core': 7.28.5 + '@babel/helper-member-expression-to-functions': 7.28.5 '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color '@babel/helper-skip-transparent-expression-wrappers@7.27.1': dependencies: - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color '@babel/helper-split-export-declaration@7.24.7': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@babel/helper-string-parser@7.27.1': {} - '@babel/helper-validator-identifier@7.27.1': {} + '@babel/helper-validator-identifier@7.28.5': {} '@babel/helper-validator-option@7.27.1': {} - '@babel/helper-wrap-function@7.27.1': + '@babel/helper-wrap-function@7.28.3': dependencies: '@babel/template': 7.27.2 - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/helpers@7.27.1': + '@babel/helpers@7.28.4': dependencies: '@babel/template': 7.27.2 - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 - '@babel/parser@7.27.2': + '@babel/parser@7.28.5': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-transform-optional-chaining': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-optional-chaining': 7.28.5(@babel/core@7.28.5) transitivePeerDependencies: - supports-color - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.28.3(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.27.1)': + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 - '@babel/plugin-syntax-import-assertions@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-syntax-import-assertions@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.27.1)': + '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-arrow-functions@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-arrow-functions@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-async-generator-functions@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-async-generator-functions@7.28.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.27.1) - '@babel/traverse': 7.27.1 + '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.28.5) + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-async-to-generator@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-async-to-generator@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-module-imports': 7.27.1 '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.27.1) + '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.28.5) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-block-scoped-functions@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-block-scoped-functions@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-block-scoping@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-block-scoping@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-class-properties@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-class-properties@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-class-static-block@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-class-static-block@7.28.3(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-classes@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-classes@7.28.4(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/core': 7.28.5 + '@babel/helper-annotate-as-pure': 7.27.3 '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-globals': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) - '@babel/traverse': 7.27.1 - globals: 11.12.0 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-computed-properties@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-computed-properties@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 '@babel/template': 7.27.2 - '@babel/plugin-transform-destructuring@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-destructuring@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/traverse': 7.28.5 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-dotall-regex@7.27.1(@babel/core@7.28.5)': + dependencies: + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-dotall-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-duplicate-keys@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-duplicate-keys@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-dynamic-import@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-dynamic-import@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-explicit-resource-management@7.28.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-transform-destructuring': 7.28.5(@babel/core@7.28.5) + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-exponentiation-operator@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-exponentiation-operator@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-export-namespace-from@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-export-namespace-from@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-for-of@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-for-of@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-function-name@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-function-name@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-compilation-targets': 7.27.2 '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-json-strings@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-json-strings@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-literals@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-literals@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-logical-assignment-operators@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-logical-assignment-operators@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-member-expression-literals@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-member-expression-literals@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-modules-amd@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-modules-amd@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-systemjs@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-modules-systemjs@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-umd@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-modules-umd@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-named-capturing-groups-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-named-capturing-groups-regex@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-new-target@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-new-target@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-nullish-coalescing-operator@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-nullish-coalescing-operator@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-numeric-separator@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-numeric-separator@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-object-rest-spread@7.27.2(@babel/core@7.27.1)': + '@babel/plugin-transform-object-rest-spread@7.28.4(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-compilation-targets': 7.27.2 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-destructuring': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-parameters': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-destructuring': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.28.5) + '@babel/traverse': 7.28.5 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-object-super@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-object-super@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-optional-catch-binding@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-optional-catch-binding@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-optional-chaining@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-optional-chaining@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-parameters@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-parameters@7.27.7(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-private-methods@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-private-methods@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-private-property-in-object@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-private-property-in-object@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-annotate-as-pure': 7.27.1 - '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-annotate-as-pure': 7.27.3 + '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-property-literals@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-property-literals@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-regenerator@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-regenerator@7.28.4(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-regexp-modifiers@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-regexp-modifiers@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-reserved-words@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-reserved-words@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-runtime@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-runtime@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-module-imports': 7.27.1 '@babel/helper-plugin-utils': 7.27.1 - babel-plugin-polyfill-corejs2: 0.4.13(@babel/core@7.27.1) - babel-plugin-polyfill-corejs3: 0.11.1(@babel/core@7.27.1) - babel-plugin-polyfill-regenerator: 0.6.4(@babel/core@7.27.1) + babel-plugin-polyfill-corejs2: 0.4.14(@babel/core@7.28.5) + babel-plugin-polyfill-corejs3: 0.13.0(@babel/core@7.28.5) + babel-plugin-polyfill-regenerator: 0.6.5(@babel/core@7.28.5) semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-shorthand-properties@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-shorthand-properties@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-spread@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-spread@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-sticky-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-sticky-regex@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-template-literals@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-template-literals@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-typeof-symbol@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-typeof-symbol@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-escapes@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-unicode-escapes@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-property-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-unicode-property-regex@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-unicode-regex@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-sets-regex@7.27.1(@babel/core@7.27.1)': + '@babel/plugin-transform-unicode-sets-regex@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 - '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) '@babel/helper-plugin-utils': 7.27.1 - '@babel/preset-env@7.27.2(@babel/core@7.27.1)': + '@babel/preset-env@7.28.5(@babel/core@7.28.5)': dependencies: - '@babel/compat-data': 7.27.2 - '@babel/core': 7.27.1 + '@babel/compat-data': 7.28.5 + '@babel/core': 7.28.5 '@babel/helper-compilation-targets': 7.27.2 '@babel/helper-plugin-utils': 7.27.1 '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.27.1) - '@babel/plugin-syntax-import-assertions': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.27.1) - '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-async-generator-functions': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-async-to-generator': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-block-scoped-functions': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-block-scoping': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-class-properties': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-class-static-block': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-classes': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-computed-properties': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-destructuring': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-dotall-regex': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-duplicate-keys': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-exponentiation-operator': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-for-of': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-function-name': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-json-strings': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-literals': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-logical-assignment-operators': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-member-expression-literals': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-modules-amd': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-modules-systemjs': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-modules-umd': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-named-capturing-groups-regex': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-new-target': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-nullish-coalescing-operator': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-numeric-separator': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-object-rest-spread': 7.27.2(@babel/core@7.27.1) - '@babel/plugin-transform-object-super': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-optional-catch-binding': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-optional-chaining': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-parameters': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-private-methods': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-private-property-in-object': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-property-literals': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-regenerator': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-regexp-modifiers': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-reserved-words': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-shorthand-properties': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-spread': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-sticky-regex': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-template-literals': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-typeof-symbol': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-unicode-escapes': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-unicode-property-regex': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-transform-unicode-sets-regex': 7.27.1(@babel/core@7.27.1) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.27.1) - babel-plugin-polyfill-corejs2: 0.4.13(@babel/core@7.27.1) - babel-plugin-polyfill-corejs3: 0.11.1(@babel/core@7.27.1) - babel-plugin-polyfill-regenerator: 0.6.4(@babel/core@7.27.1) - core-js-compat: 3.42.0 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.28.3(@babel/core@7.28.5) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.28.5) + '@babel/plugin-syntax-import-assertions': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.28.5) + '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-async-generator-functions': 7.28.0(@babel/core@7.28.5) + '@babel/plugin-transform-async-to-generator': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-block-scoped-functions': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-block-scoping': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-class-properties': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-class-static-block': 7.28.3(@babel/core@7.28.5) + '@babel/plugin-transform-classes': 7.28.4(@babel/core@7.28.5) + '@babel/plugin-transform-computed-properties': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-destructuring': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-dotall-regex': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-duplicate-keys': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-explicit-resource-management': 7.28.0(@babel/core@7.28.5) + '@babel/plugin-transform-exponentiation-operator': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-for-of': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-function-name': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-json-strings': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-literals': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-logical-assignment-operators': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-member-expression-literals': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-modules-amd': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-modules-systemjs': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-modules-umd': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-named-capturing-groups-regex': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-new-target': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-nullish-coalescing-operator': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-numeric-separator': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-object-rest-spread': 7.28.4(@babel/core@7.28.5) + '@babel/plugin-transform-object-super': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-optional-catch-binding': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-optional-chaining': 7.28.5(@babel/core@7.28.5) + '@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.28.5) + '@babel/plugin-transform-private-methods': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-private-property-in-object': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-property-literals': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-regenerator': 7.28.4(@babel/core@7.28.5) + '@babel/plugin-transform-regexp-modifiers': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-reserved-words': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-shorthand-properties': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-spread': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-sticky-regex': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-template-literals': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-typeof-symbol': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-unicode-escapes': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-unicode-property-regex': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-unicode-sets-regex': 7.27.1(@babel/core@7.28.5) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.28.5) + babel-plugin-polyfill-corejs2: 0.4.14(@babel/core@7.28.5) + babel-plugin-polyfill-corejs3: 0.13.0(@babel/core@7.28.5) + babel-plugin-polyfill-regenerator: 0.6.5(@babel/core@7.28.5) + core-js-compat: 3.47.0 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.27.1)': + '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 esutils: 2.0.3 - '@babel/runtime@7.27.1': {} + '@babel/runtime@7.28.4': {} '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 - '@babel/parser': 7.27.2 - '@babel/types': 7.27.1 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 - '@babel/traverse@7.27.1': + '@babel/traverse@7.28.5': dependencies: '@babel/code-frame': 7.27.1 - '@babel/generator': 7.27.1 - '@babel/parser': 7.27.2 + '@babel/generator': 7.28.5 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.28.5 '@babel/template': 7.27.2 - '@babel/types': 7.27.1 - debug: 4.4.0(supports-color@10.0.0) - globals: 11.12.0 + '@babel/types': 7.28.5 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@babel/types@7.27.1': + '@babel/types@7.28.5': dependencies: '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 '@bazel/bazelisk@1.26.0': {} - '@bazel/buildifier@8.2.0': {} + '@bazel/buildifier@8.2.1': {} + + '@bcoe/v8-coverage@1.0.2': {} '@colors/colors@1.5.0': {} + '@conventional-changelog/git-client@1.0.1(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.2.1)': + dependencies: + '@types/semver': 7.7.1 + semver: 7.7.3 + optionalDependencies: + conventional-commits-filter: 5.0.0 + conventional-commits-parser: 6.2.1 + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 - '@csstools/color-helpers@5.0.2': {} + '@csstools/color-helpers@5.1.0': {} - '@csstools/css-calc@2.1.3(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-color-parser@3.0.9(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-color-parser@3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/color-helpers': 5.0.2 - '@csstools/css-calc': 2.1.3(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/color-helpers': 5.1.0 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-tokenizer': 3.0.4 + + '@csstools/css-syntax-patches-for-csstree@1.0.22': {} - '@csstools/css-tokenizer@3.0.3': {} + '@csstools/css-tokenizer@3.0.4': {} - '@cypress/request@3.0.8': + '@cypress/request@3.0.9': dependencies: aws-sign2: 0.7.0 aws4: 1.13.2 @@ -9099,7 +10183,7 @@ snapshots: combined-stream: 1.0.8 extend: 3.0.2 forever-agent: 0.6.1 - form-data: 4.0.2 + form-data: 4.0.5 http-signature: 1.4.0 is-typedarray: 1.0.0 isstream: 0.1.2 @@ -9114,341 +10198,842 @@ snapshots: '@discoveryjs/json-ext@0.6.3': {} - '@esbuild/aix-ppc64@0.25.4': + '@emnapi/core@1.7.1': + dependencies: + '@emnapi/wasi-threads': 1.1.0 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.7.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.1.0': + dependencies: + tslib: 2.8.1 + optional: true + + '@esbuild/aix-ppc64@0.27.1': + optional: true + + '@esbuild/android-arm64@0.27.1': + optional: true + + '@esbuild/android-arm@0.27.1': + optional: true + + '@esbuild/android-x64@0.27.1': + optional: true + + '@esbuild/darwin-arm64@0.27.1': + optional: true + + '@esbuild/darwin-x64@0.27.1': + optional: true + + '@esbuild/freebsd-arm64@0.27.1': + optional: true + + '@esbuild/freebsd-x64@0.27.1': + optional: true + + '@esbuild/linux-arm64@0.27.1': + optional: true + + '@esbuild/linux-arm@0.27.1': + optional: true + + '@esbuild/linux-ia32@0.27.1': + optional: true + + '@esbuild/linux-loong64@0.27.1': optional: true - '@esbuild/android-arm64@0.25.4': + '@esbuild/linux-mips64el@0.27.1': optional: true - '@esbuild/android-arm@0.25.4': + '@esbuild/linux-ppc64@0.27.1': optional: true - '@esbuild/android-x64@0.25.4': + '@esbuild/linux-riscv64@0.27.1': optional: true - '@esbuild/darwin-arm64@0.25.4': + '@esbuild/linux-s390x@0.27.1': optional: true - '@esbuild/darwin-x64@0.25.4': + '@esbuild/linux-x64@0.27.1': optional: true - '@esbuild/freebsd-arm64@0.25.4': + '@esbuild/netbsd-arm64@0.27.1': optional: true - '@esbuild/freebsd-x64@0.25.4': + '@esbuild/netbsd-x64@0.27.1': optional: true - '@esbuild/linux-arm64@0.25.4': + '@esbuild/openbsd-arm64@0.27.1': optional: true - '@esbuild/linux-arm@0.25.4': + '@esbuild/openbsd-x64@0.27.1': optional: true - '@esbuild/linux-ia32@0.25.4': + '@esbuild/openharmony-arm64@0.27.1': optional: true - '@esbuild/linux-loong64@0.25.4': + '@esbuild/sunos-x64@0.27.1': optional: true - '@esbuild/linux-mips64el@0.25.4': + '@esbuild/win32-arm64@0.27.1': optional: true - '@esbuild/linux-ppc64@0.25.4': + '@esbuild/win32-ia32@0.27.1': optional: true - '@esbuild/linux-riscv64@0.25.4': - optional: true + '@esbuild/win32-x64@0.27.1': + optional: true + + '@eslint-community/eslint-utils@4.9.0(eslint@9.39.2(jiti@2.6.1))': + dependencies: + eslint: 9.39.2(jiti@2.6.1) + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.2': {} + + '@eslint/compat@2.0.0(eslint@9.39.2(jiti@2.6.1))': + dependencies: + '@eslint/core': 1.0.0 + optionalDependencies: + eslint: 9.39.2(jiti@2.6.1) + + '@eslint/config-array@0.21.1': + dependencies: + '@eslint/object-schema': 2.1.7 + debug: 4.4.3(supports-color@10.2.2) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/config-helpers@0.4.2': + dependencies: + '@eslint/core': 0.17.0 + + '@eslint/core@0.17.0': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/core@1.0.0': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/eslintrc@3.3.3': + dependencies: + ajv: 6.12.6 + debug: 4.4.3(supports-color@10.2.2) + espree: 10.4.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.1 + js-yaml: 4.1.1 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@9.39.2': {} + + '@eslint/object-schema@2.1.7': {} + + '@eslint/plugin-kit@0.4.1': + dependencies: + '@eslint/core': 0.17.0 + levn: 0.4.1 + + '@fastify/busboy@2.1.1': {} + + '@firebase/ai@2.6.1(@firebase/app-types@0.9.3)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/app-check-interop-types': 0.3.3 + '@firebase/app-types': 0.9.3 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/analytics-compat@0.2.25(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6)': + dependencies: + '@firebase/analytics': 0.10.19(@firebase/app@0.14.6) + '@firebase/analytics-types': 0.8.3 + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + + '@firebase/analytics-types@0.8.3': {} + + '@firebase/analytics@0.10.19(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.6) + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/app-check-compat@0.4.0(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app-check': 0.11.0(@firebase/app@0.14.6) + '@firebase/app-check-types': 0.5.3 + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + + '@firebase/app-check-interop-types@0.3.3': {} + + '@firebase/app-check-types@0.5.3': {} + + '@firebase/app-check@0.11.0(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/app-compat@0.5.6': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/app-types@0.9.3': {} + + '@firebase/app@0.14.6': + dependencies: + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + idb: 7.1.1 + tslib: 2.8.1 + + '@firebase/auth-compat@0.6.2(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app-compat': 0.5.6 + '@firebase/auth': 1.12.0(@firebase/app@0.14.6) + '@firebase/auth-types': 0.13.0(@firebase/app-types@0.9.3)(@firebase/util@1.13.0) + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' + - '@react-native-async-storage/async-storage' + + '@firebase/auth-interop-types@0.2.4': {} + + '@firebase/auth-types@0.13.0(@firebase/app-types@0.9.3)(@firebase/util@1.13.0)': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + + '@firebase/auth@1.12.0(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/component@0.7.0': + dependencies: + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/data-connect@0.3.12(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/auth-interop-types': 0.2.4 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/database-compat@2.1.0': + dependencies: + '@firebase/component': 0.7.0 + '@firebase/database': 1.1.0 + '@firebase/database-types': 1.0.16 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/database-types@1.0.16': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + + '@firebase/database@1.1.0': + dependencies: + '@firebase/app-check-interop-types': 0.3.3 + '@firebase/auth-interop-types': 0.2.4 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + faye-websocket: 0.11.4 + tslib: 2.8.1 + + '@firebase/firestore-compat@0.4.3(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/firestore': 4.9.3(@firebase/app@0.14.6) + '@firebase/firestore-types': 3.0.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' + + '@firebase/firestore-types@3.0.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0)': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + + '@firebase/firestore@4.9.3(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + '@firebase/webchannel-wrapper': 1.0.5 + '@grpc/grpc-js': 1.9.15 + '@grpc/proto-loader': 0.7.15 + tslib: 2.8.1 - '@esbuild/linux-s390x@0.25.4': - optional: true + '@firebase/functions-compat@0.4.1(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/functions': 0.13.1(@firebase/app@0.14.6) + '@firebase/functions-types': 0.6.3 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' - '@esbuild/linux-x64@0.25.4': - optional: true + '@firebase/functions-types@0.6.3': {} - '@esbuild/netbsd-arm64@0.25.4': - optional: true + '@firebase/functions@0.13.1(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/app-check-interop-types': 0.3.3 + '@firebase/auth-interop-types': 0.2.4 + '@firebase/component': 0.7.0 + '@firebase/messaging-interop-types': 0.2.3 + '@firebase/util': 1.13.0 + tslib: 2.8.1 - '@esbuild/netbsd-x64@0.25.4': - optional: true + '@firebase/installations-compat@0.2.19(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.6) + '@firebase/installations-types': 0.5.3(@firebase/app-types@0.9.3) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' - '@esbuild/openbsd-arm64@0.25.4': - optional: true + '@firebase/installations-types@0.5.3(@firebase/app-types@0.9.3)': + dependencies: + '@firebase/app-types': 0.9.3 - '@esbuild/openbsd-x64@0.25.4': - optional: true + '@firebase/installations@0.6.19(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + idb: 7.1.1 + tslib: 2.8.1 - '@esbuild/sunos-x64@0.25.4': - optional: true + '@firebase/logger@0.5.0': + dependencies: + tslib: 2.8.1 - '@esbuild/win32-arm64@0.25.4': - optional: true + '@firebase/messaging-compat@0.2.23(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6)': + dependencies: + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/messaging': 0.12.23(@firebase/app@0.14.6) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' - '@esbuild/win32-ia32@0.25.4': - optional: true + '@firebase/messaging-interop-types@0.2.3': {} - '@esbuild/win32-x64@0.25.4': - optional: true + '@firebase/messaging@0.12.23(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.6) + '@firebase/messaging-interop-types': 0.2.3 + '@firebase/util': 1.13.0 + idb: 7.1.1 + tslib: 2.8.1 - '@eslint-community/eslint-utils@4.7.0(eslint@9.26.0(jiti@1.21.7))': + '@firebase/performance-compat@0.2.22(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6)': dependencies: - eslint: 9.26.0(jiti@1.21.7) - eslint-visitor-keys: 3.4.3 + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/performance': 0.7.9(@firebase/app@0.14.6) + '@firebase/performance-types': 0.2.3 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' - '@eslint-community/regexpp@4.12.1': {} + '@firebase/performance-types@0.2.3': {} - '@eslint/compat@1.2.9(eslint@9.26.0(jiti@1.21.7))': - optionalDependencies: - eslint: 9.26.0(jiti@1.21.7) + '@firebase/performance@0.7.9(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.6) + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + web-vitals: 4.2.4 - '@eslint/config-array@0.20.0': + '@firebase/remote-config-compat@0.2.20(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6)': dependencies: - '@eslint/object-schema': 2.1.6 - debug: 4.4.0(supports-color@10.0.0) - minimatch: 3.1.2 + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/remote-config': 0.7.0(@firebase/app@0.14.6) + '@firebase/remote-config-types': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 transitivePeerDependencies: - - supports-color + - '@firebase/app' - '@eslint/config-helpers@0.2.2': {} + '@firebase/remote-config-types@0.5.0': {} - '@eslint/core@0.13.0': + '@firebase/remote-config@0.7.0(@firebase/app@0.14.6)': dependencies: - '@types/json-schema': 7.0.15 + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.6) + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 - '@eslint/eslintrc@3.3.1': + '@firebase/storage-compat@0.4.0(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6)': dependencies: - ajv: 6.12.6 - debug: 4.4.0(supports-color@10.0.0) - espree: 10.3.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 + '@firebase/app-compat': 0.5.6 + '@firebase/component': 0.7.0 + '@firebase/storage': 0.14.0(@firebase/app@0.14.6) + '@firebase/storage-types': 0.8.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0) + '@firebase/util': 1.13.0 + tslib: 2.8.1 transitivePeerDependencies: - - supports-color + - '@firebase/app' + - '@firebase/app-types' - '@eslint/js@9.26.0': {} + '@firebase/storage-types@0.8.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0)': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 - '@eslint/object-schema@2.1.6': {} + '@firebase/storage@0.14.0(@firebase/app@0.14.6)': + dependencies: + '@firebase/app': 0.14.6 + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 - '@eslint/plugin-kit@0.2.8': + '@firebase/util@1.13.0': dependencies: - '@eslint/core': 0.13.0 - levn: 0.4.1 + tslib: 2.8.1 + + '@firebase/webchannel-wrapper@1.0.5': {} '@glideapps/ts-necessities@2.2.3': {} - '@google-cloud/common@5.0.2(encoding@0.1.13)(supports-color@10.0.0)': + '@google-cloud/common@6.0.0(supports-color@10.2.2)': dependencies: '@google-cloud/projectify': 4.0.0 - '@google-cloud/promisify': 4.0.0 + '@google-cloud/promisify': 4.1.0 arrify: 2.0.1 duplexify: 4.1.3 extend: 3.0.2 - google-auth-library: 9.15.1(encoding@0.1.13)(supports-color@10.0.0) + google-auth-library: 10.5.0(supports-color@10.2.2) html-entities: 2.6.0 - retry-request: 7.0.2(encoding@0.1.13)(supports-color@10.0.0) - teeny-request: 9.0.0(encoding@0.1.13)(supports-color@10.0.0) + retry-request: 8.0.2(supports-color@10.2.2) + teeny-request: 10.1.0(supports-color@10.2.2) transitivePeerDependencies: - - encoding - supports-color - '@google-cloud/precise-date@4.0.0': {} + '@google-cloud/precise-date@5.0.0': {} '@google-cloud/projectify@4.0.0': {} - '@google-cloud/promisify@4.0.0': {} + '@google-cloud/projectify@5.0.0': {} + + '@google-cloud/promisify@4.1.0': {} + + '@google-cloud/promisify@5.0.0': {} - '@google-cloud/spanner@7.21.0(encoding@0.1.13)(supports-color@10.0.0)': + '@google-cloud/spanner@8.0.0(supports-color@10.2.2)': dependencies: - '@google-cloud/common': 5.0.2(encoding@0.1.13)(supports-color@10.0.0) - '@google-cloud/precise-date': 4.0.0 - '@google-cloud/projectify': 4.0.0 - '@google-cloud/promisify': 4.0.0 + '@google-cloud/common': 6.0.0(supports-color@10.2.2) + '@google-cloud/precise-date': 5.0.0 + '@google-cloud/projectify': 5.0.0 + '@google-cloud/promisify': 5.0.0 '@grpc/proto-loader': 0.7.15 '@opentelemetry/api': 1.9.0 - '@opentelemetry/context-async-hooks': 1.30.1(@opentelemetry/api@1.9.0) - '@opentelemetry/core': 1.30.1(@opentelemetry/api@1.9.0) - '@opentelemetry/semantic-conventions': 1.32.0 + '@opentelemetry/context-async-hooks': 2.2.0(@opentelemetry/api@1.9.0) + '@opentelemetry/core': 2.2.0(@opentelemetry/api@1.9.0) + '@opentelemetry/semantic-conventions': 1.38.0 '@types/big.js': 6.2.2 '@types/stack-trace': 0.0.33 - arrify: 2.0.1 - big.js: 6.2.2 + big.js: 7.0.1 checkpoint-stream: 0.1.2 duplexify: 4.1.3 events-intercept: 2.0.0 extend: 3.0.2 - google-auth-library: 9.15.1(encoding@0.1.13)(supports-color@10.0.0) - google-gax: 4.4.1(encoding@0.1.13)(supports-color@10.0.0) - grpc-gcp: 1.0.1(protobufjs@7.4.0) - is: 3.3.0 + google-auth-library: 10.5.0(supports-color@10.2.2) + google-gax: 5.0.6(supports-color@10.2.2) + grpc-gcp: 1.0.1(protobufjs@7.5.4) + is: 3.3.2 lodash.snakecase: 4.1.1 merge-stream: 2.0.0 p-queue: 6.6.2 - protobufjs: 7.4.0 - retry-request: 7.0.2(encoding@0.1.13)(supports-color@10.0.0) + protobufjs: 7.5.4 + retry-request: 8.0.2(supports-color@10.2.2) split-array-stream: 2.0.0 stack-trace: 0.0.10 stream-events: 1.0.5 - teeny-request: 9.0.0(encoding@0.1.13)(supports-color@10.0.0) + teeny-request: 10.1.0(supports-color@10.2.2) through2: 4.0.2 transitivePeerDependencies: - - encoding - supports-color - '@grpc/grpc-js@1.13.3': + '@google/genai@1.33.0(@modelcontextprotocol/sdk@1.25.0(zod@4.2.1))(bufferutil@4.0.9)(supports-color@10.2.2)(utf-8-validate@6.0.5)': dependencies: - '@grpc/proto-loader': 0.7.15 + google-auth-library: 10.5.0(supports-color@10.2.2) + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) + optionalDependencies: + '@modelcontextprotocol/sdk': 1.25.0(zod@4.2.1) + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + '@grpc/grpc-js@1.14.3': + dependencies: + '@grpc/proto-loader': 0.8.0 '@js-sdsl/ordered-map': 4.4.2 + '@grpc/grpc-js@1.9.15': + dependencies: + '@grpc/proto-loader': 0.7.15 + '@types/node': 22.19.3 + '@grpc/proto-loader@0.7.15': dependencies: lodash.camelcase: 4.3.0 long: 5.3.2 - protobufjs: 7.4.0 + protobufjs: 7.5.4 + yargs: 17.7.2 + + '@grpc/proto-loader@0.8.0': + dependencies: + lodash.camelcase: 4.3.0 + long: 5.3.2 + protobufjs: 7.5.4 yargs: 17.7.2 '@hapi/bourne@3.0.0': {} + '@hono/node-server@1.19.7': {} + '@humanfs/core@0.19.1': {} - '@humanfs/node@0.16.6': + '@humanfs/node@0.16.7': dependencies: '@humanfs/core': 0.19.1 - '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/retry': 0.4.3 '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.3.1': {} - '@humanwhocodes/retry@0.4.3': {} - '@inquirer/checkbox@4.1.5(@types/node@20.17.44)': + '@inquirer/ansi@1.0.2': {} + + '@inquirer/ansi@2.0.2': {} + + '@inquirer/checkbox@4.3.2(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.6(@types/node@20.17.44) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 + '@inquirer/ansi': 1.0.2 + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/figures': 1.0.15 + '@inquirer/type': 3.0.10(@types/node@24.10.4) + yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/confirm@5.1.9(@types/node@20.17.44)': + '@inquirer/checkbox@5.0.3(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) + '@inquirer/ansi': 2.0.2 + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/figures': 2.0.2 + '@inquirer/type': 4.0.2(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/core@10.1.10(@types/node@20.17.44)': + '@inquirer/confirm@5.1.21(@types/node@24.10.4)': dependencies: - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.6(@types/node@20.17.44) - ansi-escapes: 4.3.2 + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/confirm@6.0.3(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/core@10.3.2(@types/node@24.10.4)': + dependencies: + '@inquirer/ansi': 1.0.2 + '@inquirer/figures': 1.0.15 + '@inquirer/type': 3.0.10(@types/node@24.10.4) cli-width: 4.1.0 mute-stream: 2.0.0 signal-exit: 4.1.0 wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 + yoctocolors-cjs: 2.1.3 + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/core@11.1.0(@types/node@24.10.4)': + dependencies: + '@inquirer/ansi': 2.0.2 + '@inquirer/figures': 2.0.2 + '@inquirer/type': 4.0.2(@types/node@24.10.4) + cli-width: 4.1.0 + mute-stream: 3.0.0 + signal-exit: 4.1.0 + wrap-ansi: 9.0.2 optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/editor@4.2.10(@types/node@20.17.44)': + '@inquirer/editor@4.2.23(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) - external-editor: 3.1.0 + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/external-editor': 1.0.3(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/expand@4.0.12(@types/node@20.17.44)': + '@inquirer/editor@5.0.3(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) - yoctocolors-cjs: 2.1.2 + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/external-editor': 2.0.2(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/figures@1.0.11': {} + '@inquirer/expand@4.0.23(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) + yoctocolors-cjs: 2.1.3 + optionalDependencies: + '@types/node': 24.10.4 - '@inquirer/input@4.1.9(@types/node@20.17.44)': + '@inquirer/expand@5.0.3(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/number@3.0.12(@types/node@20.17.44)': + '@inquirer/external-editor@1.0.3(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) + chardet: 2.1.1 + iconv-lite: 0.7.1 optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/password@4.0.12(@types/node@20.17.44)': + '@inquirer/external-editor@2.0.2(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) - ansi-escapes: 4.3.2 + chardet: 2.1.1 + iconv-lite: 0.7.1 + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/figures@1.0.15': {} + + '@inquirer/figures@2.0.2': {} + + '@inquirer/input@4.3.1(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 - - '@inquirer/prompts@7.5.0(@types/node@20.17.44)': - dependencies: - '@inquirer/checkbox': 4.1.5(@types/node@20.17.44) - '@inquirer/confirm': 5.1.9(@types/node@20.17.44) - '@inquirer/editor': 4.2.10(@types/node@20.17.44) - '@inquirer/expand': 4.0.12(@types/node@20.17.44) - '@inquirer/input': 4.1.9(@types/node@20.17.44) - '@inquirer/number': 3.0.12(@types/node@20.17.44) - '@inquirer/password': 4.0.12(@types/node@20.17.44) - '@inquirer/rawlist': 4.1.0(@types/node@20.17.44) - '@inquirer/search': 3.0.12(@types/node@20.17.44) - '@inquirer/select': 4.2.0(@types/node@20.17.44) + '@types/node': 24.10.4 + + '@inquirer/input@5.0.3(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/rawlist@4.1.0(@types/node@20.17.44)': + '@inquirer/number@3.0.23(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/type': 3.0.6(@types/node@20.17.44) - yoctocolors-cjs: 2.1.2 + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/search@3.0.12(@types/node@20.17.44)': + '@inquirer/number@4.0.3(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.6(@types/node@20.17.44) - yoctocolors-cjs: 2.1.2 + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/select@4.2.0(@types/node@20.17.44)': + '@inquirer/password@4.0.23(@types/node@24.10.4)': dependencies: - '@inquirer/core': 10.1.10(@types/node@20.17.44) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.6(@types/node@20.17.44) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 + '@inquirer/ansi': 1.0.2 + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/password@5.0.3(@types/node@24.10.4)': + dependencies: + '@inquirer/ansi': 2.0.2 + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/prompts@7.10.1(@types/node@24.10.4)': + dependencies: + '@inquirer/checkbox': 4.3.2(@types/node@24.10.4) + '@inquirer/confirm': 5.1.21(@types/node@24.10.4) + '@inquirer/editor': 4.2.23(@types/node@24.10.4) + '@inquirer/expand': 4.0.23(@types/node@24.10.4) + '@inquirer/input': 4.3.1(@types/node@24.10.4) + '@inquirer/number': 3.0.23(@types/node@24.10.4) + '@inquirer/password': 4.0.23(@types/node@24.10.4) + '@inquirer/rawlist': 4.1.11(@types/node@24.10.4) + '@inquirer/search': 3.2.2(@types/node@24.10.4) + '@inquirer/select': 4.4.2(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/prompts@8.1.0(@types/node@24.10.4)': + dependencies: + '@inquirer/checkbox': 5.0.3(@types/node@24.10.4) + '@inquirer/confirm': 6.0.3(@types/node@24.10.4) + '@inquirer/editor': 5.0.3(@types/node@24.10.4) + '@inquirer/expand': 5.0.3(@types/node@24.10.4) + '@inquirer/input': 5.0.3(@types/node@24.10.4) + '@inquirer/number': 4.0.3(@types/node@24.10.4) + '@inquirer/password': 5.0.3(@types/node@24.10.4) + '@inquirer/rawlist': 5.1.0(@types/node@24.10.4) + '@inquirer/search': 4.0.3(@types/node@24.10.4) + '@inquirer/select': 5.0.3(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/rawlist@4.1.11(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) + yoctocolors-cjs: 2.1.3 + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/rawlist@5.1.0(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/type': 4.0.2(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/search@3.2.2(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/figures': 1.0.15 + '@inquirer/type': 3.0.10(@types/node@24.10.4) + yoctocolors-cjs: 2.1.3 + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/search@4.0.3(@types/node@24.10.4)': + dependencies: + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/figures': 2.0.2 + '@inquirer/type': 4.0.2(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/select@4.4.2(@types/node@24.10.4)': + dependencies: + '@inquirer/ansi': 1.0.2 + '@inquirer/core': 10.3.2(@types/node@24.10.4) + '@inquirer/figures': 1.0.15 + '@inquirer/type': 3.0.10(@types/node@24.10.4) + yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 - '@inquirer/type@1.5.5': + '@inquirer/select@5.0.3(@types/node@24.10.4)': dependencies: - mute-stream: 1.0.0 + '@inquirer/ansi': 2.0.2 + '@inquirer/core': 11.1.0(@types/node@24.10.4) + '@inquirer/figures': 2.0.2 + '@inquirer/type': 4.0.2(@types/node@24.10.4) + optionalDependencies: + '@types/node': 24.10.4 + + '@inquirer/type@3.0.10(@types/node@24.10.4)': + optionalDependencies: + '@types/node': 24.10.4 - '@inquirer/type@3.0.6(@types/node@20.17.44)': + '@inquirer/type@4.0.2(@types/node@24.10.4)': optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 + + '@isaacs/balanced-match@4.0.1': {} + + '@isaacs/brace-expansion@5.0.0': + dependencies: + '@isaacs/balanced-match': 4.0.1 '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 strip-ansi-cjs: strip-ansi@6.0.1 wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 @@ -9459,32 +11044,34 @@ snapshots: '@istanbuljs/schema@0.1.3': {} - '@jridgewell/gen-mapping@0.3.8': + '@jridgewell/gen-mapping@0.3.13': dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/set-array@1.2.1': {} + '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/source-map@0.3.6': + '@jridgewell/source-map@0.3.11': dependencies: - '@jridgewell/gen-mapping': 0.3.8 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/sourcemap-codec@1.5.5': {} - '@jridgewell/trace-mapping@0.3.25': + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@js-sdsl/ordered-map@4.4.2': {} @@ -9492,61 +11079,89 @@ snapshots: dependencies: tslib: 2.8.1 - '@jsonjoy.com/json-pack@1.2.0(tslib@2.8.1)': + '@jsonjoy.com/buffers@1.2.1(tslib@2.8.1)': + dependencies: + tslib: 2.8.1 + + '@jsonjoy.com/codegen@1.0.0(tslib@2.8.1)': + dependencies: + tslib: 2.8.1 + + '@jsonjoy.com/json-pack@1.21.0(tslib@2.8.1)': dependencies: '@jsonjoy.com/base64': 1.1.2(tslib@2.8.1) - '@jsonjoy.com/util': 1.6.0(tslib@2.8.1) + '@jsonjoy.com/buffers': 1.2.1(tslib@2.8.1) + '@jsonjoy.com/codegen': 1.0.0(tslib@2.8.1) + '@jsonjoy.com/json-pointer': 1.0.2(tslib@2.8.1) + '@jsonjoy.com/util': 1.9.0(tslib@2.8.1) hyperdyperid: 1.2.0 - thingies: 1.21.0(tslib@2.8.1) + thingies: 2.5.0(tslib@2.8.1) + tree-dump: 1.1.0(tslib@2.8.1) + tslib: 2.8.1 + + '@jsonjoy.com/json-pointer@1.0.2(tslib@2.8.1)': + dependencies: + '@jsonjoy.com/codegen': 1.0.0(tslib@2.8.1) + '@jsonjoy.com/util': 1.9.0(tslib@2.8.1) tslib: 2.8.1 - '@jsonjoy.com/util@1.6.0(tslib@2.8.1)': + '@jsonjoy.com/util@1.9.0(tslib@2.8.1)': dependencies: + '@jsonjoy.com/buffers': 1.2.1(tslib@2.8.1) + '@jsonjoy.com/codegen': 1.0.0(tslib@2.8.1) tslib: 2.8.1 '@leichtgewicht/ip-codec@2.0.5': {} - '@listr2/prompt-adapter-inquirer@2.0.22(@inquirer/prompts@7.5.0(@types/node@20.17.44))': + '@listr2/prompt-adapter-inquirer@3.0.5(@inquirer/prompts@7.10.1(@types/node@24.10.4))(@types/node@24.10.4)(listr2@9.0.5)': dependencies: - '@inquirer/prompts': 7.5.0(@types/node@20.17.44) - '@inquirer/type': 1.5.5 + '@inquirer/prompts': 7.10.1(@types/node@24.10.4) + '@inquirer/type': 3.0.10(@types/node@24.10.4) + listr2: 9.0.5 + transitivePeerDependencies: + - '@types/node' - '@lmdb/lmdb-darwin-arm64@3.3.0': + '@lmdb/lmdb-darwin-arm64@3.4.4': optional: true - '@lmdb/lmdb-darwin-x64@3.3.0': + '@lmdb/lmdb-darwin-x64@3.4.4': optional: true - '@lmdb/lmdb-linux-arm64@3.3.0': + '@lmdb/lmdb-linux-arm64@3.4.4': optional: true - '@lmdb/lmdb-linux-arm@3.3.0': + '@lmdb/lmdb-linux-arm@3.4.4': optional: true - '@lmdb/lmdb-linux-x64@3.3.0': + '@lmdb/lmdb-linux-x64@3.4.4': optional: true - '@lmdb/lmdb-win32-arm64@3.3.0': + '@lmdb/lmdb-win32-arm64@3.4.4': optional: true - '@lmdb/lmdb-win32-x64@3.3.0': + '@lmdb/lmdb-win32-x64@3.4.4': optional: true - '@mdn/browser-compat-data@6.0.12': {} - - '@modelcontextprotocol/sdk@1.11.0': + '@modelcontextprotocol/sdk@1.25.0(zod@4.2.1)': dependencies: + '@hono/node-server': 1.19.7 + ajv: 8.17.1 + ajv-formats: 3.0.1(ajv@8.17.1) content-type: 1.0.5 cors: 2.8.5 cross-spawn: 7.0.6 - eventsource: 3.0.6 - express: 5.1.0 - express-rate-limit: 7.5.0(express@5.1.0) - pkce-challenge: 5.0.0 - raw-body: 3.0.0 - zod: 3.24.4 - zod-to-json-schema: 3.24.5(zod@3.24.4) + eventsource: 3.0.7 + eventsource-parser: 3.0.6 + express: 5.2.1 + express-rate-limit: 7.5.1(express@5.2.1) + jose: 6.1.3 + json-schema-typed: 8.0.2 + pkce-challenge: 5.0.1 + raw-body: 3.0.2 + zod: 4.2.1 + zod-to-json-schema: 3.25.0(zod@4.2.1) transitivePeerDependencies: + - hono - supports-color '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3': @@ -9567,72 +11182,92 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true - '@napi-rs/nice-android-arm-eabi@1.0.1': + '@mswjs/interceptors@0.39.8': + dependencies: + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + strict-event-emitter: 0.5.1 + + '@napi-rs/nice-android-arm-eabi@1.1.1': + optional: true + + '@napi-rs/nice-android-arm64@1.1.1': optional: true - '@napi-rs/nice-android-arm64@1.0.1': + '@napi-rs/nice-darwin-arm64@1.1.1': optional: true - '@napi-rs/nice-darwin-arm64@1.0.1': + '@napi-rs/nice-darwin-x64@1.1.1': optional: true - '@napi-rs/nice-darwin-x64@1.0.1': + '@napi-rs/nice-freebsd-x64@1.1.1': optional: true - '@napi-rs/nice-freebsd-x64@1.0.1': + '@napi-rs/nice-linux-arm-gnueabihf@1.1.1': optional: true - '@napi-rs/nice-linux-arm-gnueabihf@1.0.1': + '@napi-rs/nice-linux-arm64-gnu@1.1.1': optional: true - '@napi-rs/nice-linux-arm64-gnu@1.0.1': + '@napi-rs/nice-linux-arm64-musl@1.1.1': optional: true - '@napi-rs/nice-linux-arm64-musl@1.0.1': + '@napi-rs/nice-linux-ppc64-gnu@1.1.1': optional: true - '@napi-rs/nice-linux-ppc64-gnu@1.0.1': + '@napi-rs/nice-linux-riscv64-gnu@1.1.1': optional: true - '@napi-rs/nice-linux-riscv64-gnu@1.0.1': + '@napi-rs/nice-linux-s390x-gnu@1.1.1': optional: true - '@napi-rs/nice-linux-s390x-gnu@1.0.1': + '@napi-rs/nice-linux-x64-gnu@1.1.1': optional: true - '@napi-rs/nice-linux-x64-gnu@1.0.1': + '@napi-rs/nice-linux-x64-musl@1.1.1': optional: true - '@napi-rs/nice-linux-x64-musl@1.0.1': + '@napi-rs/nice-openharmony-arm64@1.1.1': optional: true - '@napi-rs/nice-win32-arm64-msvc@1.0.1': + '@napi-rs/nice-win32-arm64-msvc@1.1.1': optional: true - '@napi-rs/nice-win32-ia32-msvc@1.0.1': + '@napi-rs/nice-win32-ia32-msvc@1.1.1': optional: true - '@napi-rs/nice-win32-x64-msvc@1.0.1': + '@napi-rs/nice-win32-x64-msvc@1.1.1': optional: true - '@napi-rs/nice@1.0.1': + '@napi-rs/nice@1.1.1': optionalDependencies: - '@napi-rs/nice-android-arm-eabi': 1.0.1 - '@napi-rs/nice-android-arm64': 1.0.1 - '@napi-rs/nice-darwin-arm64': 1.0.1 - '@napi-rs/nice-darwin-x64': 1.0.1 - '@napi-rs/nice-freebsd-x64': 1.0.1 - '@napi-rs/nice-linux-arm-gnueabihf': 1.0.1 - '@napi-rs/nice-linux-arm64-gnu': 1.0.1 - '@napi-rs/nice-linux-arm64-musl': 1.0.1 - '@napi-rs/nice-linux-ppc64-gnu': 1.0.1 - '@napi-rs/nice-linux-riscv64-gnu': 1.0.1 - '@napi-rs/nice-linux-s390x-gnu': 1.0.1 - '@napi-rs/nice-linux-x64-gnu': 1.0.1 - '@napi-rs/nice-linux-x64-musl': 1.0.1 - '@napi-rs/nice-win32-arm64-msvc': 1.0.1 - '@napi-rs/nice-win32-ia32-msvc': 1.0.1 - '@napi-rs/nice-win32-x64-msvc': 1.0.1 + '@napi-rs/nice-android-arm-eabi': 1.1.1 + '@napi-rs/nice-android-arm64': 1.1.1 + '@napi-rs/nice-darwin-arm64': 1.1.1 + '@napi-rs/nice-darwin-x64': 1.1.1 + '@napi-rs/nice-freebsd-x64': 1.1.1 + '@napi-rs/nice-linux-arm-gnueabihf': 1.1.1 + '@napi-rs/nice-linux-arm64-gnu': 1.1.1 + '@napi-rs/nice-linux-arm64-musl': 1.1.1 + '@napi-rs/nice-linux-ppc64-gnu': 1.1.1 + '@napi-rs/nice-linux-riscv64-gnu': 1.1.1 + '@napi-rs/nice-linux-s390x-gnu': 1.1.1 + '@napi-rs/nice-linux-x64-gnu': 1.1.1 + '@napi-rs/nice-linux-x64-musl': 1.1.1 + '@napi-rs/nice-openharmony-arm64': 1.1.1 + '@napi-rs/nice-win32-arm64-msvc': 1.1.1 + '@napi-rs/nice-win32-ia32-msvc': 1.1.1 + '@napi-rs/nice-win32-x64-msvc': 1.1.1 + optional: true + + '@napi-rs/wasm-runtime@1.1.0': + dependencies: + '@emnapi/core': 1.7.1 + '@emnapi/runtime': 1.7.1 + '@tybys/wasm-util': 0.10.1 optional: true '@nodelib/fs.scandir@2.1.5': @@ -9647,147 +11282,198 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@npmcli/agent@3.0.0': + '@npmcli/agent@4.0.0': dependencies: - agent-base: 7.1.3 + agent-base: 7.1.4 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@10.0.0) - lru-cache: 10.4.3 + https-proxy-agent: 7.0.6(supports-color@10.2.2) + lru-cache: 11.2.4 socks-proxy-agent: 8.0.5 transitivePeerDependencies: - supports-color - '@npmcli/fs@4.0.0': + '@npmcli/fs@5.0.0': dependencies: - semver: 7.7.1 + semver: 7.7.3 - '@npmcli/git@6.0.3': + '@npmcli/git@7.0.1': dependencies: - '@npmcli/promise-spawn': 8.0.2 - ini: 5.0.0 - lru-cache: 10.4.3 - npm-pick-manifest: 10.0.0 - proc-log: 5.0.0 + '@npmcli/promise-spawn': 9.0.1 + ini: 6.0.0 + lru-cache: 11.2.4 + npm-pick-manifest: 11.0.3 + proc-log: 6.1.0 promise-retry: 2.0.1 - semver: 7.7.1 - which: 5.0.0 + semver: 7.7.3 + which: 6.0.0 - '@npmcli/installed-package-contents@3.0.0': + '@npmcli/installed-package-contents@4.0.0': dependencies: - npm-bundled: 4.0.0 - npm-normalize-package-bin: 4.0.0 + npm-bundled: 5.0.0 + npm-normalize-package-bin: 5.0.0 - '@npmcli/node-gyp@4.0.0': {} + '@npmcli/node-gyp@5.0.0': {} - '@npmcli/package-json@6.1.1': + '@npmcli/package-json@7.0.4': dependencies: - '@npmcli/git': 6.0.3 - glob: 10.4.5 - hosted-git-info: 8.1.0 - json-parse-even-better-errors: 4.0.0 - proc-log: 5.0.0 - semver: 7.7.1 + '@npmcli/git': 7.0.1 + glob: 13.0.0 + hosted-git-info: 9.0.2 + json-parse-even-better-errors: 5.0.0 + proc-log: 6.1.0 + semver: 7.7.3 validate-npm-package-license: 3.0.4 - '@npmcli/promise-spawn@8.0.2': + '@npmcli/promise-spawn@9.0.1': dependencies: - which: 5.0.0 + which: 6.0.0 - '@npmcli/redact@3.2.2': {} + '@npmcli/redact@4.0.0': {} - '@npmcli/run-script@9.1.0': + '@npmcli/run-script@10.0.3': dependencies: - '@npmcli/node-gyp': 4.0.0 - '@npmcli/package-json': 6.1.1 - '@npmcli/promise-spawn': 8.0.2 - node-gyp: 11.2.0 - proc-log: 5.0.0 - which: 5.0.0 + '@npmcli/node-gyp': 5.0.0 + '@npmcli/package-json': 7.0.4 + '@npmcli/promise-spawn': 9.0.1 + node-gyp: 12.1.0 + proc-log: 6.1.0 + which: 6.0.0 transitivePeerDependencies: - supports-color - '@octokit/auth-token@5.1.2': {} + '@octokit/auth-app@8.1.2': + dependencies: + '@octokit/auth-oauth-app': 9.0.3 + '@octokit/auth-oauth-user': 6.0.2 + '@octokit/request': 10.0.7 + '@octokit/request-error': 7.1.0 + '@octokit/types': 16.0.0 + toad-cache: 3.7.0 + universal-github-app-jwt: 2.2.2 + universal-user-agent: 7.0.3 + + '@octokit/auth-oauth-app@9.0.3': + dependencies: + '@octokit/auth-oauth-device': 8.0.3 + '@octokit/auth-oauth-user': 6.0.2 + '@octokit/request': 10.0.7 + '@octokit/types': 16.0.0 + universal-user-agent: 7.0.3 + + '@octokit/auth-oauth-device@8.0.3': + dependencies: + '@octokit/oauth-methods': 6.0.2 + '@octokit/request': 10.0.7 + '@octokit/types': 16.0.0 + universal-user-agent: 7.0.3 + + '@octokit/auth-oauth-user@6.0.2': + dependencies: + '@octokit/auth-oauth-device': 8.0.3 + '@octokit/oauth-methods': 6.0.2 + '@octokit/request': 10.0.7 + '@octokit/types': 16.0.0 + universal-user-agent: 7.0.3 + + '@octokit/auth-token@6.0.0': {} + + '@octokit/core@7.0.6': + dependencies: + '@octokit/auth-token': 6.0.0 + '@octokit/graphql': 9.0.3 + '@octokit/request': 10.0.7 + '@octokit/request-error': 7.1.0 + '@octokit/types': 16.0.0 + before-after-hook: 4.0.0 + universal-user-agent: 7.0.3 - '@octokit/core@6.1.5': + '@octokit/endpoint@11.0.2': dependencies: - '@octokit/auth-token': 5.1.2 - '@octokit/graphql': 8.2.2 - '@octokit/request': 9.2.3 - '@octokit/request-error': 6.1.8 - '@octokit/types': 14.0.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 + '@octokit/types': 16.0.0 + universal-user-agent: 7.0.3 - '@octokit/endpoint@10.1.4': + '@octokit/graphql-schema@15.26.1': dependencies: - '@octokit/types': 14.0.0 - universal-user-agent: 7.0.2 + graphql: 16.12.0 + graphql-tag: 2.12.6(graphql@16.12.0) - '@octokit/graphql@8.2.2': + '@octokit/graphql@9.0.3': dependencies: - '@octokit/request': 9.2.3 - '@octokit/types': 14.0.0 - universal-user-agent: 7.0.2 + '@octokit/request': 10.0.7 + '@octokit/types': 16.0.0 + universal-user-agent: 7.0.3 + + '@octokit/oauth-authorization-url@8.0.0': {} - '@octokit/openapi-types@24.2.0': {} + '@octokit/oauth-methods@6.0.2': + dependencies: + '@octokit/oauth-authorization-url': 8.0.0 + '@octokit/request': 10.0.7 + '@octokit/request-error': 7.1.0 + '@octokit/types': 16.0.0 - '@octokit/openapi-types@25.0.0': {} + '@octokit/openapi-types@27.0.0': {} - '@octokit/plugin-paginate-rest@11.6.0(@octokit/core@6.1.5)': + '@octokit/plugin-paginate-rest@14.0.0(@octokit/core@7.0.6)': dependencies: - '@octokit/core': 6.1.5 - '@octokit/types': 13.10.0 + '@octokit/core': 7.0.6 + '@octokit/types': 16.0.0 - '@octokit/plugin-request-log@5.3.1(@octokit/core@6.1.5)': + '@octokit/plugin-request-log@6.0.0(@octokit/core@7.0.6)': dependencies: - '@octokit/core': 6.1.5 + '@octokit/core': 7.0.6 - '@octokit/plugin-rest-endpoint-methods@13.5.0(@octokit/core@6.1.5)': + '@octokit/plugin-rest-endpoint-methods@17.0.0(@octokit/core@7.0.6)': dependencies: - '@octokit/core': 6.1.5 - '@octokit/types': 13.10.0 + '@octokit/core': 7.0.6 + '@octokit/types': 16.0.0 - '@octokit/request-error@6.1.8': + '@octokit/request-error@7.1.0': dependencies: - '@octokit/types': 14.0.0 + '@octokit/types': 16.0.0 - '@octokit/request@9.2.3': + '@octokit/request@10.0.7': dependencies: - '@octokit/endpoint': 10.1.4 - '@octokit/request-error': 6.1.8 - '@octokit/types': 14.0.0 - fast-content-type-parse: 2.0.1 - universal-user-agent: 7.0.2 + '@octokit/endpoint': 11.0.2 + '@octokit/request-error': 7.1.0 + '@octokit/types': 16.0.0 + fast-content-type-parse: 3.0.0 + universal-user-agent: 7.0.3 - '@octokit/rest@21.1.1': + '@octokit/rest@22.0.1': dependencies: - '@octokit/core': 6.1.5 - '@octokit/plugin-paginate-rest': 11.6.0(@octokit/core@6.1.5) - '@octokit/plugin-request-log': 5.3.1(@octokit/core@6.1.5) - '@octokit/plugin-rest-endpoint-methods': 13.5.0(@octokit/core@6.1.5) + '@octokit/core': 7.0.6 + '@octokit/plugin-paginate-rest': 14.0.0(@octokit/core@7.0.6) + '@octokit/plugin-request-log': 6.0.0(@octokit/core@7.0.6) + '@octokit/plugin-rest-endpoint-methods': 17.0.0(@octokit/core@7.0.6) - '@octokit/types@13.10.0': + '@octokit/types@16.0.0': dependencies: - '@octokit/openapi-types': 24.2.0 + '@octokit/openapi-types': 27.0.0 + + '@open-draft/deferred-promise@2.2.0': {} - '@octokit/types@14.0.0': + '@open-draft/logger@0.3.0': dependencies: - '@octokit/openapi-types': 25.0.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + + '@open-draft/until@2.1.0': {} '@opentelemetry/api@1.9.0': {} - '@opentelemetry/context-async-hooks@1.30.1(@opentelemetry/api@1.9.0)': + '@opentelemetry/context-async-hooks@2.2.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 - '@opentelemetry/core@1.30.1(@opentelemetry/api@1.9.0)': + '@opentelemetry/core@2.2.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 - '@opentelemetry/semantic-conventions': 1.28.0 + '@opentelemetry/semantic-conventions': 1.38.0 - '@opentelemetry/semantic-conventions@1.28.0': {} + '@opentelemetry/semantic-conventions@1.38.0': {} - '@opentelemetry/semantic-conventions@1.32.0': {} + '@oxc-project/types@0.102.0': {} '@parcel/watcher-android-arm64@2.5.1': optional: true @@ -9850,9 +11536,31 @@ snapshots: '@parcel/watcher-win32-x64': 2.5.1 optional: true + '@pinojs/redact@0.4.0': {} + '@pkgjs/parseargs@0.11.0': optional: true + '@pnpm/crypto.hash@1000.2.1': + dependencies: + '@pnpm/crypto.polyfill': 1000.1.0 + '@pnpm/graceful-fs': 1000.0.1 + ssri: 10.0.5 + + '@pnpm/crypto.polyfill@1000.1.0': {} + + '@pnpm/dependency-path@1001.1.8': + dependencies: + '@pnpm/crypto.hash': 1000.2.1 + '@pnpm/types': 1001.2.0 + semver: 7.7.3 + + '@pnpm/graceful-fs@1000.0.1': + dependencies: + graceful-fs: 4.2.11 + + '@pnpm/types@1001.2.0': {} + '@protobufjs/aspromise@1.1.2': {} '@protobufjs/base64@1.1.2': {} @@ -9876,188 +11584,253 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@puppeteer/browsers@2.10.3': + '@puppeteer/browsers@2.11.0': dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.5.0 - semver: 7.7.1 - tar-fs: 3.0.8 + semver: 7.7.3 + tar-fs: 3.1.1 yargs: 17.7.2 transitivePeerDependencies: + - bare-abort-controller - bare-buffer + - react-native-b4a - supports-color - '@rollup/plugin-alias@5.1.1(rollup@4.40.2)': + '@rolldown/binding-android-arm64@1.0.0-beta.54': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-beta.54': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.54': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.54': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.54': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.54': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.54': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.54': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.54': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.54': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.54': + dependencies: + '@napi-rs/wasm-runtime': 1.1.0 + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.54': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.54': + optional: true + + '@rolldown/pluginutils@1.0.0-beta.54': {} + + '@rollup/plugin-alias@6.0.0(rollup@4.53.5)': optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 - '@rollup/plugin-commonjs@28.0.3(rollup@4.40.2)': + '@rollup/plugin-commonjs@29.0.0(rollup@4.53.5)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + '@rollup/pluginutils': 5.3.0(rollup@4.53.5) commondir: 1.0.1 estree-walker: 2.0.2 - fdir: 6.4.4(picomatch@4.0.2) + fdir: 6.5.0(picomatch@4.0.3) is-reference: 1.2.1 - magic-string: 0.30.17 - picomatch: 4.0.2 + magic-string: 0.30.21 + picomatch: 4.0.3 optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 - '@rollup/plugin-json@6.1.0(rollup@4.40.2)': + '@rollup/plugin-json@6.1.0(rollup@4.53.5)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + '@rollup/pluginutils': 5.3.0(rollup@4.53.5) optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 - '@rollup/plugin-node-resolve@15.3.1(rollup@4.40.2)': + '@rollup/plugin-node-resolve@15.3.1(rollup@4.53.5)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + '@rollup/pluginutils': 5.3.0(rollup@4.53.5) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.10 + resolve: 1.22.11 optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 - '@rollup/plugin-node-resolve@16.0.1(rollup@4.40.2)': + '@rollup/plugin-node-resolve@16.0.3(rollup@4.53.5)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + '@rollup/pluginutils': 5.3.0(rollup@4.53.5) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.10 + resolve: 1.22.11 + optionalDependencies: + rollup: 4.53.5 + + '@rollup/pluginutils@5.2.0(rollup@4.53.5)': + dependencies: + '@types/estree': 1.0.8 + estree-walker: 2.0.2 + picomatch: 4.0.3 optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 - '@rollup/pluginutils@5.1.4(rollup@4.40.2)': + '@rollup/pluginutils@5.3.0(rollup@4.53.5)': dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 estree-walker: 2.0.2 - picomatch: 4.0.2 + picomatch: 4.0.3 optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 + + '@rollup/rollup-android-arm-eabi@4.53.5': + optional: true + + '@rollup/rollup-android-arm64@4.53.5': + optional: true - '@rollup/rollup-android-arm-eabi@4.40.2': + '@rollup/rollup-darwin-arm64@4.53.5': optional: true - '@rollup/rollup-android-arm64@4.40.2': + '@rollup/rollup-darwin-x64@4.53.5': optional: true - '@rollup/rollup-darwin-arm64@4.40.2': + '@rollup/rollup-freebsd-arm64@4.53.5': optional: true - '@rollup/rollup-darwin-x64@4.40.2': + '@rollup/rollup-freebsd-x64@4.53.5': optional: true - '@rollup/rollup-freebsd-arm64@4.40.2': + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': optional: true - '@rollup/rollup-freebsd-x64@4.40.2': + '@rollup/rollup-linux-arm-musleabihf@4.53.5': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.40.2': + '@rollup/rollup-linux-arm64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.40.2': + '@rollup/rollup-linux-arm64-musl@4.53.5': optional: true - '@rollup/rollup-linux-arm64-gnu@4.40.2': + '@rollup/rollup-linux-loong64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-arm64-musl@4.40.2': + '@rollup/rollup-linux-ppc64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.40.2': + '@rollup/rollup-linux-riscv64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.40.2': + '@rollup/rollup-linux-riscv64-musl@4.53.5': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.40.2': + '@rollup/rollup-linux-s390x-gnu@4.53.5': optional: true - '@rollup/rollup-linux-riscv64-musl@4.40.2': + '@rollup/rollup-linux-x64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-s390x-gnu@4.40.2': + '@rollup/rollup-linux-x64-musl@4.53.5': optional: true - '@rollup/rollup-linux-x64-gnu@4.40.2': + '@rollup/rollup-openharmony-arm64@4.53.5': optional: true - '@rollup/rollup-linux-x64-musl@4.40.2': + '@rollup/rollup-win32-arm64-msvc@4.53.5': optional: true - '@rollup/rollup-win32-arm64-msvc@4.40.2': + '@rollup/rollup-win32-ia32-msvc@4.53.5': optional: true - '@rollup/rollup-win32-ia32-msvc@4.40.2': + '@rollup/rollup-win32-x64-gnu@4.53.5': optional: true - '@rollup/rollup-win32-x64-msvc@4.40.2': + '@rollup/rollup-win32-x64-msvc@4.53.5': optional: true - '@rollup/wasm-node@4.40.2': + '@rollup/wasm-node@4.54.0': dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 optionalDependencies: fsevents: 2.3.3 '@rtsao/scc@1.1.0': {} - '@sigstore/bundle@3.1.0': + '@sigstore/bundle@4.0.0': dependencies: - '@sigstore/protobuf-specs': 0.4.1 + '@sigstore/protobuf-specs': 0.5.0 - '@sigstore/core@2.0.0': {} + '@sigstore/core@3.1.0': {} - '@sigstore/protobuf-specs@0.4.1': {} + '@sigstore/protobuf-specs@0.5.0': {} - '@sigstore/sign@3.1.0': + '@sigstore/sign@4.1.0': dependencies: - '@sigstore/bundle': 3.1.0 - '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.1 - make-fetch-happen: 14.0.3 - proc-log: 5.0.0 + '@sigstore/bundle': 4.0.0 + '@sigstore/core': 3.1.0 + '@sigstore/protobuf-specs': 0.5.0 + make-fetch-happen: 15.0.3 + proc-log: 6.1.0 promise-retry: 2.0.1 transitivePeerDependencies: - supports-color - '@sigstore/tuf@3.1.1': + '@sigstore/tuf@4.0.1': dependencies: - '@sigstore/protobuf-specs': 0.4.1 - tuf-js: 3.0.1 + '@sigstore/protobuf-specs': 0.5.0 + tuf-js: 4.1.0 transitivePeerDependencies: - supports-color - '@sigstore/verify@2.1.1': + '@sigstore/verify@3.1.0': dependencies: - '@sigstore/bundle': 3.1.0 - '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.1 + '@sigstore/bundle': 4.0.0 + '@sigstore/core': 3.1.0 + '@sigstore/protobuf-specs': 0.5.0 + + '@sindresorhus/is@4.6.0': {} '@socket.io/component-emitter@3.1.2': {} - '@stylistic/eslint-plugin@4.2.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3)': + '@standard-schema/spec@1.1.0': {} + + '@stylistic/eslint-plugin@5.6.1(eslint@9.39.2(jiti@2.6.1))': dependencies: - '@typescript-eslint/utils': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) - eslint: 9.26.0(jiti@1.21.7) - eslint-visitor-keys: 4.2.0 - espree: 10.3.0 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) + '@typescript-eslint/types': 8.50.0 + eslint: 9.39.2(jiti@2.6.1) + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 estraverse: 5.3.0 - picomatch: 4.0.2 - transitivePeerDependencies: - - supports-color - - typescript + picomatch: 4.0.3 + + '@szmarczak/http-timer@4.0.6': + dependencies: + defer-to-connect: 2.0.1 '@tootallnate/once@2.0.0': {} '@tootallnate/quickjs-emscripten@0.23.0': {} - '@tsconfig/node10@1.0.11': {} + '@tsconfig/node10@1.0.12': {} '@tsconfig/node12@1.0.11': {} @@ -10067,150 +11840,169 @@ snapshots: '@tufjs/canonical-json@2.0.0': {} - '@tufjs/models@3.0.1': + '@tufjs/models@4.1.0': dependencies: '@tufjs/canonical-json': 2.0.0 - minimatch: 9.0.5 + minimatch: 10.1.1 + + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 + optional: true '@types/accepts@1.3.7': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/babel__code-frame@7.0.6': {} '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.27.2 - '@babel/types': 7.27.1 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.7 + '@types/babel__traverse': 7.28.0 '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.27.2 - '@babel/types': 7.27.1 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 - '@types/babel__traverse@7.20.7': + '@types/babel__traverse@7.28.0': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@types/big.js@6.2.2': {} - '@types/body-parser@1.19.5': + '@types/body-parser@1.19.6': dependencies: '@types/connect': 3.4.38 - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/bonjour@3.5.13': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 - '@types/browser-sync@2.29.0': + '@types/browser-sync@2.29.1': dependencies: '@types/micromatch': 2.3.35 - '@types/node': 20.17.44 - '@types/serve-static': 1.15.7 + '@types/node': 22.19.3 + '@types/serve-static': 2.2.0 chokidar: 3.6.0 - '@types/caseless@0.12.5': {} + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/cli-progress@3.11.6': + dependencies: + '@types/node': 22.19.3 '@types/co-body@6.1.3': dependencies: - '@types/node': 20.17.44 - '@types/qs': 6.9.18 + '@types/node': 22.19.3 + '@types/qs': 6.14.0 '@types/command-line-args@5.2.3': {} '@types/connect-history-api-fallback@1.5.4': dependencies: - '@types/express-serve-static-core': 4.19.6 - '@types/node': 20.17.44 + '@types/express-serve-static-core': 4.19.7 + '@types/node': 22.19.3 '@types/connect@3.4.38': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 - '@types/content-disposition@0.5.8': {} + '@types/content-disposition@0.5.9': {} '@types/convert-source-map@2.0.3': {} - '@types/cookies@0.9.0': + '@types/cookies@0.9.2': dependencies: '@types/connect': 3.4.38 - '@types/express': 5.0.1 + '@types/express': 5.0.6 '@types/keygrip': 1.0.6 - '@types/node': 20.17.44 + '@types/node': 22.19.3 - '@types/cors@2.8.17': + '@types/cors@2.8.19': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/debounce@1.2.4': {} - '@types/duplexify@3.6.4': + '@types/deep-eql@4.0.2': {} + + '@types/duplexify@3.6.5': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 + + '@types/ejs@3.1.5': {} '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.1 - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 '@types/eslint@9.6.1': dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 '@types/json-schema': 7.0.15 - '@types/estree@1.0.7': {} + '@types/estree@1.0.8': {} + + '@types/events@3.0.3': {} - '@types/express-serve-static-core@4.19.6': + '@types/express-serve-static-core@4.19.7': dependencies: - '@types/node': 20.17.44 - '@types/qs': 6.9.18 + '@types/node': 22.19.3 + '@types/qs': 6.14.0 '@types/range-parser': 1.2.7 - '@types/send': 0.17.4 + '@types/send': 1.2.1 - '@types/express-serve-static-core@5.0.6': + '@types/express-serve-static-core@5.1.0': dependencies: - '@types/node': 20.17.44 - '@types/qs': 6.9.18 + '@types/node': 22.19.3 + '@types/qs': 6.14.0 '@types/range-parser': 1.2.7 - '@types/send': 0.17.4 + '@types/send': 1.2.1 - '@types/express@4.17.21': + '@types/express@4.17.25': dependencies: - '@types/body-parser': 1.19.5 - '@types/express-serve-static-core': 4.19.6 - '@types/qs': 6.9.18 - '@types/serve-static': 1.15.7 + '@types/body-parser': 1.19.6 + '@types/express-serve-static-core': 4.19.7 + '@types/qs': 6.14.0 + '@types/serve-static': 1.15.10 - '@types/express@5.0.1': + '@types/express@5.0.6': dependencies: - '@types/body-parser': 1.19.5 - '@types/express-serve-static-core': 5.0.6 - '@types/serve-static': 1.15.7 + '@types/body-parser': 1.19.6 + '@types/express-serve-static-core': 5.1.0 + '@types/serve-static': 2.2.0 - '@types/glob@7.2.0': + '@types/folder-hash@4.0.4': {} + + '@types/git-raw-commits@5.0.1': dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/http-assert@1.5.6': {} - '@types/http-errors@2.0.4': {} + '@types/http-errors@2.0.5': {} - '@types/http-proxy@1.17.16': + '@types/http-proxy@1.17.17': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/ini@4.1.1': {} @@ -10226,9 +12018,9 @@ snapshots: '@types/jasmine-reporters@2.5.3': dependencies: - '@types/jasmine': 5.1.8 + '@types/jasmine': 5.1.13 - '@types/jasmine@5.1.8': {} + '@types/jasmine@5.1.13': {} '@types/json-schema@7.0.15': {} @@ -10236,38 +12028,41 @@ snapshots: '@types/karma@6.3.9': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 log4js: 6.9.1 transitivePeerDependencies: - supports-color '@types/keygrip@1.0.6': {} - '@types/koa-compose@3.2.8': + '@types/koa-compose@3.2.9': dependencies: '@types/koa': 2.15.0 '@types/koa@2.15.0': dependencies: '@types/accepts': 1.3.7 - '@types/content-disposition': 0.5.8 - '@types/cookies': 0.9.0 + '@types/content-disposition': 0.5.9 + '@types/cookies': 0.9.2 '@types/http-assert': 1.5.6 - '@types/http-errors': 2.0.4 + '@types/http-errors': 2.0.5 '@types/keygrip': 1.0.6 - '@types/koa-compose': 3.2.8 - '@types/node': 20.17.44 + '@types/koa-compose': 3.2.9 + '@types/node': 22.19.3 '@types/less@3.0.8': {} - '@types/loader-utils@2.0.6': + '@types/loader-utils@3.0.0(esbuild@0.27.1)': dependencies: - '@types/node': 20.17.44 - '@types/webpack': 4.41.40 - - '@types/lodash@4.17.16': {} + '@types/node': 22.19.3 + webpack: 5.104.0(esbuild@0.27.1) + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + - webpack-cli - '@types/long@4.0.2': {} + '@types/lodash@4.17.21': {} '@types/micromatch@2.3.35': dependencies: @@ -10275,39 +12070,41 @@ snapshots: '@types/mime@1.3.5': {} - '@types/minimatch@5.1.2': {} + '@types/node-fetch@2.6.13': + dependencies: + '@types/node': 22.19.3 + form-data: 4.0.5 - '@types/node-fetch@2.6.12': + '@types/node-forge@1.3.14': dependencies: - '@types/node': 20.17.44 - form-data: 4.0.2 + '@types/node': 22.19.3 - '@types/node-forge@1.3.11': + '@types/node@22.19.3': dependencies: - '@types/node': 20.17.44 + undici-types: 7.16.0 - '@types/node@20.17.44': + '@types/node@24.10.4': dependencies: - undici-types: 6.19.8 + undici-types: 7.16.0 '@types/npm-package-arg@6.1.4': {} - '@types/npm-registry-fetch@8.0.8': + '@types/npm-registry-fetch@8.0.9': dependencies: - '@types/node': 20.17.44 - '@types/node-fetch': 2.6.12 + '@types/node': 22.19.3 + '@types/node-fetch': 2.6.13 '@types/npm-package-arg': 6.1.4 '@types/npmlog': 7.0.0 '@types/ssri': 7.1.5 '@types/npmlog@7.0.0': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/pacote@11.1.8': dependencies: - '@types/node': 20.17.44 - '@types/npm-registry-fetch': 8.0.8 + '@types/node': 22.19.3 + '@types/npm-registry-fetch': 8.0.9 '@types/npmlog': 7.0.0 '@types/ssri': 7.1.5 @@ -10315,115 +12112,93 @@ snapshots: '@types/parse5@6.0.3': {} - '@types/picomatch@4.0.0': {} + '@types/picomatch@4.0.2': {} '@types/progress@2.0.7': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 - '@types/pumpify@1.4.4': + '@types/pumpify@1.4.5': dependencies: - '@types/duplexify': 3.6.4 - '@types/node': 20.17.44 + '@types/duplexify': 3.6.5 + '@types/node': 22.19.3 '@types/q@0.0.32': {} - '@types/qs@6.9.18': {} + '@types/qs@6.14.0': {} '@types/range-parser@1.2.7': {} - '@types/request@2.48.12': - dependencies: - '@types/caseless': 0.12.5 - '@types/node': 20.17.44 - '@types/tough-cookie': 4.0.5 - form-data: 2.5.3 - '@types/resolve@1.20.2': {} '@types/resolve@1.20.6': {} + '@types/responselike@1.0.0': + dependencies: + '@types/node': 22.19.3 + '@types/retry@0.12.2': {} '@types/selenium-webdriver@3.0.26': {} - '@types/semver@7.7.0': {} + '@types/semver@7.7.1': {} - '@types/send@0.17.4': + '@types/send@0.17.6': dependencies: '@types/mime': 1.3.5 - '@types/node': 20.17.44 + '@types/node': 22.19.3 + + '@types/send@1.2.1': + dependencies: + '@types/node': 22.19.3 '@types/serve-index@1.9.4': dependencies: - '@types/express': 5.0.1 + '@types/express': 5.0.6 - '@types/serve-static@1.15.7': + '@types/serve-static@1.15.10': dependencies: - '@types/http-errors': 2.0.4 - '@types/node': 20.17.44 - '@types/send': 0.17.4 + '@types/http-errors': 2.0.5 + '@types/node': 22.19.3 + '@types/send': 0.17.6 - '@types/shelljs@0.8.15': + '@types/serve-static@2.2.0': dependencies: - '@types/glob': 7.2.0 - '@types/node': 20.17.44 + '@types/http-errors': 2.0.5 + '@types/node': 22.19.3 '@types/sockjs@0.3.36': dependencies: - '@types/node': 20.17.44 - - '@types/source-list-map@0.1.6': {} + '@types/node': 22.19.3 '@types/ssri@7.1.5': dependencies: - '@types/node': 20.17.44 - - '@types/stack-trace@0.0.33': {} - - '@types/supports-color@10.0.0': - dependencies: - supports-color: 10.0.0 + '@types/node': 22.19.3 - '@types/tapable@1.0.12': {} - - '@types/tough-cookie@4.0.5': {} + '@types/stack-trace@0.0.33': {} - '@types/uglify-js@3.17.5': + '@types/tar-stream@3.1.4': dependencies: - source-map: 0.6.1 + '@types/node': 22.19.3 - '@types/watchpack@2.4.4': + '@types/watchpack@2.4.5': dependencies: '@types/graceful-fs': 4.1.9 - '@types/node': 20.17.44 - - '@types/webpack-sources@3.2.3': - dependencies: - '@types/node': 20.17.44 - '@types/source-list-map': 0.1.6 - source-map: 0.7.4 + '@types/node': 22.19.3 - '@types/webpack@4.41.40': - dependencies: - '@types/node': 20.17.44 - '@types/tapable': 1.0.12 - '@types/uglify-js': 3.17.5 - '@types/webpack-sources': 3.2.3 - anymatch: 3.1.3 - source-map: 0.6.1 + '@types/which@3.0.4': {} '@types/ws@7.4.7': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/ws@8.18.1': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 '@types/yargs-parser@21.0.3': {} - '@types/yargs@17.0.33': + '@types/yargs@17.0.35': dependencies: '@types/yargs-parser': 21.0.3 @@ -10431,276 +12206,316 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 optional: true - '@typescript-eslint/eslint-plugin@8.32.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.50.0(@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) - '@typescript-eslint/scope-manager': 8.32.0 - '@typescript-eslint/type-utils': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) - '@typescript-eslint/utils': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.32.0 - eslint: 9.26.0(jiti@1.21.7) - graphemer: 1.4.0 - ignore: 5.3.2 + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.50.0 + '@typescript-eslint/type-utils': 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/utils': 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.50.0 + eslint: 9.39.2(jiti@2.6.1) + ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.50.0 + '@typescript-eslint/types': 8.50.0 + '@typescript-eslint/typescript-estree': 8.50.0(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.50.0 + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/project-service@8.50.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/scope-manager': 8.32.0 - '@typescript-eslint/types': 8.32.0 - '@typescript-eslint/typescript-estree': 8.32.0(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.32.0 - debug: 4.4.0(supports-color@10.0.0) - eslint: 9.26.0(jiti@1.21.7) - typescript: 5.8.3 + '@typescript-eslint/tsconfig-utils': 8.50.0(typescript@5.9.3) + '@typescript-eslint/types': 8.50.0 + debug: 4.4.3(supports-color@10.2.2) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.32.0': + '@typescript-eslint/scope-manager@8.50.0': + dependencies: + '@typescript-eslint/types': 8.50.0 + '@typescript-eslint/visitor-keys': 8.50.0 + + '@typescript-eslint/tsconfig-utils@8.50.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/types': 8.32.0 - '@typescript-eslint/visitor-keys': 8.32.0 + typescript: 5.9.3 - '@typescript-eslint/type-utils@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.32.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) - debug: 4.4.0(supports-color@10.0.0) - eslint: 9.26.0(jiti@1.21.7) - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + '@typescript-eslint/types': 8.50.0 + '@typescript-eslint/typescript-estree': 8.50.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.39.2(jiti@2.6.1) + ts-api-utils: 2.1.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.32.0': {} + '@typescript-eslint/types@8.50.0': {} - '@typescript-eslint/typescript-estree@8.32.0(typescript@5.8.3)': + '@typescript-eslint/typescript-estree@8.50.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/types': 8.32.0 - '@typescript-eslint/visitor-keys': 8.32.0 - debug: 4.4.0(supports-color@10.0.0) - fast-glob: 3.3.3 - is-glob: 4.0.3 + '@typescript-eslint/project-service': 8.50.0(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.50.0(typescript@5.9.3) + '@typescript-eslint/types': 8.50.0 + '@typescript-eslint/visitor-keys': 8.50.0 + debug: 4.4.3(supports-color@10.2.2) minimatch: 9.0.5 - semver: 7.7.1 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + semver: 7.7.3 + tinyglobby: 0.2.15 + ts-api-utils: 2.1.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3)': + '@typescript-eslint/utils@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.26.0(jiti@1.21.7)) - '@typescript-eslint/scope-manager': 8.32.0 - '@typescript-eslint/types': 8.32.0 - '@typescript-eslint/typescript-estree': 8.32.0(typescript@5.8.3) - eslint: 9.26.0(jiti@1.21.7) - typescript: 5.8.3 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) + '@typescript-eslint/scope-manager': 8.50.0 + '@typescript-eslint/types': 8.50.0 + '@typescript-eslint/typescript-estree': 8.50.0(typescript@5.9.3) + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.32.0': + '@typescript-eslint/visitor-keys@8.50.0': dependencies: - '@typescript-eslint/types': 8.32.0 - eslint-visitor-keys: 4.2.0 + '@typescript-eslint/types': 8.50.0 + eslint-visitor-keys: 4.2.1 - '@verdaccio/auth@8.0.0-next-8.15': + '@verdaccio/auth@8.0.0-next-8.28': dependencies: - '@verdaccio/config': 8.0.0-next-8.15 - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/loaders': 8.0.0-next-8.6 - '@verdaccio/signature': 8.0.0-next-8.7 - '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@10.0.0) + '@verdaccio/config': 8.0.0-next-8.28 + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/loaders': 8.0.0-next-8.18 + '@verdaccio/signature': 8.0.0-next-8.20 + debug: 4.4.3(supports-color@10.2.2) lodash: 4.17.21 - verdaccio-htpasswd: 13.0.0-next-8.15 + verdaccio-htpasswd: 13.0.0-next-8.28 transitivePeerDependencies: - supports-color - '@verdaccio/commons-api@10.2.0': - dependencies: - http-errors: 2.0.0 - http-status-codes: 2.2.0 - - '@verdaccio/config@8.0.0-next-8.15': + '@verdaccio/config@8.0.0-next-8.28': dependencies: - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@10.0.0) - js-yaml: 4.1.0 + '@verdaccio/core': 8.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) + js-yaml: 4.1.1 lodash: 4.17.21 - minimatch: 7.4.6 transitivePeerDependencies: - supports-color - '@verdaccio/core@8.0.0-next-8.15': + '@verdaccio/core@8.0.0-next-8.21': + dependencies: + ajv: 8.17.1 + http-errors: 2.0.0 + http-status-codes: 2.3.0 + minimatch: 7.4.6 + process-warning: 1.0.0 + semver: 7.7.2 + + '@verdaccio/core@8.0.0-next-8.28': dependencies: ajv: 8.17.1 - core-js: 3.40.0 http-errors: 2.0.0 http-status-codes: 2.3.0 + minimatch: 7.4.6 process-warning: 1.0.0 - semver: 7.7.1 + semver: 7.7.3 '@verdaccio/file-locking@10.3.1': dependencies: lockfile: 1.0.4 - '@verdaccio/file-locking@13.0.0-next-8.3': + '@verdaccio/file-locking@13.0.0-next-8.6': dependencies: lockfile: 1.0.4 - '@verdaccio/loaders@8.0.0-next-8.6': + '@verdaccio/hooks@8.0.0-next-8.28': + dependencies: + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/logger': 8.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) + got-cjs: 12.5.4 + handlebars: 4.7.8 + transitivePeerDependencies: + - supports-color + + '@verdaccio/loaders@8.0.0-next-8.18': dependencies: - debug: 4.4.0(supports-color@10.0.0) + '@verdaccio/core': 8.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) lodash: 4.17.21 transitivePeerDependencies: - supports-color - '@verdaccio/local-storage-legacy@11.0.2': + '@verdaccio/local-storage-legacy@11.1.1': dependencies: - '@verdaccio/commons-api': 10.2.0 + '@verdaccio/core': 8.0.0-next-8.21 '@verdaccio/file-locking': 10.3.1 '@verdaccio/streams': 10.2.1 - async: 3.2.4 - debug: 4.3.4 + async: 3.2.6 + debug: 4.4.1 lodash: 4.17.21 lowdb: 1.0.0 mkdirp: 1.0.4 transitivePeerDependencies: - supports-color - '@verdaccio/logger-commons@8.0.0-next-8.15': + '@verdaccio/logger-commons@8.0.0-next-8.28': dependencies: - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/logger-prettify': 8.0.0-next-8.2 + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/logger-prettify': 8.0.0-next-8.4 colorette: 2.0.20 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@verdaccio/logger-prettify@8.0.0-next-8.2': + '@verdaccio/logger-prettify@8.0.0-next-8.4': dependencies: colorette: 2.0.20 dayjs: 1.11.13 lodash: 4.17.21 + on-exit-leak-free: 2.1.2 pino-abstract-transport: 1.2.0 sonic-boom: 3.8.1 - '@verdaccio/logger@8.0.0-next-8.15': + '@verdaccio/logger@8.0.0-next-8.28': dependencies: - '@verdaccio/logger-commons': 8.0.0-next-8.15 - pino: 9.6.0 + '@verdaccio/logger-commons': 8.0.0-next-8.28 + pino: 9.14.0 transitivePeerDependencies: - supports-color - '@verdaccio/middleware@8.0.0-next-8.15': + '@verdaccio/middleware@8.0.0-next-8.28': dependencies: - '@verdaccio/config': 8.0.0-next-8.15 - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/url': 13.0.0-next-8.15 - '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@10.0.0) + '@verdaccio/config': 8.0.0-next-8.28 + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/url': 13.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) express: 4.21.2 express-rate-limit: 5.5.1 lodash: 4.17.21 lru-cache: 7.18.3 - mime: 2.6.0 transitivePeerDependencies: - supports-color - '@verdaccio/search-indexer@8.0.0-next-8.4': {} + '@verdaccio/search-indexer@8.0.0-next-8.5': {} - '@verdaccio/signature@8.0.0-next-8.7': + '@verdaccio/signature@8.0.0-next-8.20': dependencies: - '@verdaccio/config': 8.0.0-next-8.15 - debug: 4.4.0(supports-color@10.0.0) + '@verdaccio/config': 8.0.0-next-8.28 + '@verdaccio/core': 8.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) jsonwebtoken: 9.0.2 transitivePeerDependencies: - supports-color '@verdaccio/streams@10.2.1': {} - '@verdaccio/tarball@13.0.0-next-8.15': + '@verdaccio/tarball@13.0.0-next-8.28': dependencies: - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/url': 13.0.0-next-8.15 - '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@10.0.0) + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/url': 13.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) gunzip-maybe: 1.4.2 - lodash: 4.17.21 tar-stream: 3.1.7 transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a - supports-color - '@verdaccio/ui-theme@8.0.0-next-8.15': {} + '@verdaccio/ui-theme@8.0.0-next-8.28': {} - '@verdaccio/url@13.0.0-next-8.15': + '@verdaccio/url@13.0.0-next-8.28': dependencies: - '@verdaccio/core': 8.0.0-next-8.15 - debug: 4.4.0(supports-color@10.0.0) - lodash: 4.17.21 - validator: 13.12.0 + '@verdaccio/core': 8.0.0-next-8.28 + debug: 4.4.3(supports-color@10.2.2) + validator: 13.15.23 transitivePeerDependencies: - supports-color - '@verdaccio/utils@8.1.0-next-8.15': + '@verdaccio/utils@8.1.0-next-8.28': dependencies: - '@verdaccio/core': 8.0.0-next-8.15 + '@verdaccio/core': 8.0.0-next-8.28 lodash: 4.17.21 minimatch: 7.4.6 - semver: 7.7.1 - '@vitejs/plugin-basic-ssl@2.0.0(vite@6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1))': + '@vitejs/plugin-basic-ssl@2.1.0(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': dependencies: - vite: 6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) + vite: 7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) - '@vitest/expect@3.1.3': + '@vitest/coverage-v8@4.0.15(vitest@4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': dependencies: - '@vitest/spy': 3.1.3 - '@vitest/utils': 3.1.3 - chai: 5.2.0 - tinyrainbow: 2.0.0 + '@bcoe/v8-coverage': 1.0.2 + '@vitest/utils': 4.0.15 + ast-v8-to-istanbul: 0.3.9 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 5.0.6 + istanbul-reports: 3.2.0 + magicast: 0.5.1 + obug: 2.1.1 + std-env: 3.10.0 + tinyrainbow: 3.0.3 + vitest: 4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + transitivePeerDependencies: + - supports-color - '@vitest/mocker@3.1.3(vite@6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1))': + '@vitest/expect@4.0.15': dependencies: - '@vitest/spy': 3.1.3 + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.0.15 + '@vitest/utils': 4.0.15 + chai: 6.2.1 + tinyrainbow: 3.0.3 + + '@vitest/mocker@4.0.15(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': + dependencies: + '@vitest/spy': 4.0.15 estree-walker: 3.0.3 - magic-string: 0.30.17 + magic-string: 0.30.21 optionalDependencies: - vite: 6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) + vite: 7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) - '@vitest/pretty-format@3.1.3': + '@vitest/pretty-format@4.0.15': dependencies: - tinyrainbow: 2.0.0 + tinyrainbow: 3.0.3 - '@vitest/runner@3.1.3': + '@vitest/runner@4.0.15': dependencies: - '@vitest/utils': 3.1.3 + '@vitest/utils': 4.0.15 pathe: 2.0.3 - '@vitest/snapshot@3.1.3': + '@vitest/snapshot@4.0.15': dependencies: - '@vitest/pretty-format': 3.1.3 - magic-string: 0.30.17 + '@vitest/pretty-format': 4.0.15 + magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@3.1.3': - dependencies: - tinyspy: 3.0.2 + '@vitest/spy@4.0.15': {} - '@vitest/utils@3.1.3': + '@vitest/utils@4.0.15': dependencies: - '@vitest/pretty-format': 3.1.3 - loupe: 3.1.3 - tinyrainbow: 2.0.0 + '@vitest/pretty-format': 4.0.15 + tinyrainbow: 3.0.3 '@web/browser-logs@0.4.1': dependencies: @@ -10708,7 +12523,7 @@ snapshots: '@web/config-loader@0.3.3': {} - '@web/dev-server-core@0.7.5': + '@web/dev-server-core@0.7.5(bufferutil@4.0.9)': dependencies: '@types/koa': 2.15.0 '@types/ws': 7.4.7 @@ -10718,8 +12533,8 @@ snapshots: es-module-lexer: 1.7.0 get-stream: 6.0.1 is-stream: 2.0.1 - isbinaryfile: 5.0.4 - koa: 2.16.1 + isbinaryfile: 5.0.7 + koa: 2.16.3 koa-etag: 4.0.0 koa-send: 5.0.1 koa-static: 5.0.0 @@ -10727,32 +12542,32 @@ snapshots: mime-types: 2.1.35 parse5: 6.0.1 picomatch: 2.3.1 - ws: 7.5.10 + ws: 7.5.10(bufferutil@4.0.9) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - '@web/dev-server-rollup@0.6.4': + '@web/dev-server-rollup@0.6.4(bufferutil@4.0.9)': dependencies: - '@rollup/plugin-node-resolve': 15.3.1(rollup@4.40.2) - '@web/dev-server-core': 0.7.5 + '@rollup/plugin-node-resolve': 15.3.1(rollup@4.53.5) + '@web/dev-server-core': 0.7.5(bufferutil@4.0.9) nanocolors: 0.2.13 parse5: 6.0.1 - rollup: 4.40.2 + rollup: 4.53.5 whatwg-url: 14.2.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - '@web/dev-server@0.4.6': + '@web/dev-server@0.4.6(bufferutil@4.0.9)': dependencies: '@babel/code-frame': 7.27.1 '@types/command-line-args': 5.2.3 '@web/config-loader': 0.3.3 - '@web/dev-server-core': 0.7.5 - '@web/dev-server-rollup': 0.6.4 + '@web/dev-server-core': 0.7.5(bufferutil@4.0.9) + '@web/dev-server-rollup': 0.6.4(bufferutil@4.0.9) camelcase: 6.3.0 command-line-args: 5.2.1 command-line-usage: 7.0.3 @@ -10761,7 +12576,7 @@ snapshots: internal-ip: 6.2.0 nanocolors: 0.2.13 open: 8.4.2 - portfinder: 1.0.37 + portfinder: 1.0.38 transitivePeerDependencies: - bufferutil - supports-color @@ -10772,28 +12587,30 @@ snapshots: '@types/parse5': 6.0.3 parse5: 6.0.1 - '@web/test-runner-chrome@0.18.1': + '@web/test-runner-chrome@0.18.1(bufferutil@4.0.9)': dependencies: - '@web/test-runner-core': 0.13.4 - '@web/test-runner-coverage-v8': 0.8.0 + '@web/test-runner-core': 0.13.4(bufferutil@4.0.9) + '@web/test-runner-coverage-v8': 0.8.0(bufferutil@4.0.9) chrome-launcher: 0.15.2 - puppeteer-core: 24.8.1 + puppeteer-core: 24.34.0(bufferutil@4.0.9) transitivePeerDependencies: + - bare-abort-controller - bare-buffer - bufferutil + - react-native-b4a - supports-color - utf-8-validate - '@web/test-runner-commands@0.9.0': + '@web/test-runner-commands@0.9.0(bufferutil@4.0.9)': dependencies: - '@web/test-runner-core': 0.13.4 + '@web/test-runner-core': 0.13.4(bufferutil@4.0.9) mkdirp: 1.0.4 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - '@web/test-runner-core@0.13.4': + '@web/test-runner-core@0.13.4(bufferutil@4.0.9)': dependencies: '@babel/code-frame': 7.27.1 '@types/babel__code-frame': 7.0.6 @@ -10803,7 +12620,7 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 '@web/browser-logs': 0.4.1 - '@web/dev-server-core': 0.7.5 + '@web/dev-server-core': 0.7.5(bufferutil@4.0.9) chokidar: 4.0.3 cli-cursor: 3.1.0 co-body: 6.2.0 @@ -10814,21 +12631,21 @@ snapshots: internal-ip: 6.2.0 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 - istanbul-reports: 3.1.7 + istanbul-reports: 3.2.0 log-update: 4.0.0 nanocolors: 0.2.13 nanoid: 3.3.11 open: 8.4.2 picomatch: 2.3.1 - source-map: 0.7.4 + source-map: 0.7.6 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - '@web/test-runner-coverage-v8@0.8.0': + '@web/test-runner-coverage-v8@0.8.0(bufferutil@4.0.9)': dependencies: - '@web/test-runner-core': 0.13.4 + '@web/test-runner-core': 0.13.4(bufferutil@4.0.9) istanbul-lib-coverage: 3.2.2 lru-cache: 8.0.5 picomatch: 2.3.1 @@ -10838,23 +12655,23 @@ snapshots: - supports-color - utf-8-validate - '@web/test-runner-mocha@0.9.0': + '@web/test-runner-mocha@0.9.0(bufferutil@4.0.9)': dependencies: - '@web/test-runner-core': 0.13.4 + '@web/test-runner-core': 0.13.4(bufferutil@4.0.9) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - '@web/test-runner@0.20.1': + '@web/test-runner@0.20.2(bufferutil@4.0.9)': dependencies: '@web/browser-logs': 0.4.1 '@web/config-loader': 0.3.3 - '@web/dev-server': 0.4.6 - '@web/test-runner-chrome': 0.18.1 - '@web/test-runner-commands': 0.9.0 - '@web/test-runner-core': 0.13.4 - '@web/test-runner-mocha': 0.9.0 + '@web/dev-server': 0.4.6(bufferutil@4.0.9) + '@web/test-runner-chrome': 0.18.1(bufferutil@4.0.9) + '@web/test-runner-commands': 0.9.0(bufferutil@4.0.9) + '@web/test-runner-core': 0.13.4(bufferutil@4.0.9) + '@web/test-runner-mocha': 0.9.0(bufferutil@4.0.9) camelcase: 6.3.0 command-line-args: 5.2.1 command-line-usage: 7.0.3 @@ -10862,11 +12679,13 @@ snapshots: diff: 5.2.0 globby: 11.1.0 nanocolors: 0.2.13 - portfinder: 1.0.37 - source-map: 0.7.4 + portfinder: 1.0.38 + source-map: 0.7.6 transitivePeerDependencies: + - bare-abort-controller - bare-buffer - bufferutil + - react-native-b4a - supports-color - utf-8-validate @@ -10946,7 +12765,7 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 - '@xmldom/xmldom@0.8.10': {} + '@xmldom/xmldom@0.8.11': {} '@xtuc/ieee754@1.2.0': {} @@ -10959,7 +12778,7 @@ snapshots: jsonparse: 1.3.1 through: 2.3.8 - abbrev@3.0.1: {} + abbrev@4.0.0: {} abort-controller@3.0.0: dependencies: @@ -10972,18 +12791,22 @@ snapshots: accepts@2.0.0: dependencies: - mime-types: 3.0.1 + mime-types: 3.0.2 negotiator: 1.0.0 - acorn-jsx@5.3.2(acorn@8.14.1): + acorn-import-phases@1.0.4(acorn@8.15.0): + dependencies: + acorn: 8.15.0 + + acorn-jsx@5.3.2(acorn@8.15.0): dependencies: - acorn: 8.14.1 + acorn: 8.15.0 acorn-walk@8.3.4: dependencies: - acorn: 8.14.1 + acorn: 8.15.0 - acorn@8.14.1: {} + acorn@8.15.0: {} adjust-sourcemap-loader@4.0.0: dependencies: @@ -10996,13 +12819,13 @@ snapshots: dependencies: es6-promisify: 5.0.0 - agent-base@6.0.2(supports-color@10.0.0): + agent-base@6.0.2(supports-color@10.2.2): dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - agent-base@7.1.3: {} + agent-base@7.1.4: {} ajv-formats@2.1.1: dependencies: @@ -11027,17 +12850,34 @@ snapshots: ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.0.6 + fast-uri: 3.1.0 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 + algoliasearch@5.46.0: + dependencies: + '@algolia/abtesting': 1.12.0 + '@algolia/client-abtesting': 5.46.0 + '@algolia/client-analytics': 5.46.0 + '@algolia/client-common': 5.46.0 + '@algolia/client-insights': 5.46.0 + '@algolia/client-personalization': 5.46.0 + '@algolia/client-query-suggestions': 5.46.0 + '@algolia/client-search': 5.46.0 + '@algolia/ingestion': 1.46.0 + '@algolia/monitoring': 1.46.0 + '@algolia/recommend': 5.46.0 + '@algolia/requester-browser-xhr': 5.46.0 + '@algolia/requester-fetch': 5.46.0 + '@algolia/requester-node-http': 5.46.0 + ansi-colors@4.1.3: {} ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 - ansi-escapes@7.0.0: + ansi-escapes@7.2.0: dependencies: environment: 1.1.0 @@ -11047,7 +12887,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.1.0: {} + ansi-regex@6.2.2: {} ansi-styles@2.2.1: {} @@ -11055,7 +12895,7 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@6.2.1: {} + ansi-styles@6.2.3: {} anymatch@3.1.3: dependencies: @@ -11077,16 +12917,20 @@ snapshots: call-bound: 1.0.4 is-array-buffer: 3.0.5 + array-differ@4.0.0: {} + array-flatten@1.1.1: {} - array-includes@3.1.8: + array-includes@3.1.9: dependencies: call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-object-atoms: 1.1.1 get-intrinsic: 1.3.0 is-string: 1.1.1 + math-intrinsics: 1.1.0 array-union@1.0.2: dependencies: @@ -11094,6 +12938,8 @@ snapshots: array-union@2.1.0: {} + array-union@3.0.1: {} + array-uniq@1.0.3: {} array.prototype.findlastindex@1.2.6: @@ -11101,7 +12947,7 @@ snapshots: call-bind: 1.0.8 call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-errors: 1.3.0 es-object-atoms: 1.1.1 es-shim-unscopables: 1.1.0 @@ -11110,14 +12956,14 @@ snapshots: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-shim-unscopables: 1.1.0 array.prototype.flatmap@1.3.3: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-shim-unscopables: 1.1.0 arraybuffer.prototype.slice@1.0.4: @@ -11125,7 +12971,7 @@ snapshots: array-buffer-byte-length: 1.0.2 call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-errors: 1.3.0 get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 @@ -11146,6 +12992,12 @@ snapshots: dependencies: tslib: 2.8.1 + ast-v8-to-istanbul@0.3.9: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + estree-walker: 3.0.3 + js-tokens: 9.0.1 + astral-regex@2.0.0: {} async-each-series@0.1.1: {} @@ -11156,22 +13008,19 @@ snapshots: dependencies: lodash: 4.17.21 - async@3.2.4: {} - async@3.2.6: {} asynckit@0.4.0: {} atomic-sleep@1.0.0: {} - autoprefixer@10.4.21(postcss@8.5.3): + autoprefixer@10.4.23(postcss@8.5.6): dependencies: - browserslist: 4.24.5 - caniuse-lite: 1.0.30001717 - fraction.js: 4.3.7 - normalize-range: 0.1.2 + browserslist: 4.28.1 + caniuse-lite: 1.0.30001761 + fraction.js: 5.3.4 picocolors: 1.1.1 - postcss: 8.5.3 + postcss: 8.5.6 postcss-value-parser: 4.2.0 available-typed-arrays@1.0.7: @@ -11182,73 +13031,82 @@ snapshots: aws4@1.13.2: {} - b4a@1.6.7: {} + b4a@1.7.3: {} - babel-loader@10.0.0(@babel/core@7.27.1)(webpack@5.99.8(esbuild@0.25.4)): + babel-loader@10.0.0(@babel/core@7.28.5)(webpack@5.104.0(esbuild@0.27.1)): dependencies: - '@babel/core': 7.27.1 + '@babel/core': 7.28.5 find-up: 5.0.0 - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) - babel-plugin-polyfill-corejs2@0.4.13(@babel/core@7.27.1): + babel-plugin-polyfill-corejs2@0.4.14(@babel/core@7.28.5): dependencies: - '@babel/compat-data': 7.27.2 - '@babel/core': 7.27.1 - '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.27.1) + '@babel/compat-data': 7.28.5 + '@babel/core': 7.28.5 + '@babel/helper-define-polyfill-provider': 0.6.5(@babel/core@7.28.5) semver: 6.3.1 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-corejs3@0.11.1(@babel/core@7.27.1): + babel-plugin-polyfill-corejs3@0.13.0(@babel/core@7.28.5): dependencies: - '@babel/core': 7.27.1 - '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.27.1) - core-js-compat: 3.42.0 + '@babel/core': 7.28.5 + '@babel/helper-define-polyfill-provider': 0.6.5(@babel/core@7.28.5) + core-js-compat: 3.47.0 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-regenerator@0.6.4(@babel/core@7.27.1): + babel-plugin-polyfill-regenerator@0.6.5(@babel/core@7.28.5): dependencies: - '@babel/core': 7.27.1 - '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.27.1) + '@babel/core': 7.28.5 + '@babel/helper-define-polyfill-provider': 0.6.5(@babel/core@7.28.5) transitivePeerDependencies: - supports-color balanced-match@1.0.2: {} - bare-events@2.5.4: - optional: true + bare-events@2.8.2: {} - bare-fs@4.1.4: + bare-fs@4.5.2: dependencies: - bare-events: 2.5.4 + bare-events: 2.8.2 bare-path: 3.0.0 - bare-stream: 2.6.5(bare-events@2.5.4) + bare-stream: 2.7.0(bare-events@2.8.2) + bare-url: 2.3.2 + fast-fifo: 1.3.2 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a optional: true - bare-os@3.6.1: + bare-os@3.6.2: optional: true bare-path@3.0.0: dependencies: - bare-os: 3.6.1 + bare-os: 3.6.2 optional: true - bare-stream@2.6.5(bare-events@2.5.4): + bare-stream@2.7.0(bare-events@2.8.2): dependencies: - streamx: 2.22.0 + streamx: 2.23.0 optionalDependencies: - bare-events: 2.5.4 + bare-events: 2.8.2 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a + optional: true + + bare-url@2.3.2: + dependencies: + bare-path: 3.0.0 optional: true base64-js@1.5.1: {} base64id@2.0.0: {} - baseline-browser-mapping@2.3.0: - dependencies: - '@mdn/browser-compat-data': 6.0.12 - web-features: 2.34.2 + baseline-browser-mapping@2.9.11: {} basic-ftp@5.0.5: {} @@ -11260,24 +13118,28 @@ snapshots: bcryptjs@2.4.3: {} - beasties@0.3.3: + beasties@0.3.5: dependencies: - css-select: 5.1.0 - css-what: 6.1.0 + css-select: 6.0.0 + css-what: 7.0.0 dom-serializer: 2.0.0 domhandler: 5.0.3 htmlparser2: 10.0.0 picocolors: 1.1.1 - postcss: 8.5.3 + postcss: 8.5.6 postcss-media-query-parser: 0.2.3 - before-after-hook@3.0.2: {} + before-after-hook@4.0.0: {} + + bidi-js@1.0.3: + dependencies: + require-from-string: 2.0.2 big.js@5.2.2: {} - big.js@6.2.2: {} + big.js@7.0.1: {} - bignumber.js@9.3.0: {} + bignumber.js@9.3.1: {} binary-extensions@2.3.0: {} @@ -11308,16 +13170,33 @@ snapshots: transitivePeerDependencies: - supports-color - body-parser@2.2.0: + body-parser@1.20.4: dependencies: bytes: 3.1.2 content-type: 1.0.5 - debug: 4.4.0(supports-color@10.0.0) - http-errors: 2.0.0 - iconv-lite: 0.6.3 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.14.0 + raw-body: 2.5.3 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + body-parser@2.2.1: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 4.4.3(supports-color@10.2.2) + http-errors: 2.0.1 + iconv-lite: 0.7.1 on-finished: 2.4.1 qs: 6.14.0 - raw-body: 3.0.0 + raw-body: 3.0.2 type-is: 2.0.1 transitivePeerDependencies: - supports-color @@ -11329,12 +13208,12 @@ snapshots: boolbase@1.0.0: {} - brace-expansion@1.1.11: + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - brace-expansion@2.0.1: + brace-expansion@2.0.2: dependencies: balanced-match: 1.0.2 @@ -11350,24 +13229,24 @@ snapshots: fresh: 0.5.2 mitt: 1.2.0 - browser-sync-ui@3.0.4: + browser-sync-ui@3.0.4(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: async-each-series: 0.1.1 chalk: 4.1.2 connect-history-api-fallback: 1.6.0 immutable: 3.8.2 server-destroy: 1.0.1 - socket.io-client: 4.8.1 + socket.io-client: 4.8.1(bufferutil@4.0.9)(utf-8-validate@6.0.5) stream-throttle: 0.1.3 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - browser-sync@3.0.4: + browser-sync@3.0.4(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: browser-sync-client: 3.0.4 - browser-sync-ui: 3.0.4 + browser-sync-ui: 3.0.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) bs-recipes: 1.3.4 chalk: 4.1.2 chokidar: 3.6.0 @@ -11379,20 +13258,20 @@ snapshots: etag: 1.8.1 fresh: 0.5.2 fs-extra: 3.0.1 - http-proxy: 1.18.1(debug@4.4.0) + http-proxy: 1.18.1(debug@4.4.3) immutable: 3.8.2 micromatch: 4.0.8 opn: 5.3.0 portscanner: 2.2.0 - raw-body: 2.5.2 + raw-body: 2.5.3 resp-modifier: 6.0.2 rx: 4.1.0 - send: 0.19.1 + send: 0.19.2 serve-index: 1.9.1 - serve-static: 1.16.2 + serve-static: 1.16.3 server-destroy: 1.0.1 - socket.io: 4.8.1 - ua-parser-js: 1.0.40 + socket.io: 4.8.1(bufferutil@4.0.9)(utf-8-validate@6.0.5) + ua-parser-js: 1.0.41 yargs: 17.7.2 transitivePeerDependencies: - bufferutil @@ -11404,12 +13283,13 @@ snapshots: dependencies: pako: 0.2.9 - browserslist@4.24.5: + browserslist@4.28.1: dependencies: - caniuse-lite: 1.0.30001717 - electron-to-chromium: 1.5.150 - node-releases: 2.0.19 - update-browserslist-db: 1.1.3(browserslist@4.24.5) + baseline-browser-mapping: 2.9.11 + caniuse-lite: 1.0.30001761 + electron-to-chromium: 1.5.267 + node-releases: 2.0.27 + update-browserslist-db: 1.2.3(browserslist@4.28.1) browserstack@1.6.1: dependencies: @@ -11435,34 +13315,47 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + bufferutil@4.0.9: + dependencies: + node-gyp-build: 4.8.4 + bundle-name@4.1.0: dependencies: - run-applescript: 7.0.0 + run-applescript: 7.1.0 bytes@3.1.2: {} - cac@6.7.14: {} - - cacache@19.0.1: + cacache@20.0.3: dependencies: - '@npmcli/fs': 4.0.0 + '@npmcli/fs': 5.0.0 fs-minipass: 3.0.3 - glob: 10.4.5 - lru-cache: 10.4.3 + glob: 13.0.0 + lru-cache: 11.2.4 minipass: 7.1.2 minipass-collect: 2.0.1 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - p-map: 7.0.3 - ssri: 12.0.0 - tar: 7.4.3 - unique-filename: 4.0.0 + p-map: 7.0.4 + ssri: 13.0.0 + unique-filename: 5.0.0 cache-content-type@1.0.1: dependencies: mime-types: 2.1.35 ylru: 1.4.0 + cacheable-lookup@6.1.0: {} + + cacheable-request@7.0.2: + dependencies: + clone-response: 1.0.3 + get-stream: 5.2.0 + http-cache-semantics: 4.2.0 + keyv: 4.5.4 + lowercase-keys: 2.0.0 + normalize-url: 6.1.0 + responselike: 2.0.1 + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -11486,17 +13379,11 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001717: {} + caniuse-lite@1.0.30001761: {} caseless@0.12.0: {} - chai@5.2.0: - dependencies: - assertion-error: 2.0.1 - check-error: 2.1.1 - deep-eql: 5.0.2 - loupe: 3.1.3 - pathval: 2.0.0 + chai@6.2.1: {} chalk-template@0.4.0: dependencies: @@ -11515,15 +13402,13 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - chalk@5.4.1: {} - - chardet@0.7.0: {} + chalk@5.6.2: {} - check-error@2.1.1: {} + chardet@2.1.1: {} checkpoint-stream@0.1.2: dependencies: - '@types/pumpify': 1.4.4 + '@types/pumpify': 1.4.5 events-intercept: 2.0.0 pumpify: 1.5.1 split-array-stream: 1.0.3 @@ -11545,15 +13430,17 @@ snapshots: dependencies: readdirp: 4.1.2 - chownr@1.1.4: {} + chokidar@5.0.0: + dependencies: + readdirp: 5.0.0 - chownr@2.0.0: {} + chownr@1.1.4: {} chownr@3.0.0: {} chrome-launcher@0.15.2: dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -11562,11 +13449,11 @@ snapshots: chrome-trace-event@1.0.4: {} - chromium-bidi@5.1.0(devtools-protocol@0.0.1439962): + chromium-bidi@12.0.1(devtools-protocol@0.0.1534754): dependencies: - devtools-protocol: 0.0.1439962 + devtools-protocol: 0.0.1534754 mitt: 3.0.1 - zod: 3.24.4 + zod: 3.25.76 cli-cursor@3.1.0: dependencies: @@ -11576,12 +13463,16 @@ snapshots: dependencies: restore-cursor: 5.1.0 - cli-spinners@2.9.2: {} + cli-progress@3.12.0: + dependencies: + string-width: 4.2.3 + + cli-spinners@3.3.0: {} - cli-truncate@4.0.0: + cli-truncate@5.1.1: dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 + slice-ansi: 7.1.2 + string-width: 8.1.0 cli-width@4.1.0: {} @@ -11607,13 +13498,21 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + cliui@9.0.1: + dependencies: + string-width: 7.2.0 + strip-ansi: 7.1.2 + wrap-ansi: 9.0.2 + clone-deep@4.0.1: dependencies: is-plain-object: 2.0.4 kind-of: 6.0.3 shallow-clone: 3.0.1 - clone@1.0.4: {} + clone-response@1.0.3: + dependencies: + mimic-response: 1.0.1 clone@2.1.2: {} @@ -11622,7 +13521,7 @@ snapshots: '@hapi/bourne': 3.0.0 inflation: 2.1.0 qs: 6.14.0 - raw-body: 2.5.2 + raw-body: 2.5.3 type-is: 1.6.18 co@4.6.0: {} @@ -11657,23 +13556,25 @@ snapshots: table-layout: 4.1.1 typical: 7.3.0 - commander@13.1.0: {} + commander@14.0.2: {} commander@2.20.3: {} + common-path-prefix@3.0.0: {} + commondir@1.0.1: {} compressible@2.0.18: dependencies: mime-db: 1.54.0 - compression@1.8.0: + compression@1.8.1: dependencies: bytes: 3.1.2 compressible: 2.0.18 debug: 2.6.9 negotiator: 0.6.4 - on-headers: 1.0.2 + on-headers: 1.1.0 safe-buffer: 5.2.1 vary: 1.1.2 transitivePeerDependencies: @@ -11709,18 +13610,24 @@ snapshots: dependencies: safe-buffer: 5.2.1 - content-disposition@1.0.0: - dependencies: - safe-buffer: 5.2.1 + content-disposition@1.0.1: {} content-type@1.0.5: {} + conventional-commits-filter@5.0.0: {} + + conventional-commits-parser@6.2.1: + dependencies: + meow: 13.2.0 + convert-source-map@1.9.0: {} convert-source-map@2.0.0: {} cookie-signature@1.0.6: {} + cookie-signature@1.0.7: {} + cookie-signature@1.2.2: {} cookie@0.7.1: {} @@ -11736,20 +13643,18 @@ snapshots: dependencies: is-what: 3.14.1 - copy-webpack-plugin@13.0.0(webpack@5.99.8(esbuild@0.25.4)): + copy-webpack-plugin@13.0.1(webpack@5.104.0(esbuild@0.27.1)): dependencies: glob-parent: 6.0.2 normalize-path: 3.0.0 - schema-utils: 4.3.2 + schema-utils: 4.3.3 serialize-javascript: 6.0.2 - tinyglobby: 0.2.13 - webpack: 5.99.8(esbuild@0.25.4) + tinyglobby: 0.2.15 + webpack: 5.104.0(esbuild@0.27.1) - core-js-compat@3.42.0: + core-js-compat@3.47.0: dependencies: - browserslist: 4.24.5 - - core-js@3.40.0: {} + browserslist: 4.28.1 core-util-is@1.0.2: {} @@ -11760,14 +13665,14 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 - cosmiconfig@9.0.0(typescript@5.8.3): + cosmiconfig@9.0.0(typescript@5.9.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 - js-yaml: 4.1.0 + js-yaml: 4.1.1 parse-json: 5.2.0 optionalDependencies: - typescript: 5.8.3 + typescript: 5.9.3 create-require@1.1.1: {} @@ -11783,49 +13688,47 @@ snapshots: transitivePeerDependencies: - encoding - cross-spawn@6.0.6: - dependencies: - nice-try: 1.0.5 - path-key: 2.0.1 - semver: 5.7.2 - shebang-command: 1.2.0 - which: 1.3.1 - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - css-loader@7.1.2(webpack@5.99.8(esbuild@0.25.4)): + css-loader@7.1.2(webpack@5.104.0(esbuild@0.27.1)): dependencies: - icss-utils: 5.1.0(postcss@8.5.3) - postcss: 8.5.3 - postcss-modules-extract-imports: 3.1.0(postcss@8.5.3) - postcss-modules-local-by-default: 4.2.0(postcss@8.5.3) - postcss-modules-scope: 3.2.1(postcss@8.5.3) - postcss-modules-values: 4.0.0(postcss@8.5.3) + icss-utils: 5.1.0(postcss@8.5.6) + postcss: 8.5.6 + postcss-modules-extract-imports: 3.1.0(postcss@8.5.6) + postcss-modules-local-by-default: 4.2.0(postcss@8.5.6) + postcss-modules-scope: 3.2.1(postcss@8.5.6) + postcss-modules-values: 4.0.0(postcss@8.5.6) postcss-value-parser: 4.2.0 - semver: 7.7.1 + semver: 7.7.3 optionalDependencies: - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) - css-select@5.1.0: + css-select@6.0.0: dependencies: boolbase: 1.0.0 - css-what: 6.1.0 + css-what: 7.0.0 domhandler: 5.0.3 domutils: 3.2.2 nth-check: 2.1.1 - css-what@6.1.0: {} + css-tree@3.1.0: + dependencies: + mdn-data: 2.12.2 + source-map-js: 1.2.1 + + css-what@7.0.0: {} cssesc@3.0.0: {} - cssstyle@4.3.1: + cssstyle@5.3.5: dependencies: - '@asamuzakjp/css-color': 3.1.7 - rrweb-cssom: 0.8.0 + '@asamuzakjp/css-color': 4.1.1 + '@csstools/css-syntax-patches-for-csstree': 1.0.22 + css-tree: 3.1.0 custom-event@1.0.1: {} @@ -11837,10 +13740,10 @@ snapshots: data-uri-to-buffer@6.0.2: {} - data-urls@5.0.0: + data-urls@6.0.0: dependencies: whatwg-mimetype: 4.0.0 - whatwg-url: 14.2.0 + whatwg-url: 15.1.0 data-view-buffer@1.0.2: dependencies: @@ -11882,17 +13785,29 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.4.0(supports-color@10.0.0): + debug@4.4.0(supports-color@10.2.2): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 10.2.2 + + debug@4.4.1: + dependencies: + ms: 2.1.3 + + debug@4.4.3(supports-color@10.2.2): dependencies: ms: 2.1.3 optionalDependencies: - supports-color: 10.0.0 + supports-color: 10.2.2 decamelize@1.2.0: {} - decimal.js@10.5.0: {} + decimal.js@10.6.0: {} - deep-eql@5.0.2: {} + decompress-response@6.0.0: + dependencies: + mimic-response: 3.1.0 deep-equal@1.0.1: {} @@ -11900,20 +13815,18 @@ snapshots: deepmerge@4.3.1: {} - default-browser-id@5.0.0: {} + default-browser-id@5.0.1: {} - default-browser@5.2.1: + default-browser@5.4.0: dependencies: bundle-name: 4.1.0 - default-browser-id: 5.0.0 + default-browser-id: 5.0.1 default-gateway@6.0.3: dependencies: execa: 5.1.1 - defaults@1.0.4: - dependencies: - clone: 1.0.4 + defer-to-connect@2.0.1: {} define-data-property@1.1.4: dependencies: @@ -11966,7 +13879,7 @@ snapshots: detect-libc@1.0.3: optional: true - detect-libc@2.0.4: + detect-libc@2.1.2: optional: true detect-node@2.1.0: {} @@ -11975,7 +13888,7 @@ snapshots: devtools-protocol@0.0.1045489: {} - devtools-protocol@0.0.1439962: {} + devtools-protocol@0.0.1534754: {} di@0.0.1: {} @@ -12028,14 +13941,14 @@ snapshots: duplexify@3.7.1: dependencies: - end-of-stream: 1.4.4 + end-of-stream: 1.4.5 inherits: 2.0.4 readable-stream: 2.3.8 stream-shift: 1.0.3 duplexify@4.1.3: dependencies: - end-of-stream: 1.4.4 + end-of-stream: 1.4.5 inherits: 2.0.4 readable-stream: 3.6.2 stream-shift: 1.0.3 @@ -12061,9 +13974,13 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.150: {} + ejs@3.1.10: + dependencies: + jake: 10.9.4 + + electron-to-chromium@1.5.267: {} - emoji-regex@10.4.0: {} + emoji-regex@10.6.0: {} emoji-regex@8.0.0: {} @@ -12078,18 +13995,17 @@ snapshots: encoding@0.1.13: dependencies: iconv-lite: 0.6.3 - optional: true - end-of-stream@1.4.4: + end-of-stream@1.4.5: dependencies: once: 1.4.0 - engine.io-client@6.6.3: + engine.io-client@6.6.3(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.3.7 engine.io-parser: 5.2.3 - ws: 8.17.1 + ws: 8.17.1(bufferutil@4.0.9)(utf-8-validate@6.0.5) xmlhttprequest-ssl: 2.1.2 transitivePeerDependencies: - bufferutil @@ -12098,26 +14014,26 @@ snapshots: engine.io-parser@5.2.3: {} - engine.io@6.6.4: + engine.io@6.6.4(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: - '@types/cors': 2.8.17 - '@types/node': 20.17.44 + '@types/cors': 2.8.19 + '@types/node': 22.19.3 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 cors: 2.8.5 debug: 4.3.7 engine.io-parser: 5.2.3 - ws: 8.17.1 + ws: 8.17.1(bufferutil@4.0.9)(utf-8-validate@6.0.5) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - enhanced-resolve@5.18.1: + enhanced-resolve@5.18.4: dependencies: graceful-fs: 4.2.11 - tapable: 2.2.1 + tapable: 2.3.0 ent@2.2.2: dependencies: @@ -12128,11 +14044,11 @@ snapshots: entities@4.5.0: {} - entities@6.0.0: {} + entities@6.0.1: {} env-paths@2.2.1: {} - envinfo@7.14.0: {} + envinfo@7.15.0: {} environment@1.1.0: {} @@ -12143,13 +14059,13 @@ snapshots: prr: 1.0.1 optional: true - error-ex@1.3.2: + error-ex@1.3.4: dependencies: is-arrayish: 0.2.1 errorstacks@2.4.1: {} - es-abstract@1.23.9: + es-abstract@1.24.1: dependencies: array-buffer-byte-length: 1.0.2 arraybuffer.prototype.slice: 1.0.4 @@ -12178,7 +14094,9 @@ snapshots: is-array-buffer: 3.0.5 is-callable: 1.2.7 is-data-view: 1.0.2 + is-negative-zero: 2.0.3 is-regex: 1.2.1 + is-set: 2.0.3 is-shared-array-buffer: 1.0.4 is-string: 1.1.1 is-typed-array: 1.1.15 @@ -12193,6 +14111,7 @@ snapshots: safe-push-apply: 1.0.0 safe-regex-test: 1.1.0 set-proto: 1.0.0 + stop-iteration-iterator: 1.1.0 string.prototype.trim: 1.2.10 string.prototype.trimend: 1.0.9 string.prototype.trimstart: 1.0.8 @@ -12209,6 +14128,8 @@ snapshots: es-module-lexer@1.7.0: {} + es-module-lexer@2.0.0: {} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 @@ -12236,35 +14157,36 @@ snapshots: dependencies: es6-promise: 4.2.8 - esbuild-wasm@0.25.4: {} + esbuild-wasm@0.27.1: {} - esbuild@0.25.4: + esbuild@0.27.1: optionalDependencies: - '@esbuild/aix-ppc64': 0.25.4 - '@esbuild/android-arm': 0.25.4 - '@esbuild/android-arm64': 0.25.4 - '@esbuild/android-x64': 0.25.4 - '@esbuild/darwin-arm64': 0.25.4 - '@esbuild/darwin-x64': 0.25.4 - '@esbuild/freebsd-arm64': 0.25.4 - '@esbuild/freebsd-x64': 0.25.4 - '@esbuild/linux-arm': 0.25.4 - '@esbuild/linux-arm64': 0.25.4 - '@esbuild/linux-ia32': 0.25.4 - '@esbuild/linux-loong64': 0.25.4 - '@esbuild/linux-mips64el': 0.25.4 - '@esbuild/linux-ppc64': 0.25.4 - '@esbuild/linux-riscv64': 0.25.4 - '@esbuild/linux-s390x': 0.25.4 - '@esbuild/linux-x64': 0.25.4 - '@esbuild/netbsd-arm64': 0.25.4 - '@esbuild/netbsd-x64': 0.25.4 - '@esbuild/openbsd-arm64': 0.25.4 - '@esbuild/openbsd-x64': 0.25.4 - '@esbuild/sunos-x64': 0.25.4 - '@esbuild/win32-arm64': 0.25.4 - '@esbuild/win32-ia32': 0.25.4 - '@esbuild/win32-x64': 0.25.4 + '@esbuild/aix-ppc64': 0.27.1 + '@esbuild/android-arm': 0.27.1 + '@esbuild/android-arm64': 0.27.1 + '@esbuild/android-x64': 0.27.1 + '@esbuild/darwin-arm64': 0.27.1 + '@esbuild/darwin-x64': 0.27.1 + '@esbuild/freebsd-arm64': 0.27.1 + '@esbuild/freebsd-x64': 0.27.1 + '@esbuild/linux-arm': 0.27.1 + '@esbuild/linux-arm64': 0.27.1 + '@esbuild/linux-ia32': 0.27.1 + '@esbuild/linux-loong64': 0.27.1 + '@esbuild/linux-mips64el': 0.27.1 + '@esbuild/linux-ppc64': 0.27.1 + '@esbuild/linux-riscv64': 0.27.1 + '@esbuild/linux-s390x': 0.27.1 + '@esbuild/linux-x64': 0.27.1 + '@esbuild/netbsd-arm64': 0.27.1 + '@esbuild/netbsd-x64': 0.27.1 + '@esbuild/openbsd-arm64': 0.27.1 + '@esbuild/openbsd-x64': 0.27.1 + '@esbuild/openharmony-arm64': 0.27.1 + '@esbuild/sunos-x64': 0.27.1 + '@esbuild/win32-arm64': 0.27.1 + '@esbuild/win32-ia32': 0.27.1 + '@esbuild/win32-x64': 0.27.1 escalade@3.2.0: {} @@ -12282,44 +14204,44 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-config-prettier@10.1.2(eslint@9.26.0(jiti@1.21.7)): + eslint-config-prettier@10.1.8(eslint@9.39.2(jiti@2.6.1)): dependencies: - eslint: 9.26.0(jiti@1.21.7) + eslint: 9.39.2(jiti@2.6.1) eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 is-core-module: 2.16.1 - resolve: 1.22.10 + resolve: 1.22.11 transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.26.0(jiti@1.21.7)): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2(jiti@2.6.1)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) - eslint: 9.26.0(jiti@1.21.7) + '@typescript-eslint/parser': 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + eslint: 9.39.2(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-header@3.1.1(eslint@9.26.0(jiti@1.21.7)): + eslint-plugin-header@3.1.1(eslint@9.39.2(jiti@2.6.1)): dependencies: - eslint: 9.26.0(jiti@1.21.7) + eslint: 9.39.2(jiti@2.6.1) - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint@9.26.0(jiti@1.21.7)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 - array-includes: 3.1.8 + array-includes: 3.1.9 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.26.0(jiti@1.21.7) + eslint: 9.39.2(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.26.0(jiti@1.21.7)) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2(jiti@2.6.1)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -12331,7 +14253,7 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.32.0(eslint@9.26.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/parser': 8.50.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -12342,39 +14264,37 @@ snapshots: esrecurse: 4.3.0 estraverse: 4.3.0 - eslint-scope@8.3.0: + eslint-scope@8.4.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.2.0: {} + eslint-visitor-keys@4.2.1: {} - eslint@9.26.0(jiti@1.21.7): + eslint@9.39.2(jiti@2.6.1): dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.26.0(jiti@1.21.7)) - '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.20.0 - '@eslint/config-helpers': 0.2.2 - '@eslint/core': 0.13.0 - '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.26.0 - '@eslint/plugin-kit': 0.2.8 - '@humanfs/node': 0.16.6 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.21.1 + '@eslint/config-helpers': 0.4.2 + '@eslint/core': 0.17.0 + '@eslint/eslintrc': 3.3.3 + '@eslint/js': 9.39.2 + '@eslint/plugin-kit': 0.4.1 + '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 - '@modelcontextprotocol/sdk': 1.11.0 - '@types/estree': 1.0.7 - '@types/json-schema': 7.0.15 + '@types/estree': 1.0.8 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) escape-string-regexp: 4.0.0 - eslint-scope: 8.3.0 - eslint-visitor-keys: 4.2.0 - espree: 10.3.0 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -12389,17 +14309,16 @@ snapshots: minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 - zod: 3.24.4 optionalDependencies: - jiti: 1.21.7 + jiti: 2.6.1 transitivePeerDependencies: - supports-color - espree@10.3.0: + espree@10.4.0: dependencies: - acorn: 8.14.1 - acorn-jsx: 5.3.2(acorn@8.14.1) - eslint-visitor-keys: 4.2.0 + acorn: 8.15.0 + acorn-jsx: 5.3.2(acorn@8.15.0) + eslint-visitor-keys: 4.2.1 esprima@4.0.1: {} @@ -12419,7 +14338,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 esutils@2.0.3: {} @@ -12433,23 +14352,19 @@ snapshots: events-intercept@2.0.0: {} - events@3.3.0: {} + events-universal@1.0.1: + dependencies: + bare-events: 2.8.2 + transitivePeerDependencies: + - bare-abort-controller - eventsource-parser@3.0.1: {} + events@3.3.0: {} - eventsource@3.0.6: - dependencies: - eventsource-parser: 3.0.1 + eventsource-parser@3.0.6: {} - execa@1.0.0: + eventsource@3.0.7: dependencies: - cross-spawn: 6.0.6 - get-stream: 4.1.0 - is-stream: 1.1.0 - npm-run-path: 2.0.2 - p-finally: 1.0.0 - signal-exit: 3.0.7 - strip-eof: 1.0.0 + eventsource-parser: 3.0.6 execa@5.1.1: dependencies: @@ -12465,15 +14380,15 @@ snapshots: exit@0.1.2: {} - expect-type@1.2.1: {} + expect-type@1.3.0: {} - exponential-backoff@3.1.2: {} + exponential-backoff@3.1.3: {} express-rate-limit@5.5.1: {} - express-rate-limit@7.5.0(express@5.1.0): + express-rate-limit@7.5.1(express@5.2.1): dependencies: - express: 5.1.0 + express: 5.2.1 express@4.21.2: dependencies: @@ -12511,23 +14426,60 @@ snapshots: transitivePeerDependencies: - supports-color - express@5.1.0: + express@4.22.1: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.4 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.0.7 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.3.2 + fresh: 0.5.2 + http-errors: 2.0.1 + merge-descriptors: 1.0.3 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.12 + proxy-addr: 2.0.7 + qs: 6.14.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.19.2 + serve-static: 1.16.3 + setprototypeof: 1.2.0 + statuses: 2.0.2 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + express@5.2.1: dependencies: accepts: 2.0.0 - body-parser: 2.2.0 - content-disposition: 1.0.0 + body-parser: 2.2.1 + content-disposition: 1.0.1 content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.2.2 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) + depd: 2.0.0 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 - finalhandler: 2.1.0 + finalhandler: 2.1.1 fresh: 2.0.0 - http-errors: 2.0.0 + http-errors: 2.0.1 merge-descriptors: 2.0.0 - mime-types: 3.0.1 + mime-types: 3.0.2 on-finished: 2.4.1 once: 1.4.0 parseurl: 1.3.3 @@ -12535,9 +14487,9 @@ snapshots: qs: 6.14.0 range-parser: 1.2.1 router: 2.2.0 - send: 1.2.0 - serve-static: 2.2.0 - statuses: 2.0.1 + send: 1.2.1 + serve-static: 2.2.1 + statuses: 2.0.2 type-is: 2.0.1 vary: 1.1.2 transitivePeerDependencies: @@ -12545,12 +14497,6 @@ snapshots: extend@3.0.2: {} - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - extract-zip@2.0.1: dependencies: debug: 4.3.4 @@ -12563,7 +14509,7 @@ snapshots: extsprintf@1.3.0: {} - fast-content-type-parse@2.0.1: {} + fast-content-type-parse@3.0.0: {} fast-deep-equal@3.1.3: {} @@ -12581,9 +14527,7 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-redact@3.5.0: {} - - fast-uri@3.0.6: {} + fast-uri@3.1.0: {} fastq@1.19.1: dependencies: @@ -12597,9 +14541,9 @@ snapshots: dependencies: pend: 1.2.0 - fdir@6.4.4(picomatch@4.0.2): + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: - picomatch: 4.0.2 + picomatch: 4.0.3 fetch-blob@3.2.0: dependencies: @@ -12610,6 +14554,10 @@ snapshots: dependencies: flat-cache: 4.0.1 + filelist@1.0.4: + dependencies: + minimatch: 5.1.6 + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -12650,27 +14598,40 @@ snapshots: transitivePeerDependencies: - supports-color - finalhandler@2.1.0: + finalhandler@1.3.2: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 2.6.9 encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 parseurl: 1.3.3 - statuses: 2.0.1 + statuses: 2.0.2 + unpipe: 1.0.0 transitivePeerDependencies: - supports-color - find-cache-dir@3.3.2: + finalhandler@2.1.1: dependencies: - commondir: 1.0.1 - make-dir: 3.1.0 - pkg-dir: 4.2.0 + debug: 4.4.3(supports-color@10.2.2) + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + find-cache-directory@6.0.0: + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 8.0.0 find-replace@3.0.0: dependencies: array-back: 3.1.0 + find-up-simple@1.0.1: {} + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -12681,6 +14642,39 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 + firebase@12.7.0: + dependencies: + '@firebase/ai': 2.6.1(@firebase/app-types@0.9.3)(@firebase/app@0.14.6) + '@firebase/analytics': 0.10.19(@firebase/app@0.14.6) + '@firebase/analytics-compat': 0.2.25(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6) + '@firebase/app': 0.14.6 + '@firebase/app-check': 0.11.0(@firebase/app@0.14.6) + '@firebase/app-check-compat': 0.4.0(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6) + '@firebase/app-compat': 0.5.6 + '@firebase/app-types': 0.9.3 + '@firebase/auth': 1.12.0(@firebase/app@0.14.6) + '@firebase/auth-compat': 0.6.2(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6) + '@firebase/data-connect': 0.3.12(@firebase/app@0.14.6) + '@firebase/database': 1.1.0 + '@firebase/database-compat': 2.1.0 + '@firebase/firestore': 4.9.3(@firebase/app@0.14.6) + '@firebase/firestore-compat': 0.4.3(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6) + '@firebase/functions': 0.13.1(@firebase/app@0.14.6) + '@firebase/functions-compat': 0.4.1(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6) + '@firebase/installations': 0.6.19(@firebase/app@0.14.6) + '@firebase/installations-compat': 0.2.19(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6) + '@firebase/messaging': 0.12.23(@firebase/app@0.14.6) + '@firebase/messaging-compat': 0.2.23(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6) + '@firebase/performance': 0.7.9(@firebase/app@0.14.6) + '@firebase/performance-compat': 0.2.22(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6) + '@firebase/remote-config': 0.7.0(@firebase/app@0.14.6) + '@firebase/remote-config-compat': 0.2.20(@firebase/app-compat@0.5.6)(@firebase/app@0.14.6) + '@firebase/storage': 0.14.0(@firebase/app@0.14.6) + '@firebase/storage-compat': 0.4.0(@firebase/app-compat@0.5.6)(@firebase/app-types@0.9.3)(@firebase/app@0.14.6) + '@firebase/util': 1.13.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + flat-cache@4.0.1: dependencies: flatted: 3.3.3 @@ -12690,9 +14684,16 @@ snapshots: flatted@3.3.3: {} - follow-redirects@1.15.9(debug@4.4.0): + folder-hash@4.1.1(supports-color@10.2.2): + dependencies: + debug: 4.4.0(supports-color@10.2.2) + minimatch: 7.4.6 + transitivePeerDependencies: + - supports-color + + follow-redirects@1.15.11(debug@4.4.3): optionalDependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) for-each@0.3.5: dependencies: @@ -12705,25 +14706,20 @@ snapshots: forever-agent@0.6.1: {} - form-data@2.3.3: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 + form-data-encoder@1.7.2: {} - form-data@2.5.3: + form-data@2.3.3: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 - es-set-tostringtag: 2.1.0 mime-types: 2.1.35 - safe-buffer: 5.2.1 - form-data@4.0.2: + form-data@4.0.5: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 es-set-tostringtag: 2.1.0 + hasown: 2.0.2 mime-types: 2.1.35 formdata-polyfill@4.0.10: @@ -12732,7 +14728,7 @@ snapshots: forwarded@0.2.0: {} - fraction.js@4.3.7: {} + fraction.js@5.3.4: {} fresh@0.5.2: {} @@ -12752,10 +14748,6 @@ snapshots: jsonfile: 4.0.0 universalify: 0.1.2 - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - fs-minipass@3.0.3: dependencies: minipass: 7.1.2 @@ -12778,31 +14770,30 @@ snapshots: functions-have-names@1.2.3: {} - gaxios@6.7.1(encoding@0.1.13)(supports-color@10.0.0): + gaxios@7.1.3(supports-color@10.2.2): dependencies: extend: 3.0.2 - https-proxy-agent: 7.0.6(supports-color@10.0.0) - is-stream: 2.0.1 - node-fetch: 2.7.0(encoding@0.1.13) - uuid: 9.0.1 + https-proxy-agent: 7.0.6(supports-color@10.2.2) + node-fetch: 3.3.2 + rimraf: 5.0.10 transitivePeerDependencies: - - encoding - supports-color - gcp-metadata@6.1.1(encoding@0.1.13)(supports-color@10.0.0): + gcp-metadata@8.1.2(supports-color@10.2.2): dependencies: - gaxios: 6.7.1(encoding@0.1.13)(supports-color@10.0.0) - google-logging-utils: 0.0.2 + gaxios: 7.1.3(supports-color@10.2.2) + google-logging-utils: 1.1.3 json-bigint: 1.0.0 transitivePeerDependencies: - - encoding - supports-color + generator-function@2.0.1: {} + gensync@1.0.0-beta.2: {} get-caller-file@2.0.5: {} - get-east-asian-width@1.3.0: {} + get-east-asian-width@1.4.0: {} get-intrinsic@1.3.0: dependencies: @@ -12824,13 +14815,9 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 - get-stream@4.1.0: - dependencies: - pump: 3.0.2 - get-stream@5.2.0: dependencies: - pump: 3.0.2 + pump: 3.0.3 get-stream@6.0.1: {} @@ -12840,11 +14827,15 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 - get-uri@6.0.4: + get-tsconfig@4.13.0: + dependencies: + resolve-pkg-maps: 1.0.0 + + get-uri@6.0.5: dependencies: basic-ftp: 5.0.5 data-uri-to-buffer: 6.0.2 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -12852,6 +14843,14 @@ snapshots: dependencies: assert-plus: 1.0.0 + git-raw-commits@5.0.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.2.1): + dependencies: + '@conventional-changelog/git-client': 1.0.1(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.2.1) + meow: 13.2.0 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -12860,9 +14859,13 @@ snapshots: dependencies: is-glob: 4.0.3 + glob-to-regex.js@1.2.0(tslib@2.8.1): + dependencies: + tslib: 2.8.1 + glob-to-regexp@0.4.1: {} - glob@10.4.5: + glob@10.5.0: dependencies: foreground-child: 3.3.1 jackspeak: 3.4.3 @@ -12871,6 +14874,12 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@13.0.0: + dependencies: + minimatch: 10.1.1 + minipass: 7.1.2 + path-scurry: 2.0.1 + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -12880,11 +14889,9 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - globals@11.12.0: {} - globals@14.0.0: {} - globals@16.0.0: {} + globals@16.5.0: {} globalthis@1.0.4: dependencies: @@ -12909,55 +14916,72 @@ snapshots: pify: 2.3.0 pinkie-promise: 2.0.1 - google-auth-library@9.15.1(encoding@0.1.13)(supports-color@10.0.0): + google-auth-library@10.5.0(supports-color@10.2.2): dependencies: base64-js: 1.5.1 ecdsa-sig-formatter: 1.0.11 - gaxios: 6.7.1(encoding@0.1.13)(supports-color@10.0.0) - gcp-metadata: 6.1.1(encoding@0.1.13)(supports-color@10.0.0) - gtoken: 7.1.0(encoding@0.1.13)(supports-color@10.0.0) - jws: 4.0.0 + gaxios: 7.1.3(supports-color@10.2.2) + gcp-metadata: 8.1.2(supports-color@10.2.2) + google-logging-utils: 1.1.3 + gtoken: 8.0.0(supports-color@10.2.2) + jws: 4.0.1 transitivePeerDependencies: - - encoding - supports-color - google-gax@4.4.1(encoding@0.1.13)(supports-color@10.0.0): + google-gax@5.0.6(supports-color@10.2.2): dependencies: - '@grpc/grpc-js': 1.13.3 - '@grpc/proto-loader': 0.7.15 - '@types/long': 4.0.2 - abort-controller: 3.0.0 + '@grpc/grpc-js': 1.14.3 + '@grpc/proto-loader': 0.8.0 duplexify: 4.1.3 - google-auth-library: 9.15.1(encoding@0.1.13)(supports-color@10.0.0) - node-fetch: 2.7.0(encoding@0.1.13) + google-auth-library: 10.5.0(supports-color@10.2.2) + google-logging-utils: 1.1.3 + node-fetch: 3.3.2 object-hash: 3.0.0 - proto3-json-serializer: 2.0.2 - protobufjs: 7.4.0 - retry-request: 7.0.2(encoding@0.1.13)(supports-color@10.0.0) - uuid: 9.0.1 + proto3-json-serializer: 3.0.4 + protobufjs: 7.5.4 + retry-request: 8.0.2(supports-color@10.2.2) + rimraf: 5.0.10 transitivePeerDependencies: - - encoding - supports-color - google-logging-utils@0.0.2: {} + google-logging-utils@1.1.3: {} gopd@1.2.0: {} + got-cjs@12.5.4: + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 4.0.6 + '@types/responselike': 1.0.0 + cacheable-lookup: 6.1.0 + cacheable-request: 7.0.2 + decompress-response: 6.0.0 + form-data-encoder: 1.7.2 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 2.0.0 + p-cancelable: 2.1.1 + responselike: 2.0.1 + graceful-fs@4.2.11: {} - graphemer@1.4.0: {} + graphql-tag@2.12.6(graphql@16.12.0): + dependencies: + graphql: 16.12.0 + tslib: 2.8.1 - grpc-gcp@1.0.1(protobufjs@7.4.0): + graphql@16.12.0: {} + + grpc-gcp@1.0.1(protobufjs@7.5.4): dependencies: - '@grpc/grpc-js': 1.13.3 - protobufjs: 7.4.0 + '@grpc/grpc-js': 1.14.3 + protobufjs: 7.5.4 - gtoken@7.1.0(encoding@0.1.13)(supports-color@10.0.0): + gtoken@8.0.0(supports-color@10.2.2): dependencies: - gaxios: 6.7.1(encoding@0.1.13)(supports-color@10.0.0) - jws: 4.0.0 + gaxios: 7.1.3(supports-color@10.2.2) + jws: 4.0.1 transitivePeerDependencies: - - encoding - supports-color gunzip-maybe@1.4.2: @@ -13013,9 +15037,9 @@ snapshots: dependencies: function-bind: 1.1.2 - hosted-git-info@8.1.0: + hosted-git-info@9.0.2: dependencies: - lru-cache: 10.4.3 + lru-cache: 11.2.4 hpack.js@2.1.6: dependencies: @@ -13037,14 +15061,14 @@ snapshots: domelementtype: 2.3.0 domhandler: 5.0.3 domutils: 3.2.2 - entities: 6.0.0 + entities: 6.0.1 http-assert@1.5.0: dependencies: deep-equal: 1.0.1 http-errors: 1.8.1 - http-cache-semantics@4.1.1: {} + http-cache-semantics@4.2.0: {} http-deceiver@1.2.7: {} @@ -13071,50 +15095,58 @@ snapshots: statuses: 2.0.1 toidentifier: 1.0.1 + http-errors@2.0.1: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.2 + toidentifier: 1.0.1 + http-parser-js@0.5.10: {} - http-proxy-agent@5.0.0(supports-color@10.0.0): + http-proxy-agent@5.0.0(supports-color@10.2.2): dependencies: '@tootallnate/once': 2.0.0 - agent-base: 6.0.2(supports-color@10.0.0) - debug: 4.4.0(supports-color@10.0.0) + agent-base: 6.0.2(supports-color@10.2.2) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color http-proxy-agent@7.0.2: dependencies: - agent-base: 7.1.3 - debug: 4.4.0(supports-color@10.0.0) + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - http-proxy-middleware@2.0.9(@types/express@4.17.21): + http-proxy-middleware@2.0.9(@types/express@4.17.25): dependencies: - '@types/http-proxy': 1.17.16 - http-proxy: 1.18.1(debug@4.4.0) + '@types/http-proxy': 1.17.17 + http-proxy: 1.18.1(debug@4.4.3) is-glob: 4.0.3 is-plain-obj: 3.0.0 micromatch: 4.0.8 optionalDependencies: - '@types/express': 4.17.21 + '@types/express': 4.17.25 transitivePeerDependencies: - debug http-proxy-middleware@3.0.5: dependencies: - '@types/http-proxy': 1.17.16 - debug: 4.4.0(supports-color@10.0.0) - http-proxy: 1.18.1(debug@4.4.0) + '@types/http-proxy': 1.17.17 + debug: 4.4.3(supports-color@10.2.2) + http-proxy: 1.18.1(debug@4.4.3) is-glob: 4.0.3 is-plain-object: 5.0.0 micromatch: 4.0.8 transitivePeerDependencies: - supports-color - http-proxy@1.18.1(debug@4.4.0): + http-proxy@1.18.1(debug@4.4.3): dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.9(debug@4.4.0) + follow-redirects: 1.15.11(debug@4.4.3) requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -13131,10 +15163,13 @@ snapshots: jsprim: 2.0.2 sshpk: 1.18.0 - http-status-codes@2.2.0: {} - http-status-codes@2.3.0: {} + http2-wrapper@2.2.1: + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + https-proxy-agent@2.2.4: dependencies: agent-base: 4.3.0 @@ -13142,17 +15177,17 @@ snapshots: transitivePeerDependencies: - supports-color - https-proxy-agent@5.0.1(supports-color@10.0.0): + https-proxy-agent@5.0.1(supports-color@10.2.2): dependencies: - agent-base: 6.0.2(supports-color@10.0.0) - debug: 4.4.0(supports-color@10.0.0) + agent-base: 6.0.2(supports-color@10.2.2) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.6(supports-color@10.0.0): + https-proxy-agent@7.0.6(supports-color@10.2.2): dependencies: - agent-base: 7.1.3 - debug: 4.4.0(supports-color@10.0.0) + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -13170,18 +15205,26 @@ snapshots: dependencies: safer-buffer: 2.1.2 - icss-utils@5.1.0(postcss@8.5.3): + iconv-lite@0.7.1: + dependencies: + safer-buffer: 2.1.2 + + icss-utils@5.1.0(postcss@8.5.6): dependencies: - postcss: 8.5.3 + postcss: 8.5.6 + + idb@7.1.1: {} ieee754@1.2.1: {} - ignore-walk@7.0.0: + ignore-walk@8.0.0: dependencies: - minimatch: 9.0.5 + minimatch: 10.1.1 ignore@5.3.2: {} + ignore@7.0.5: {} + image-size@0.5.5: optional: true @@ -13189,7 +15232,7 @@ snapshots: immutable@3.8.2: {} - immutable@5.1.2: {} + immutable@5.1.4: {} import-fresh@3.3.1: dependencies: @@ -13211,9 +15254,9 @@ snapshots: ini@1.3.8: {} - ini@5.0.0: {} + ini@6.0.0: {} - injection-js@2.5.0: + injection-js@2.6.1: dependencies: tslib: 2.8.1 @@ -13230,18 +15273,13 @@ snapshots: hasown: 2.0.2 side-channel: 1.1.0 - interpret@1.4.0: {} - - ip-address@9.0.5: - dependencies: - jsbn: 1.1.0 - sprintf-js: 1.1.3 + ip-address@10.1.0: {} ip-regex@4.3.0: {} ipaddr.js@1.9.1: {} - ipaddr.js@2.2.0: {} + ipaddr.js@2.3.0: {} is-array-buffer@3.0.5: dependencies: @@ -13303,15 +15341,14 @@ snapshots: is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@4.0.0: {} - - is-fullwidth-code-point@5.0.0: + is-fullwidth-code-point@5.1.0: dependencies: - get-east-asian-width: 1.3.0 + get-east-asian-width: 1.4.0 - is-generator-function@1.1.0: + is-generator-function@1.1.2: dependencies: call-bound: 1.0.4 + generator-function: 2.0.1 get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 @@ -13322,11 +15359,13 @@ snapshots: is-gzip@1.0.0: {} + is-in-ssh@1.0.0: {} + is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 - is-interactive@1.0.0: {} + is-interactive@2.0.0: {} is-ip@3.1.0: dependencies: @@ -13336,7 +15375,11 @@ snapshots: is-module@1.0.0: {} - is-network-error@1.1.0: {} + is-negative-zero@2.0.3: {} + + is-network-error@1.3.0: {} + + is-node-process@1.2.0: {} is-number-like@1.0.8: dependencies: @@ -13375,7 +15418,7 @@ snapshots: is-reference@1.2.1: dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 is-regex@1.2.1: dependencies: @@ -13392,8 +15435,6 @@ snapshots: is-stream-ended@0.1.4: {} - is-stream@1.1.0: {} - is-stream@2.0.1: {} is-string@1.1.1: @@ -13413,7 +15454,7 @@ snapshots: is-typedarray@1.0.0: {} - is-unicode-supported@0.1.0: {} + is-unicode-supported@2.1.0: {} is-url@1.2.4: {} @@ -13440,7 +15481,7 @@ snapshots: dependencies: is-inside-container: 1.0.0 - is@3.3.0: {} + is@3.3.2: {} isarray@1.0.0: {} @@ -13448,7 +15489,7 @@ snapshots: isbinaryfile@4.0.10: {} - isbinaryfile@5.0.4: {} + isbinaryfile@5.0.7: {} isexe@2.0.0: {} @@ -13462,8 +15503,8 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.27.1 - '@babel/parser': 7.27.2 + '@babel/core': 7.28.5 + '@babel/parser': 7.28.5 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -13472,11 +15513,11 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: - '@babel/core': 7.27.1 - '@babel/parser': 7.27.2 + '@babel/core': 7.28.5 + '@babel/parser': 7.28.5 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.7.1 + semver: 7.7.3 transitivePeerDependencies: - supports-color @@ -13488,13 +15529,21 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: - supports-color - istanbul-reports@3.1.7: + istanbul-lib-source-maps@5.0.6: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + debug: 4.4.3(supports-color@10.2.2) + istanbul-lib-coverage: 3.2.2 + transitivePeerDependencies: + - supports-color + + istanbul-reports@3.2.0: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 @@ -13505,15 +15554,21 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jake@10.9.4: + dependencies: + async: 3.2.6 + filelist: 1.0.4 + picocolors: 1.1.1 + jasmine-core@2.8.0: {} jasmine-core@4.6.1: {} - jasmine-core@5.7.1: {} + jasmine-core@5.13.0: {} jasmine-reporters@2.5.2: dependencies: - '@xmldom/xmldom': 0.8.10 + '@xmldom/xmldom': 0.8.11 mkdirp: 1.0.4 jasmine-spec-reporter@7.0.0: @@ -13526,78 +15581,80 @@ snapshots: glob: 7.2.3 jasmine-core: 2.8.0 - jasmine@5.7.1: + jasmine@5.13.0: dependencies: - glob: 10.4.5 - jasmine-core: 5.7.1 + glob: 10.5.0 + jasmine-core: 5.13.0 jasminewd2@2.2.0: {} jest-worker@27.5.1: dependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 merge-stream: 2.0.0 supports-color: 8.1.1 - jiti@1.21.7: {} + jiti@2.6.1: {} - js-base64@3.7.7: {} + jose@6.1.3: {} + + js-base64@3.7.8: {} js-tokens@4.0.0: {} - js-yaml@4.1.0: + js-tokens@9.0.1: {} + + js-yaml@4.1.1: dependencies: argparse: 2.0.1 jsbn@0.1.1: {} - jsbn@1.1.0: {} - - jsdom@26.1.0: + jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: - cssstyle: 4.3.1 - data-urls: 5.0.0 - decimal.js: 10.5.0 + '@acemir/cssom': 0.9.29 + '@asamuzakjp/dom-selector': 6.7.6 + cssstyle: 5.3.5 + data-urls: 6.0.0 + decimal.js: 10.6.0 html-encoding-sniffer: 4.0.0 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@10.0.0) + https-proxy-agent: 7.0.6(supports-color@10.2.2) is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.20 - parse5: 7.3.0 - rrweb-cssom: 0.8.0 + parse5: 8.0.0 saxes: 6.0.0 symbol-tree: 3.2.4 - tough-cookie: 5.1.2 + tough-cookie: 6.0.0 w3c-xmlserializer: 5.0.0 - webidl-conversions: 7.0.0 + webidl-conversions: 8.0.0 whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 - whatwg-url: 14.2.0 - ws: 8.18.2 + whatwg-url: 15.1.0 + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - jsesc@3.0.2: {} - jsesc@3.1.0: {} json-bigint@1.0.0: dependencies: - bignumber.js: 9.3.0 + bignumber.js: 9.3.1 json-buffer@3.0.1: {} json-parse-even-better-errors@2.3.1: {} - json-parse-even-better-errors@4.0.0: {} + json-parse-even-better-errors@5.0.0: {} json-schema-traverse@0.4.1: {} json-schema-traverse@1.0.0: {} + json-schema-typed@8.0.2: {} + json-schema@0.4.0: {} json-stable-stringify-without-jsonify@1.0.1: {} @@ -13624,7 +15681,7 @@ snapshots: jsonwebtoken@9.0.2: dependencies: - jws: 3.2.2 + jws: 3.2.3 lodash.includes: 4.3.0 lodash.isboolean: 3.0.3 lodash.isinteger: 4.0.4 @@ -13633,7 +15690,7 @@ snapshots: lodash.isstring: 4.0.1 lodash.once: 4.1.1 ms: 2.1.3 - semver: 7.7.1 + semver: 7.7.3 jsprim@1.4.2: dependencies: @@ -13668,12 +15725,12 @@ snapshots: ecdsa-sig-formatter: 1.0.11 safe-buffer: 5.2.1 - jws@3.2.2: + jws@3.2.3: dependencies: jwa: 1.4.2 safe-buffer: 5.2.1 - jws@4.0.0: + jws@4.0.1: dependencies: jwa: 2.0.1 safe-buffer: 5.2.1 @@ -13688,30 +15745,30 @@ snapshots: istanbul-lib-instrument: 5.2.1 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.7 + istanbul-reports: 3.2.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - karma-jasmine-html-reporter@2.1.0(jasmine-core@5.7.1)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): + karma-jasmine-html-reporter@2.1.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.0.9)))(karma@6.4.4(bufferutil@4.0.9)): dependencies: - jasmine-core: 5.7.1 - karma: 6.4.4 - karma-jasmine: 5.1.0(karma@6.4.4) + jasmine-core: 5.13.0 + karma: 6.4.4(bufferutil@4.0.9) + karma-jasmine: 5.1.0(karma@6.4.4(bufferutil@4.0.9)) - karma-jasmine@5.1.0(karma@6.4.4): + karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.0.9)): dependencies: jasmine-core: 4.6.1 - karma: 6.4.4 + karma: 6.4.4(bufferutil@4.0.9) karma-source-map-support@1.4.0: dependencies: source-map-support: 0.5.21 - karma@6.4.4: + karma@6.4.4(bufferutil@4.0.9): dependencies: '@colors/colors': 1.5.0 - body-parser: 1.20.3 + body-parser: 1.20.4 braces: 3.0.3 chokidar: 3.6.0 connect: 3.7.0 @@ -13719,7 +15776,7 @@ snapshots: dom-serialize: 2.2.1 glob: 7.2.3 graceful-fs: 4.2.11 - http-proxy: 1.18.1(debug@4.4.0) + http-proxy: 1.18.1(debug@4.4.3) isbinaryfile: 4.0.10 lodash: 4.17.21 log4js: 6.9.1 @@ -13729,10 +15786,10 @@ snapshots: qjobs: 1.2.0 range-parser: 1.2.1 rimraf: 3.0.2 - socket.io: 4.8.1 + socket.io: 4.8.1(bufferutil@4.0.9)(utf-8-validate@6.0.5) source-map: 0.6.1 - tmp: 0.2.3 - ua-parser-js: 0.7.40 + tmp: 0.2.5 + ua-parser-js: 0.7.41 yargs: 16.2.0 transitivePeerDependencies: - bufferutil @@ -13763,7 +15820,7 @@ snapshots: koa-send@5.0.1: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) http-errors: 1.8.1 resolve-path: 1.4.0 transitivePeerDependencies: @@ -13776,14 +15833,14 @@ snapshots: transitivePeerDependencies: - supports-color - koa@2.16.1: + koa@2.16.3: dependencies: accepts: 1.3.8 cache-content-type: 1.0.1 content-disposition: 0.5.4 content-type: 1.0.5 cookies: 0.9.1 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) delegates: 1.0.0 depd: 2.0.0 destroy: 1.2.0 @@ -13792,7 +15849,7 @@ snapshots: fresh: 0.5.2 http-assert: 1.5.0 http-errors: 1.8.1 - is-generator-function: 1.1.0 + is-generator-function: 1.1.2 koa-compose: 4.1.0 koa-convert: 2.0.0 on-finished: 2.4.1 @@ -13804,18 +15861,18 @@ snapshots: transitivePeerDependencies: - supports-color - launch-editor@2.10.0: + launch-editor@2.12.0: dependencies: picocolors: 1.1.1 - shell-quote: 1.8.2 + shell-quote: 1.8.3 - less-loader@12.3.0(less@4.3.0)(webpack@5.99.8(esbuild@0.25.4)): + less-loader@12.3.0(less@4.4.2)(webpack@5.104.0(esbuild@0.27.1)): dependencies: - less: 4.3.0 + less: 4.4.2 optionalDependencies: - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) - less@4.3.0: + less@4.4.2: dependencies: copy-anything: 2.0.6 parse-node-version: 1.0.1 @@ -13834,11 +15891,11 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - license-webpack-plugin@4.0.2(webpack@5.99.8(esbuild@0.25.4)): + license-webpack-plugin@4.0.2(webpack@5.104.0(esbuild@0.27.1)): dependencies: - webpack-sources: 3.2.3 + webpack-sources: 3.3.3 optionalDependencies: - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) lie@3.3.0: dependencies: @@ -13855,33 +15912,33 @@ snapshots: lines-and-columns@1.2.4: {} - listr2@8.3.3: + listr2@9.0.5: dependencies: - cli-truncate: 4.0.0 + cli-truncate: 5.1.1 colorette: 2.0.20 eventemitter3: 5.0.1 log-update: 6.1.0 rfdc: 1.4.1 - wrap-ansi: 9.0.0 + wrap-ansi: 9.0.2 - lmdb@3.3.0: + lmdb@3.4.4: dependencies: - msgpackr: 1.11.2 + msgpackr: 1.11.8 node-addon-api: 6.1.0 node-gyp-build-optional-packages: 5.2.2 - ordered-binary: 1.5.3 + ordered-binary: 1.6.0 weak-lru-cache: 1.2.2 optionalDependencies: - '@lmdb/lmdb-darwin-arm64': 3.3.0 - '@lmdb/lmdb-darwin-x64': 3.3.0 - '@lmdb/lmdb-linux-arm': 3.3.0 - '@lmdb/lmdb-linux-arm64': 3.3.0 - '@lmdb/lmdb-linux-x64': 3.3.0 - '@lmdb/lmdb-win32-arm64': 3.3.0 - '@lmdb/lmdb-win32-x64': 3.3.0 + '@lmdb/lmdb-darwin-arm64': 3.4.4 + '@lmdb/lmdb-darwin-x64': 3.4.4 + '@lmdb/lmdb-linux-arm': 3.4.4 + '@lmdb/lmdb-linux-arm64': 3.4.4 + '@lmdb/lmdb-linux-x64': 3.4.4 + '@lmdb/lmdb-win32-arm64': 3.4.4 + '@lmdb/lmdb-win32-x64': 3.4.4 optional: true - loader-runner@4.3.0: {} + loader-runner@4.3.1: {} loader-utils@2.0.4: dependencies: @@ -13929,10 +15986,10 @@ snapshots: lodash@4.17.21: {} - log-symbols@4.1.0: + log-symbols@7.0.1: dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 + is-unicode-supported: 2.1.0 + yoctocolors: 2.1.2 log-update@4.0.0: dependencies: @@ -13943,16 +16000,16 @@ snapshots: log-update@6.1.0: dependencies: - ansi-escapes: 7.0.0 + ansi-escapes: 7.2.0 cli-cursor: 5.0.0 - slice-ansi: 7.1.0 - strip-ansi: 7.1.0 - wrap-ansi: 9.0.0 + slice-ansi: 7.1.2 + strip-ansi: 7.1.2 + wrap-ansi: 9.0.2 log4js@6.9.1: dependencies: date-format: 4.0.14 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) flatted: 3.3.3 rfdc: 1.4.1 streamroller: 3.1.5 @@ -13961,8 +16018,6 @@ snapshots: long@5.3.2: {} - loupe@3.1.3: {} - lowdb@1.0.0: dependencies: graceful-fs: 4.2.11 @@ -13971,8 +16026,12 @@ snapshots: pify: 3.0.0 steno: 0.4.4 + lowercase-keys@2.0.0: {} + lru-cache@10.4.3: {} + lru-cache@11.2.4: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -13981,9 +16040,15 @@ snapshots: lru-cache@8.0.5: {} - magic-string@0.30.17: + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + magicast@0.5.1: dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 + source-map-js: 1.2.1 make-dir@2.1.0: dependencies: @@ -13991,29 +16056,25 @@ snapshots: semver: 5.7.2 optional: true - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - make-dir@4.0.0: dependencies: - semver: 7.7.1 + semver: 7.7.3 make-error@1.3.6: {} - make-fetch-happen@14.0.3: + make-fetch-happen@15.0.3: dependencies: - '@npmcli/agent': 3.0.0 - cacache: 19.0.1 - http-cache-semantics: 4.1.1 + '@npmcli/agent': 4.0.0 + cacache: 20.0.3 + http-cache-semantics: 4.2.0 minipass: 7.1.2 - minipass-fetch: 4.0.1 + minipass-fetch: 5.0.0 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 negotiator: 1.0.0 - proc-log: 5.0.0 + proc-log: 6.1.0 promise-retry: 2.0.1 - ssri: 12.0.0 + ssri: 13.0.0 transitivePeerDependencies: - supports-color @@ -14021,17 +16082,23 @@ snapshots: math-intrinsics@1.1.0: {} + mdn-data@2.12.2: {} + media-typer@0.3.0: {} media-typer@1.1.0: {} - memfs@4.17.1: + memfs@4.51.1: dependencies: - '@jsonjoy.com/json-pack': 1.2.0(tslib@2.8.1) - '@jsonjoy.com/util': 1.6.0(tslib@2.8.1) - tree-dump: 1.0.2(tslib@2.8.1) + '@jsonjoy.com/json-pack': 1.21.0(tslib@2.8.1) + '@jsonjoy.com/util': 1.9.0(tslib@2.8.1) + glob-to-regex.js: 1.2.0(tslib@2.8.1) + thingies: 2.5.0(tslib@2.8.1) + tree-dump: 1.1.0(tslib@2.8.1) tslib: 2.8.1 + meow@13.2.0: {} + merge-descriptors@1.0.3: {} merge-descriptors@2.0.0: {} @@ -14055,7 +16122,7 @@ snapshots: dependencies: mime-db: 1.52.0 - mime-types@3.0.1: + mime-types@3.0.2: dependencies: mime-db: 1.54.0 @@ -14069,25 +16136,37 @@ snapshots: mimic-function@5.0.1: {} - mini-css-extract-plugin@2.9.2(webpack@5.99.8(esbuild@0.25.4)): + mimic-response@1.0.1: {} + + mimic-response@3.1.0: {} + + mini-css-extract-plugin@2.9.4(webpack@5.104.0(esbuild@0.27.1)): dependencies: - schema-utils: 4.3.2 - tapable: 2.2.1 - webpack: 5.99.8(esbuild@0.25.4) + schema-utils: 4.3.3 + tapable: 2.3.0 + webpack: 5.104.0(esbuild@0.27.1) minimalistic-assert@1.0.1: {} + minimatch@10.1.1: + dependencies: + '@isaacs/brace-expansion': 5.0.0 + minimatch@3.1.2: dependencies: - brace-expansion: 1.1.11 + brace-expansion: 1.1.12 + + minimatch@5.1.6: + dependencies: + brace-expansion: 2.0.2 minimatch@7.4.6: dependencies: - brace-expansion: 2.0.1 + brace-expansion: 2.0.2 minimatch@9.0.5: dependencies: - brace-expansion: 2.0.1 + brace-expansion: 2.0.2 minimist@1.2.8: {} @@ -14095,11 +16174,11 @@ snapshots: dependencies: minipass: 7.1.2 - minipass-fetch@4.0.1: + minipass-fetch@5.0.0: dependencies: minipass: 7.1.2 minipass-sized: 1.0.3 - minizlib: 3.0.2 + minizlib: 3.1.0 optionalDependencies: encoding: 0.1.13 @@ -14119,16 +16198,9 @@ snapshots: dependencies: yallist: 4.0.0 - minipass@5.0.0: {} - minipass@7.1.2: {} - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - minizlib@3.0.2: + minizlib@3.1.0: dependencies: minipass: 7.1.2 @@ -14144,8 +16216,6 @@ snapshots: mkdirp@1.0.4: {} - mkdirp@3.0.1: {} - mrmime@2.0.1: {} ms@2.0.0: {} @@ -14166,7 +16236,7 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64': 3.0.3 optional: true - msgpackr@1.11.2: + msgpackr@1.11.8: optionalDependencies: msgpackr-extract: 3.0.3 optional: true @@ -14176,10 +16246,16 @@ snapshots: dns-packet: 5.6.1 thunky: 1.1.0 - mute-stream@1.0.0: {} + multimatch@7.0.0: + dependencies: + array-differ: 4.0.0 + array-union: 3.0.1 + minimatch: 9.0.5 mute-stream@2.0.0: {} + mute-stream@3.0.0: {} + nanocolors@0.2.13: {} nanoid@3.3.11: {} @@ -14189,7 +16265,7 @@ snapshots: needle@3.3.1: dependencies: iconv-lite: 0.6.3 - sax: 1.4.1 + sax: 1.4.3 optional: true negotiator@0.6.3: {} @@ -14202,36 +16278,40 @@ snapshots: netmask@2.0.2: {} - ng-packagr@20.0.0-rc.0(@angular/compiler-cli@20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3))(tslib@2.8.1)(typescript@5.8.3): + ng-packagr@21.1.0-next.0(@angular/compiler-cli@21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3))(tslib@2.8.1)(typescript@5.9.3): dependencies: '@ampproject/remapping': 2.3.0 - '@angular/compiler-cli': 20.0.0-next.9(@angular/compiler@20.0.0-next.9)(typescript@5.8.3) - '@rollup/plugin-json': 6.1.0(rollup@4.40.2) - '@rollup/wasm-node': 4.40.2 + '@angular/compiler-cli': 21.1.0-next.4(@angular/compiler@21.1.0-next.4)(typescript@5.9.3) + '@rollup/plugin-json': 6.1.0(rollup@4.53.5) + '@rollup/wasm-node': 4.54.0 ajv: 8.17.1 ansi-colors: 4.1.3 - browserslist: 4.24.5 + browserslist: 4.28.1 chokidar: 4.0.3 - commander: 13.1.0 + commander: 14.0.2 dependency-graph: 1.0.0 - esbuild: 0.25.4 - find-cache-dir: 3.3.2 - injection-js: 2.5.0 + esbuild: 0.27.1 + find-cache-directory: 6.0.0 + injection-js: 2.6.1 jsonc-parser: 3.3.1 - less: 4.3.0 - ora: 5.4.1 - piscina: 4.9.2 - postcss: 8.5.3 - rollup-plugin-dts: 6.2.1(rollup@4.40.2)(typescript@5.8.3) + less: 4.4.2 + ora: 9.0.0 + piscina: 5.1.4 + postcss: 8.5.6 + rollup-plugin-dts: 6.3.0(rollup@4.53.5)(typescript@5.9.3) rxjs: 7.8.2 - sass: 1.87.0 - tinyglobby: 0.2.13 + sass: 1.97.0 + tinyglobby: 0.2.15 tslib: 2.8.1 - typescript: 5.8.3 + typescript: 5.9.3 optionalDependencies: - rollup: 4.40.2 + rollup: 4.53.5 - nice-try@1.0.5: {} + nock@14.0.10: + dependencies: + '@mswjs/interceptors': 0.39.8 + json-stringify-safe: 5.0.1 + propagate: 2.0.1 node-addon-api@6.1.0: optional: true @@ -14241,7 +16321,7 @@ snapshots: node-domexception@1.0.0: {} - node-fetch-native@1.6.6: {} + node-fetch-native@1.6.7: {} node-fetch@2.6.7(encoding@0.1.13): dependencies: @@ -14261,95 +16341,90 @@ snapshots: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 - node-forge@1.3.1: {} + node-forge@1.3.3: {} node-gyp-build-optional-packages@5.2.2: dependencies: - detect-libc: 2.0.4 + detect-libc: 2.1.2 optional: true - node-gyp@11.2.0: + node-gyp-build@4.8.4: {} + + node-gyp@12.1.0: dependencies: env-paths: 2.2.1 - exponential-backoff: 3.1.2 + exponential-backoff: 3.1.3 graceful-fs: 4.2.11 - make-fetch-happen: 14.0.3 - nopt: 8.1.0 - proc-log: 5.0.0 - semver: 7.7.1 - tar: 7.4.3 - tinyglobby: 0.2.13 - which: 5.0.0 + make-fetch-happen: 15.0.3 + nopt: 9.0.0 + proc-log: 6.1.0 + semver: 7.7.3 + tar: 7.5.2 + tinyglobby: 0.2.15 + which: 6.0.0 transitivePeerDependencies: - supports-color - node-releases@2.0.19: {} + node-releases@2.0.27: {} - nopt@8.1.0: + nopt@9.0.0: dependencies: - abbrev: 3.0.1 + abbrev: 4.0.0 normalize-path@3.0.0: {} - normalize-range@0.1.2: {} + normalize-url@6.1.0: {} - npm-bundled@4.0.0: + npm-bundled@5.0.0: dependencies: - npm-normalize-package-bin: 4.0.0 + npm-normalize-package-bin: 5.0.0 - npm-install-checks@7.1.1: + npm-install-checks@8.0.0: dependencies: - semver: 7.7.1 + semver: 7.7.3 - npm-normalize-package-bin@4.0.0: {} + npm-normalize-package-bin@5.0.0: {} - npm-package-arg@12.0.2: + npm-package-arg@13.0.2: dependencies: - hosted-git-info: 8.1.0 - proc-log: 5.0.0 - semver: 7.7.1 - validate-npm-package-name: 6.0.0 + hosted-git-info: 9.0.2 + proc-log: 6.1.0 + semver: 7.7.3 + validate-npm-package-name: 7.0.1 - npm-packlist@9.0.0: + npm-packlist@10.0.3: dependencies: - ignore-walk: 7.0.0 + ignore-walk: 8.0.0 + proc-log: 6.1.0 - npm-pick-manifest@10.0.0: + npm-pick-manifest@11.0.3: dependencies: - npm-install-checks: 7.1.1 - npm-normalize-package-bin: 4.0.0 - npm-package-arg: 12.0.2 - semver: 7.7.1 + npm-install-checks: 8.0.0 + npm-normalize-package-bin: 5.0.0 + npm-package-arg: 13.0.2 + semver: 7.7.3 - npm-registry-fetch@18.0.2: + npm-registry-fetch@19.1.1: dependencies: - '@npmcli/redact': 3.2.2 + '@npmcli/redact': 4.0.0 jsonparse: 1.3.1 - make-fetch-happen: 14.0.3 + make-fetch-happen: 15.0.3 minipass: 7.1.2 - minipass-fetch: 4.0.1 - minizlib: 3.0.2 - npm-package-arg: 12.0.2 - proc-log: 5.0.0 + minipass-fetch: 5.0.0 + minizlib: 3.1.0 + npm-package-arg: 13.0.2 + proc-log: 6.1.0 transitivePeerDependencies: - supports-color - npm-run-path@2.0.2: - dependencies: - path-key: 2.0.1 - npm-run-path@4.0.1: dependencies: path-key: 3.1.1 - npm@11.3.0: {} - nth-check@2.1.1: dependencies: boolbase: 1.0.0 - nwsapi@2.2.20: {} - oauth-sign@0.9.0: {} object-assign@4.1.1: {} @@ -14373,14 +16448,14 @@ snapshots: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-object-atoms: 1.1.1 object.groupby@1.0.3: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 object.values@1.2.1: dependencies: @@ -14391,6 +16466,8 @@ snapshots: obuf@1.1.2: {} + obug@2.1.1: {} + on-exit-leak-free@2.1.2: {} on-finished@2.3.0: @@ -14401,7 +16478,7 @@ snapshots: dependencies: ee-first: 1.1.1 - on-headers@1.0.2: {} + on-headers@1.1.0: {} once@1.4.0: dependencies: @@ -14417,12 +16494,21 @@ snapshots: only@0.0.2: {} - open@10.1.2: + open@10.2.0: dependencies: - default-browser: 5.2.1 + default-browser: 5.4.0 define-lazy-prop: 3.0.0 is-inside-container: 1.0.0 - is-wsl: 3.1.0 + wsl-utils: 0.1.0 + + open@11.0.0: + dependencies: + default-browser: 5.4.0 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.1.0 + wsl-utils: 0.3.0 open@8.4.2: dependencies: @@ -14443,29 +16529,33 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - ora@5.4.1: + ora@9.0.0: dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - ordered-binary@1.5.3: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.3.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.2.2 + string-width: 8.1.0 + strip-ansi: 7.1.2 + + ordered-binary@1.6.0: optional: true os-tmpdir@1.0.2: {} + outvariant@1.4.3: {} + own-keys@1.0.1: dependencies: get-intrinsic: 1.3.0 object-keys: 1.1.1 safe-push-apply: 1.0.0 + p-cancelable@2.1.1: {} + p-event@4.2.0: dependencies: p-timeout: 3.2.0 @@ -14488,7 +16578,7 @@ snapshots: dependencies: p-limit: 3.1.0 - p-map@7.0.3: {} + p-map@7.0.4: {} p-queue@6.6.2: dependencies: @@ -14498,7 +16588,7 @@ snapshots: p-retry@6.2.1: dependencies: '@types/retry': 0.12.2 - is-network-error: 1.1.0 + is-network-error: 1.3.0 retry: 0.13.1 p-timeout@3.2.0: @@ -14510,11 +16600,11 @@ snapshots: pac-proxy-agent@7.2.0: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 - agent-base: 7.1.3 - debug: 4.4.0(supports-color@10.0.0) - get-uri: 6.0.4 + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) + get-uri: 6.0.5 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@10.0.0) + https-proxy-agent: 7.0.6(supports-color@10.2.2) pac-resolver: 7.0.1 socks-proxy-agent: 8.0.5 transitivePeerDependencies: @@ -14527,25 +16617,25 @@ snapshots: package-json-from-dist@1.0.1: {} - pacote@20.0.0: + pacote@21.0.4: dependencies: - '@npmcli/git': 6.0.3 - '@npmcli/installed-package-contents': 3.0.0 - '@npmcli/package-json': 6.1.1 - '@npmcli/promise-spawn': 8.0.2 - '@npmcli/run-script': 9.1.0 - cacache: 19.0.1 + '@npmcli/git': 7.0.1 + '@npmcli/installed-package-contents': 4.0.0 + '@npmcli/package-json': 7.0.4 + '@npmcli/promise-spawn': 9.0.1 + '@npmcli/run-script': 10.0.3 + cacache: 20.0.3 fs-minipass: 3.0.3 minipass: 7.1.2 - npm-package-arg: 12.0.2 - npm-packlist: 9.0.0 - npm-pick-manifest: 10.0.0 - npm-registry-fetch: 18.0.2 - proc-log: 5.0.0 + npm-package-arg: 13.0.2 + npm-packlist: 10.0.3 + npm-pick-manifest: 11.0.3 + npm-registry-fetch: 19.1.1 + proc-log: 6.1.0 promise-retry: 2.0.1 - sigstore: 3.1.0 - ssri: 12.0.0 - tar: 6.2.1 + sigstore: 4.1.0 + ssri: 13.0.0 + tar: 7.5.2 transitivePeerDependencies: - supports-color @@ -14560,27 +16650,27 @@ snapshots: parse-json@5.2.0: dependencies: '@babel/code-frame': 7.27.1 - error-ex: 1.3.2 + error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 parse-node-version@1.0.1: {} - parse5-html-rewriting-stream@7.1.0: + parse5-html-rewriting-stream@8.0.0: dependencies: - entities: 6.0.0 - parse5: 7.3.0 - parse5-sax-parser: 7.0.0 + entities: 6.0.1 + parse5: 8.0.0 + parse5-sax-parser: 8.0.0 - parse5-sax-parser@7.0.0: + parse5-sax-parser@8.0.0: dependencies: - parse5: 7.3.0 + parse5: 8.0.0 parse5@6.0.1: {} - parse5@7.3.0: + parse5@8.0.0: dependencies: - entities: 6.0.0 + entities: 6.0.1 parseurl@1.3.3: {} @@ -14590,8 +16680,6 @@ snapshots: path-is-inside@1.0.2: {} - path-key@2.0.1: {} - path-key@3.1.1: {} path-parse@1.0.7: {} @@ -14601,9 +16689,14 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@2.0.1: + dependencies: + lru-cache: 11.2.4 + minipass: 7.1.2 + path-to-regexp@0.1.12: {} - path-to-regexp@8.2.0: {} + path-to-regexp@8.3.0: {} path-type@4.0.0: {} @@ -14611,8 +16704,6 @@ snapshots: pathe@2.0.3: {} - pathval@2.0.0: {} - peek-stream@1.1.3: dependencies: buffer-from: 1.1.2 @@ -14627,7 +16718,7 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.2: {} + picomatch@4.0.3: {} pify@2.3.0: {} @@ -14653,42 +16744,36 @@ snapshots: pino-std-serializers@7.0.0: {} - pino@9.6.0: + pino@9.14.0: dependencies: + '@pinojs/redact': 0.4.0 atomic-sleep: 1.0.0 - fast-redact: 3.5.0 on-exit-leak-free: 2.1.2 pino-abstract-transport: 2.0.0 pino-std-serializers: 7.0.0 - process-warning: 4.0.1 + process-warning: 5.0.0 quick-format-unescaped: 4.0.4 real-require: 0.2.0 safe-stable-stringify: 2.5.0 sonic-boom: 4.2.0 thread-stream: 3.1.0 - piscina@4.9.2: - optionalDependencies: - '@napi-rs/nice': 1.0.1 - - piscina@5.0.0: + piscina@5.1.4: optionalDependencies: - '@napi-rs/nice': 1.0.1 + '@napi-rs/nice': 1.1.1 - pkce-challenge@5.0.0: {} + pkce-challenge@5.0.1: {} - pkg-dir@4.2.0: + pkg-dir@8.0.0: dependencies: - find-up: 4.1.0 - - pkginfo@0.4.1: {} + find-up-simple: 1.0.1 pluralize@8.0.0: {} - portfinder@1.0.37: + portfinder@1.0.38: dependencies: async: 3.2.6 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -14699,64 +16784,66 @@ snapshots: possible-typed-array-names@1.1.0: {} - postcss-loader@8.1.1(postcss@8.5.3)(typescript@5.8.3)(webpack@5.99.8(esbuild@0.25.4)): + postcss-loader@8.2.0(postcss@8.5.6)(typescript@5.9.3)(webpack@5.104.0(esbuild@0.27.1)): dependencies: - cosmiconfig: 9.0.0(typescript@5.8.3) - jiti: 1.21.7 - postcss: 8.5.3 - semver: 7.7.1 + cosmiconfig: 9.0.0(typescript@5.9.3) + jiti: 2.6.1 + postcss: 8.5.6 + semver: 7.7.3 optionalDependencies: - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) transitivePeerDependencies: - typescript postcss-media-query-parser@0.2.3: {} - postcss-modules-extract-imports@3.1.0(postcss@8.5.3): + postcss-modules-extract-imports@3.1.0(postcss@8.5.6): dependencies: - postcss: 8.5.3 + postcss: 8.5.6 - postcss-modules-local-by-default@4.2.0(postcss@8.5.3): + postcss-modules-local-by-default@4.2.0(postcss@8.5.6): dependencies: - icss-utils: 5.1.0(postcss@8.5.3) - postcss: 8.5.3 - postcss-selector-parser: 7.1.0 + icss-utils: 5.1.0(postcss@8.5.6) + postcss: 8.5.6 + postcss-selector-parser: 7.1.1 postcss-value-parser: 4.2.0 - postcss-modules-scope@3.2.1(postcss@8.5.3): + postcss-modules-scope@3.2.1(postcss@8.5.6): dependencies: - postcss: 8.5.3 - postcss-selector-parser: 7.1.0 + postcss: 8.5.6 + postcss-selector-parser: 7.1.1 - postcss-modules-values@4.0.0(postcss@8.5.3): + postcss-modules-values@4.0.0(postcss@8.5.6): dependencies: - icss-utils: 5.1.0(postcss@8.5.3) - postcss: 8.5.3 + icss-utils: 5.1.0(postcss@8.5.6) + postcss: 8.5.6 - postcss-selector-parser@7.1.0: + postcss-selector-parser@7.1.1: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 postcss-value-parser@4.2.0: {} - postcss@8.5.3: + postcss@8.5.6: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 + powershell-utils@0.1.0: {} + prelude-ls@1.2.1: {} - prettier@3.5.3: {} + prettier@3.7.4: {} - proc-log@5.0.0: {} + proc-log@6.1.0: {} process-nextick-args@2.0.1: {} process-warning@1.0.0: {} - process-warning@4.0.1: {} + process-warning@5.0.0: {} process@0.11.10: {} @@ -14767,11 +16854,13 @@ snapshots: err-code: 2.0.3 retry: 0.12.0 - proto3-json-serializer@2.0.2: + propagate@2.0.1: {} + + proto3-json-serializer@3.0.4: dependencies: - protobufjs: 7.4.0 + protobufjs: 7.5.4 - protobufjs@7.4.0: + protobufjs@7.5.4: dependencies: '@protobufjs/aspromise': 1.1.2 '@protobufjs/base64': 1.1.2 @@ -14783,7 +16872,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.17.44 + '@types/node': 22.19.3 long: 5.3.2 protractor@7.0.0: @@ -14813,10 +16902,10 @@ snapshots: proxy-agent@6.5.0: dependencies: - agent-base: 7.1.3 - debug: 4.4.0(supports-color@10.0.0) + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@10.0.0) + https-proxy-agent: 7.0.6(supports-color@10.2.2) lru-cache: 7.18.3 pac-proxy-agent: 7.2.0 proxy-from-env: 1.1.0 @@ -14835,12 +16924,12 @@ snapshots: pump@2.0.1: dependencies: - end-of-stream: 1.4.4 + end-of-stream: 1.4.5 once: 1.4.0 - pump@3.0.2: + pump@3.0.3: dependencies: - end-of-stream: 1.4.4 + end-of-stream: 1.4.5 once: 1.4.0 pumpify@1.5.1: @@ -14853,44 +16942,47 @@ snapshots: punycode@2.3.1: {} - puppeteer-core@18.2.1(encoding@0.1.13): + puppeteer-core@18.2.1(bufferutil@4.0.9)(encoding@0.1.13): dependencies: cross-fetch: 3.1.5(encoding@0.1.13) debug: 4.3.4 devtools-protocol: 0.0.1045489 extract-zip: 2.0.1 - https-proxy-agent: 5.0.1(supports-color@10.0.0) + https-proxy-agent: 5.0.1(supports-color@10.2.2) proxy-from-env: 1.1.0 rimraf: 3.0.2 tar-fs: 2.1.1 unbzip2-stream: 1.4.3 - ws: 8.9.0 + ws: 8.9.0(bufferutil@4.0.9) transitivePeerDependencies: - bufferutil - encoding - supports-color - utf-8-validate - puppeteer-core@24.8.1: + puppeteer-core@24.34.0(bufferutil@4.0.9): dependencies: - '@puppeteer/browsers': 2.10.3 - chromium-bidi: 5.1.0(devtools-protocol@0.0.1439962) - debug: 4.4.0(supports-color@10.0.0) - devtools-protocol: 0.0.1439962 + '@puppeteer/browsers': 2.11.0 + chromium-bidi: 12.0.1(devtools-protocol@0.0.1534754) + debug: 4.4.3(supports-color@10.2.2) + devtools-protocol: 0.0.1534754 typed-query-selector: 2.12.0 - ws: 8.18.2 + webdriver-bidi-protocol: 0.3.10 + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) transitivePeerDependencies: + - bare-abort-controller - bare-buffer - bufferutil + - react-native-b4a - supports-color - utf-8-validate - puppeteer@18.2.1(encoding@0.1.13): + puppeteer@18.2.1(bufferutil@4.0.9)(encoding@0.1.13): dependencies: - https-proxy-agent: 5.0.1(supports-color@10.0.0) + https-proxy-agent: 5.0.1(supports-color@10.2.2) progress: 2.0.3 proxy-from-env: 1.1.0 - puppeteer-core: 18.2.1(encoding@0.1.13) + puppeteer-core: 18.2.1(bufferutil@4.0.9)(encoding@0.1.13) transitivePeerDependencies: - bufferutil - encoding @@ -14915,14 +17007,16 @@ snapshots: quick-format-unescaped@4.0.4: {} - quicktype-core@23.1.3(encoding@0.1.13): + quick-lru@5.1.1: {} + + quicktype-core@23.2.6(encoding@0.1.13): dependencies: '@glideapps/ts-necessities': 2.2.3 browser-or-node: 3.0.0 collection-utils: 1.0.1 cross-fetch: 4.1.0(encoding@0.1.13) is-url: 1.2.4 - js-base64: 3.7.7 + js-base64: 3.7.8 lodash: 4.17.21 pako: 1.0.11 pluralize: 8.0.0 @@ -14930,7 +17024,7 @@ snapshots: unicode-properties: 1.4.1 urijs: 1.19.11 wordwrap: 1.0.0 - yaml: 2.7.1 + yaml: 2.8.2 transitivePeerDependencies: - encoding @@ -14947,11 +17041,18 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - raw-body@3.0.0: + raw-body@2.5.3: dependencies: bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.6.3 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + + raw-body@3.0.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.7.1 unpipe: 1.0.0 readable-stream@2.3.8: @@ -14992,11 +17093,9 @@ snapshots: readdirp@4.1.2: {} - real-require@0.2.0: {} + readdirp@5.0.0: {} - rechoir@0.6.2: - dependencies: - resolve: 1.22.10 + real-require@0.2.0: {} reflect-metadata@0.2.2: {} @@ -15004,14 +17103,14 @@ snapshots: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-errors: 1.3.0 es-object-atoms: 1.1.1 get-intrinsic: 1.3.0 get-proto: 1.0.1 which-builtin-type: 1.2.1 - regenerate-unicode-properties@10.2.0: + regenerate-unicode-properties@10.2.2: dependencies: regenerate: 1.4.2 @@ -15028,20 +17127,20 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 - regexpu-core@6.2.0: + regexpu-core@6.4.0: dependencies: regenerate: 1.4.2 - regenerate-unicode-properties: 10.2.0 + regenerate-unicode-properties: 10.2.2 regjsgen: 0.8.0 - regjsparser: 0.12.0 + regjsparser: 0.13.0 unicode-match-property-ecmascript: 2.0.0 - unicode-match-property-value-ecmascript: 2.2.0 + unicode-match-property-value-ecmascript: 2.2.1 regjsgen@0.8.0: {} - regjsparser@0.12.0: + regjsparser@0.13.0: dependencies: - jsesc: 3.0.2 + jsesc: 3.1.0 request@2.88.2: dependencies: @@ -15074,6 +17173,8 @@ snapshots: requires-port@1.0.0: {} + resolve-alpn@1.2.1: {} + resolve-from@4.0.0: {} resolve-path@1.4.0: @@ -15081,15 +17182,17 @@ snapshots: http-errors: 1.6.3 path-is-absolute: 1.0.1 + resolve-pkg-maps@1.0.0: {} + resolve-url-loader@5.0.0: dependencies: adjust-sourcemap-loader: 4.0.0 convert-source-map: 1.9.0 loader-utils: 2.0.4 - postcss: 8.5.3 + postcss: 8.5.6 source-map: 0.6.1 - resolve@1.22.10: + resolve@1.22.11: dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 @@ -15102,6 +17205,10 @@ snapshots: transitivePeerDependencies: - supports-color + responselike@2.0.1: + dependencies: + lowercase-keys: 2.0.0 + restore-cursor@3.1.0: dependencies: onetime: 5.1.2 @@ -15112,13 +17219,11 @@ snapshots: onetime: 7.0.0 signal-exit: 4.1.0 - retry-request@7.0.2(encoding@0.1.13)(supports-color@10.0.0): + retry-request@8.0.2(supports-color@10.2.2): dependencies: - '@types/request': 2.48.12 extend: 3.0.2 - teeny-request: 9.0.0(encoding@0.1.13)(supports-color@10.0.0) + teeny-request: 10.1.0(supports-color@10.2.2) transitivePeerDependencies: - - encoding - supports-color retry@0.12.0: {} @@ -15137,66 +17242,90 @@ snapshots: dependencies: glob: 7.2.3 - rollup-license-plugin@3.0.2: + rimraf@5.0.10: + dependencies: + glob: 10.5.0 + + rolldown@1.0.0-beta.54: + dependencies: + '@oxc-project/types': 0.102.0 + '@rolldown/pluginutils': 1.0.0-beta.54 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-beta.54 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.54 + '@rolldown/binding-darwin-x64': 1.0.0-beta.54 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.54 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.54 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.54 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.54 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.54 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.54 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.54 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.54 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.54 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.54 + + rollup-license-plugin@3.1.0: dependencies: get-npm-tarball-url: 2.1.0 node-fetch: 3.3.2 + semver: 7.7.3 spdx-expression-validate: 2.0.0 - rollup-plugin-dts@6.2.1(rollup@4.40.2)(typescript@5.8.3): + rollup-plugin-dts@6.3.0(rollup@4.53.5)(typescript@5.9.3): dependencies: - magic-string: 0.30.17 - rollup: 4.40.2 - typescript: 5.8.3 + magic-string: 0.30.21 + rollup: 4.53.5 + typescript: 5.9.3 optionalDependencies: '@babel/code-frame': 7.27.1 - rollup-plugin-sourcemaps2@0.5.1(@types/node@20.17.44)(rollup@4.40.2): + rollup-plugin-sourcemaps2@0.5.4(@types/node@22.19.3)(rollup@4.53.5): dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.40.2) - rollup: 4.40.2 + '@rollup/pluginutils': 5.2.0(rollup@4.53.5) + rollup: 4.53.5 optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 22.19.3 - rollup@4.40.2: + rollup@4.53.5: dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.40.2 - '@rollup/rollup-android-arm64': 4.40.2 - '@rollup/rollup-darwin-arm64': 4.40.2 - '@rollup/rollup-darwin-x64': 4.40.2 - '@rollup/rollup-freebsd-arm64': 4.40.2 - '@rollup/rollup-freebsd-x64': 4.40.2 - '@rollup/rollup-linux-arm-gnueabihf': 4.40.2 - '@rollup/rollup-linux-arm-musleabihf': 4.40.2 - '@rollup/rollup-linux-arm64-gnu': 4.40.2 - '@rollup/rollup-linux-arm64-musl': 4.40.2 - '@rollup/rollup-linux-loongarch64-gnu': 4.40.2 - '@rollup/rollup-linux-powerpc64le-gnu': 4.40.2 - '@rollup/rollup-linux-riscv64-gnu': 4.40.2 - '@rollup/rollup-linux-riscv64-musl': 4.40.2 - '@rollup/rollup-linux-s390x-gnu': 4.40.2 - '@rollup/rollup-linux-x64-gnu': 4.40.2 - '@rollup/rollup-linux-x64-musl': 4.40.2 - '@rollup/rollup-win32-arm64-msvc': 4.40.2 - '@rollup/rollup-win32-ia32-msvc': 4.40.2 - '@rollup/rollup-win32-x64-msvc': 4.40.2 + '@rollup/rollup-android-arm-eabi': 4.53.5 + '@rollup/rollup-android-arm64': 4.53.5 + '@rollup/rollup-darwin-arm64': 4.53.5 + '@rollup/rollup-darwin-x64': 4.53.5 + '@rollup/rollup-freebsd-arm64': 4.53.5 + '@rollup/rollup-freebsd-x64': 4.53.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.53.5 + '@rollup/rollup-linux-arm-musleabihf': 4.53.5 + '@rollup/rollup-linux-arm64-gnu': 4.53.5 + '@rollup/rollup-linux-arm64-musl': 4.53.5 + '@rollup/rollup-linux-loong64-gnu': 4.53.5 + '@rollup/rollup-linux-ppc64-gnu': 4.53.5 + '@rollup/rollup-linux-riscv64-gnu': 4.53.5 + '@rollup/rollup-linux-riscv64-musl': 4.53.5 + '@rollup/rollup-linux-s390x-gnu': 4.53.5 + '@rollup/rollup-linux-x64-gnu': 4.53.5 + '@rollup/rollup-linux-x64-musl': 4.53.5 + '@rollup/rollup-openharmony-arm64': 4.53.5 + '@rollup/rollup-win32-arm64-msvc': 4.53.5 + '@rollup/rollup-win32-ia32-msvc': 4.53.5 + '@rollup/rollup-win32-x64-gnu': 4.53.5 + '@rollup/rollup-win32-x64-msvc': 4.53.5 fsevents: 2.3.3 router@2.2.0: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 - path-to-regexp: 8.2.0 + path-to-regexp: 8.3.0 transitivePeerDependencies: - supports-color - rrweb-cssom@0.8.0: {} - - run-applescript@7.0.0: {} + run-applescript@7.1.0: {} run-parallel@1.2.0: dependencies: @@ -15235,17 +17364,17 @@ snapshots: safer-buffer@2.1.2: {} - sass-loader@16.0.5(sass@1.87.0)(webpack@5.99.8(esbuild@0.25.4)): + sass-loader@16.0.6(sass@1.97.0)(webpack@5.104.0(esbuild@0.27.1)): dependencies: neo-async: 2.6.2 optionalDependencies: - sass: 1.87.0 - webpack: 5.99.8(esbuild@0.25.4) + sass: 1.97.0 + webpack: 5.104.0(esbuild@0.27.1) - sass@1.87.0: + sass@1.97.0: dependencies: chokidar: 4.0.3 - immutable: 5.1.2 + immutable: 5.1.4 source-map-js: 1.2.1 optionalDependencies: '@parcel/watcher': 2.5.1 @@ -15256,13 +17385,13 @@ snapshots: transitivePeerDependencies: - supports-color - sax@1.4.1: {} + sax@1.4.3: {} saxes@6.0.0: dependencies: xmlchars: 2.2.0 - schema-utils@4.3.2: + schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 ajv: 8.17.1 @@ -15280,16 +17409,16 @@ snapshots: selfsigned@2.4.1: dependencies: - '@types/node-forge': 1.3.11 - node-forge: 1.3.1 + '@types/node-forge': 1.3.14 + node-forge: 1.3.3 semver@5.7.2: {} semver@6.3.1: {} - semver@7.6.3: {} + semver@7.7.2: {} - semver@7.7.1: {} + semver@7.7.3: {} send@0.19.0: dependencies: @@ -15309,7 +17438,7 @@ snapshots: transitivePeerDependencies: - supports-color - send@0.19.1: + send@0.19.2: dependencies: debug: 2.6.9 depd: 2.0.0 @@ -15318,28 +17447,28 @@ snapshots: escape-html: 1.0.3 etag: 1.8.1 fresh: 0.5.2 - http-errors: 2.0.0 + http-errors: 2.0.1 mime: 1.6.0 ms: 2.1.3 on-finished: 2.4.1 range-parser: 1.2.1 - statuses: 2.0.1 + statuses: 2.0.2 transitivePeerDependencies: - supports-color - send@1.2.0: + send@1.2.1: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 fresh: 2.0.0 - http-errors: 2.0.0 - mime-types: 3.0.1 + http-errors: 2.0.1 + mime-types: 3.0.2 ms: 2.1.3 on-finished: 2.4.1 range-parser: 1.2.1 - statuses: 2.0.1 + statuses: 2.0.2 transitivePeerDependencies: - supports-color @@ -15368,12 +17497,21 @@ snapshots: transitivePeerDependencies: - supports-color - serve-static@2.2.0: + serve-static@1.16.3: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.19.2 + transitivePeerDependencies: + - supports-color + + serve-static@2.2.1: dependencies: encodeurl: 2.0.0 escape-html: 1.0.3 parseurl: 1.3.3 - send: 1.2.0 + send: 1.2.1 transitivePeerDependencies: - supports-color @@ -15413,26 +17551,13 @@ snapshots: dependencies: kind-of: 6.0.3 - shebang-command@1.2.0: - dependencies: - shebang-regex: 1.0.0 - shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - shebang-regex@1.0.0: {} - shebang-regex@3.0.0: {} - shell-quote@1.8.2: {} - - shelljs@0.9.2: - dependencies: - execa: 1.0.0 - fast-glob: 3.3.3 - interpret: 1.4.0 - rechoir: 0.6.2 + shell-quote@1.8.3: {} side-channel-list@1.0.0: dependencies: @@ -15468,14 +17593,14 @@ snapshots: signal-exit@4.1.0: {} - sigstore@3.1.0: + sigstore@4.1.0: dependencies: - '@sigstore/bundle': 3.1.0 - '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.1 - '@sigstore/sign': 3.1.0 - '@sigstore/tuf': 3.1.1 - '@sigstore/verify': 2.1.1 + '@sigstore/bundle': 4.0.0 + '@sigstore/core': 3.1.0 + '@sigstore/protobuf-specs': 0.5.0 + '@sigstore/sign': 4.1.0 + '@sigstore/tuf': 4.0.1 + '@sigstore/verify': 3.1.0 transitivePeerDependencies: - supports-color @@ -15487,32 +17612,27 @@ snapshots: astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 - slice-ansi@5.0.0: + slice-ansi@7.1.2: dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - slice-ansi@7.1.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 5.0.0 + ansi-styles: 6.2.3 + is-fullwidth-code-point: 5.1.0 smart-buffer@4.2.0: {} - socket.io-adapter@2.5.5: + socket.io-adapter@2.5.5(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: debug: 4.3.7 - ws: 8.17.1 + ws: 8.17.1(bufferutil@4.0.9)(utf-8-validate@6.0.5) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - socket.io-client@4.8.1: + socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.3.7 - engine.io-client: 6.6.3 + engine.io-client: 6.6.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -15526,14 +17646,14 @@ snapshots: transitivePeerDependencies: - supports-color - socket.io@4.8.1: + socket.io@4.8.1(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 debug: 4.3.7 - engine.io: 6.6.4 - socket.io-adapter: 2.5.5 + engine.io: 6.6.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + socket.io-adapter: 2.5.5(bufferutil@4.0.9)(utf-8-validate@6.0.5) socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -15548,15 +17668,15 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: - agent-base: 7.1.3 - debug: 4.4.0(supports-color@10.0.0) - socks: 2.8.4 + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) + socks: 2.8.7 transitivePeerDependencies: - supports-color - socks@2.8.4: + socks@2.8.7: dependencies: - ip-address: 9.0.5 + ip-address: 10.1.0 smart-buffer: 4.2.0 sonic-boom@3.8.1: @@ -15569,11 +17689,11 @@ snapshots: source-map-js@1.2.1: {} - source-map-loader@5.0.0(webpack@5.99.8(esbuild@0.25.4)): + source-map-loader@5.0.0(webpack@5.104.0(esbuild@0.27.1)): dependencies: iconv-lite: 0.6.3 source-map-js: 1.2.1 - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) source-map-support@0.4.18: dependencies: @@ -15588,29 +17708,29 @@ snapshots: source-map@0.6.1: {} - source-map@0.7.4: {} + source-map@0.7.6: {} spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.21 + spdx-license-ids: 3.0.22 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.21 + spdx-license-ids: 3.0.22 spdx-expression-validate@2.0.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids@3.0.21: {} + spdx-license-ids@3.0.22: {} spdy-transport@3.0.0: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -15621,7 +17741,7 @@ snapshots: spdy@4.0.2: dependencies: - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -15640,8 +17760,6 @@ snapshots: split2@4.2.0: {} - sprintf-js@1.1.3: {} - sshpk@1.18.0: dependencies: asn1: 0.2.6 @@ -15654,7 +17772,11 @@ snapshots: safer-buffer: 2.1.2 tweetnacl: 0.14.5 - ssri@12.0.0: + ssri@10.0.5: + dependencies: + minipass: 7.1.2 + + ssri@13.0.0: dependencies: minipass: 7.1.2 @@ -15668,12 +17790,21 @@ snapshots: statuses@2.0.1: {} - std-env@3.9.0: {} + statuses@2.0.2: {} + + std-env@3.10.0: {} + + stdin-discarder@0.2.2: {} steno@0.4.4: dependencies: graceful-fs: 4.2.11 + stop-iteration-iterator@1.1.0: + dependencies: + es-errors: 1.3.0 + internal-slot: 1.1.0 + stream-events@1.0.5: dependencies: stubs: 3.0.0 @@ -15688,17 +17819,21 @@ snapshots: streamroller@3.1.5: dependencies: date-format: 4.0.14 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) fs-extra: 8.1.0 transitivePeerDependencies: - supports-color - streamx@2.22.0: + streamx@2.23.0: dependencies: + events-universal: 1.0.1 fast-fifo: 1.3.2 text-decoder: 1.2.3 - optionalDependencies: - bare-events: 2.5.4 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a + + strict-event-emitter@0.5.1: {} string-width@4.2.3: dependencies: @@ -15710,13 +17845,18 @@ snapshots: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 string-width@7.2.0: dependencies: - emoji-regex: 10.4.0 - get-east-asian-width: 1.3.0 - strip-ansi: 7.1.0 + emoji-regex: 10.6.0 + get-east-asian-width: 1.4.0 + strip-ansi: 7.1.2 + + string-width@8.1.0: + dependencies: + get-east-asian-width: 1.4.0 + strip-ansi: 7.1.2 string.prototype.trim@1.2.10: dependencies: @@ -15724,7 +17864,7 @@ snapshots: call-bound: 1.0.4 define-data-property: 1.1.4 define-properties: 1.2.1 - es-abstract: 1.23.9 + es-abstract: 1.24.1 es-object-atoms: 1.1.1 has-property-descriptors: 1.0.2 @@ -15757,21 +17897,19 @@ snapshots: dependencies: ansi-regex: 5.0.1 - strip-ansi@7.1.0: + strip-ansi@7.1.2: dependencies: - ansi-regex: 6.1.0 + ansi-regex: 6.2.2 strip-bom@3.0.0: {} - strip-eof@1.0.0: {} - strip-final-newline@2.0.0: {} strip-json-comments@3.1.1: {} stubs@3.0.0: {} - supports-color@10.0.0: {} + supports-color@10.2.2: {} supports-color@2.0.0: {} @@ -15790,93 +17928,88 @@ snapshots: table-layout@4.1.1: dependencies: array-back: 6.2.2 - wordwrapjs: 5.1.0 + wordwrapjs: 5.1.1 - tapable@2.2.1: {} + tapable@2.3.0: {} tar-fs@2.1.1: dependencies: chownr: 1.1.4 mkdirp-classic: 0.5.3 - pump: 3.0.2 + pump: 3.0.3 tar-stream: 2.2.0 - tar-fs@3.0.8: + tar-fs@3.1.1: dependencies: - pump: 3.0.2 + pump: 3.0.3 tar-stream: 3.1.7 optionalDependencies: - bare-fs: 4.1.4 + bare-fs: 4.5.2 bare-path: 3.0.0 transitivePeerDependencies: + - bare-abort-controller - bare-buffer + - react-native-b4a tar-stream@2.2.0: dependencies: bl: 4.1.0 - end-of-stream: 1.4.4 + end-of-stream: 1.4.5 fs-constants: 1.0.0 inherits: 2.0.4 readable-stream: 3.6.2 tar-stream@3.1.7: dependencies: - b4a: 1.6.7 + b4a: 1.7.3 fast-fifo: 1.3.2 - streamx: 2.22.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 + streamx: 2.23.0 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a - tar@7.4.3: + tar@7.5.2: dependencies: '@isaacs/fs-minipass': 4.0.1 chownr: 3.0.0 minipass: 7.1.2 - minizlib: 3.0.2 - mkdirp: 3.0.1 + minizlib: 3.1.0 yallist: 5.0.0 - teeny-request@9.0.0(encoding@0.1.13)(supports-color@10.0.0): + teeny-request@10.1.0(supports-color@10.2.2): dependencies: - http-proxy-agent: 5.0.0(supports-color@10.0.0) - https-proxy-agent: 5.0.1(supports-color@10.0.0) - node-fetch: 2.7.0(encoding@0.1.13) + http-proxy-agent: 5.0.0(supports-color@10.2.2) + https-proxy-agent: 5.0.1(supports-color@10.2.2) + node-fetch: 3.3.2 stream-events: 1.0.5 - uuid: 9.0.1 transitivePeerDependencies: - - encoding - supports-color - terser-webpack-plugin@5.3.14(esbuild@0.25.4)(webpack@5.99.8(esbuild@0.25.4)): + terser-webpack-plugin@5.3.16(esbuild@0.27.1)(webpack@5.104.0(esbuild@0.27.1)): dependencies: - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 - schema-utils: 4.3.2 + schema-utils: 4.3.3 serialize-javascript: 6.0.2 - terser: 5.39.0 - webpack: 5.99.8(esbuild@0.25.4) + terser: 5.44.1 + webpack: 5.104.0(esbuild@0.27.1) optionalDependencies: - esbuild: 0.25.4 + esbuild: 0.27.1 - terser@5.39.0: + terser@5.44.1: dependencies: - '@jridgewell/source-map': 0.3.6 - acorn: 8.14.1 + '@jridgewell/source-map': 0.3.11 + acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 text-decoder@1.2.3: dependencies: - b4a: 1.6.7 + b4a: 1.7.3 + transitivePeerDependencies: + - react-native-b4a - thingies@1.21.0(tslib@2.8.1): + thingies@2.5.0(tslib@2.8.1): dependencies: tslib: 2.8.1 @@ -15901,39 +18034,39 @@ snapshots: tinybench@2.9.0: {} - tinyexec@0.3.2: {} + tinyexec@1.0.2: {} - tinyglobby@0.2.13: + tinyglobby@0.2.15: dependencies: - fdir: 6.4.4(picomatch@4.0.2) - picomatch: 4.0.2 - - tinypool@1.0.2: {} - - tinyrainbow@2.0.0: {} + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 - tinyspy@3.0.2: {} + tinyrainbow@3.0.3: {} tldts-core@6.1.86: {} + tldts-core@7.0.19: {} + tldts@6.1.86: dependencies: tldts-core: 6.1.86 - tmp@0.0.30: + tldts@7.0.19: dependencies: - os-tmpdir: 1.0.2 + tldts-core: 7.0.19 - tmp@0.0.33: + tmp@0.0.30: dependencies: os-tmpdir: 1.0.2 - tmp@0.2.3: {} + tmp@0.2.5: {} to-regex-range@5.0.1: dependencies: is-number: 7.0.0 + toad-cache@3.7.0: {} + toidentifier@1.0.1: {} tough-cookie@2.5.0: @@ -15945,37 +18078,45 @@ snapshots: dependencies: tldts: 6.1.86 + tough-cookie@6.0.0: + dependencies: + tldts: 7.0.19 + tr46@0.0.3: {} tr46@5.1.1: dependencies: punycode: 2.3.1 - tree-dump@1.0.2(tslib@2.8.1): + tr46@6.0.0: + dependencies: + punycode: 2.3.1 + + tree-dump@1.1.0(tslib@2.8.1): dependencies: tslib: 2.8.1 tree-kill@1.2.2: {} - ts-api-utils@2.1.0(typescript@5.8.3): + ts-api-utils@2.1.0(typescript@5.9.3): dependencies: - typescript: 5.8.3 + typescript: 5.9.3 - ts-node@10.9.2(@types/node@20.17.44)(typescript@5.8.3): + ts-node@10.9.2(@types/node@22.19.3)(typescript@5.9.3): dependencies: '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 + '@tsconfig/node10': 1.0.12 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.17.44 - acorn: 8.14.1 + '@types/node': 22.19.3 + acorn: 8.15.0 acorn-walk: 8.3.4 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.8.3 + typescript: 5.9.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -15990,11 +18131,18 @@ snapshots: tsscmp@1.0.6: {} - tuf-js@3.0.1: + tsx@4.21.0: + dependencies: + esbuild: 0.27.1 + get-tsconfig: 4.13.0 + optionalDependencies: + fsevents: 2.3.3 + + tuf-js@4.1.0: dependencies: - '@tufjs/models': 3.0.1 - debug: 4.4.0(supports-color@10.0.0) - make-fetch-happen: 14.0.3 + '@tufjs/models': 4.1.0 + debug: 4.4.3(supports-color@10.2.2) + make-fetch-happen: 15.0.3 transitivePeerDependencies: - supports-color @@ -16002,6 +18150,8 @@ snapshots: dependencies: safe-buffer: 5.2.1 + tunnel@0.0.6: {} + tweetnacl@0.14.5: {} typanion@3.14.0: {} @@ -16021,7 +18171,7 @@ snapshots: dependencies: content-type: 1.0.5 media-typer: 1.1.0 - mime-types: 3.0.1 + mime-types: 3.0.2 typed-array-buffer@1.0.3: dependencies: @@ -16062,15 +18212,15 @@ snapshots: typed-query-selector@2.12.0: {} - typescript@5.8.3: {} + typescript@5.9.3: {} typical@4.0.0: {} typical@7.3.0: {} - ua-parser-js@0.7.40: {} + ua-parser-js@0.7.41: {} - ua-parser-js@1.0.40: {} + ua-parser-js@1.0.41: {} uglify-js@3.19.3: optional: true @@ -16087,16 +18237,20 @@ snapshots: buffer: 5.7.1 through: 2.3.8 - undici-types@6.19.8: {} + undici-types@7.16.0: {} + + undici@5.29.0: + dependencies: + '@fastify/busboy': 2.1.1 - undici@7.8.0: {} + undici@7.16.0: {} unenv@1.10.0: dependencies: consola: 3.4.2 defu: 6.1.4 mime: 3.0.0 - node-fetch-native: 1.6.6 + node-fetch-native: 1.6.7 pathe: 1.1.2 unicode-canonical-property-names-ecmascript@2.0.1: {} @@ -16104,31 +18258,33 @@ snapshots: unicode-match-property-ecmascript@2.0.0: dependencies: unicode-canonical-property-names-ecmascript: 2.0.1 - unicode-property-aliases-ecmascript: 2.1.0 + unicode-property-aliases-ecmascript: 2.2.0 - unicode-match-property-value-ecmascript@2.2.0: {} + unicode-match-property-value-ecmascript@2.2.1: {} unicode-properties@1.4.1: dependencies: base64-js: 1.5.1 unicode-trie: 2.0.0 - unicode-property-aliases-ecmascript@2.1.0: {} + unicode-property-aliases-ecmascript@2.2.0: {} unicode-trie@2.0.0: dependencies: pako: 0.2.9 tiny-inflate: 1.0.3 - unique-filename@4.0.0: + unique-filename@5.0.0: dependencies: - unique-slug: 5.0.0 + unique-slug: 6.0.0 - unique-slug@5.0.0: + unique-slug@6.0.0: dependencies: imurmurhash: 0.1.4 - universal-user-agent@7.0.2: {} + universal-github-app-jwt@2.2.2: {} + + universal-user-agent@7.0.3: {} universalify@0.1.2: {} @@ -16136,9 +18292,9 @@ snapshots: unpipe@1.0.0: {} - update-browserslist-db@1.1.3(browserslist@4.24.5): + update-browserslist-db@1.2.3(browserslist@4.28.1): dependencies: - browserslist: 4.24.5 + browserslist: 4.28.1 escalade: 3.2.0 picocolors: 1.1.1 @@ -16148,6 +18304,10 @@ snapshots: urijs@1.19.11: {} + utf-8-validate@6.0.5: + dependencies: + node-gyp-build: 4.8.4 + util-deprecate@1.0.2: {} utils-merge@1.0.1: {} @@ -16156,13 +18316,11 @@ snapshots: uuid@8.3.2: {} - uuid@9.0.1: {} - v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.3.0: dependencies: - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/trace-mapping': 0.3.31 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 @@ -16171,76 +18329,78 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - validate-npm-package-name@6.0.0: {} + validate-npm-package-name@7.0.1: {} - validator@13.12.0: {} + validator@13.15.23: {} vary@1.1.2: {} - verdaccio-audit@13.0.0-next-8.15(encoding@0.1.13): + verdaccio-audit@13.0.0-next-8.28(encoding@0.1.13): dependencies: - '@verdaccio/config': 8.0.0-next-8.15 - '@verdaccio/core': 8.0.0-next-8.15 + '@verdaccio/config': 8.0.0-next-8.28 + '@verdaccio/core': 8.0.0-next-8.28 express: 4.21.2 - https-proxy-agent: 5.0.1(supports-color@10.0.0) + https-proxy-agent: 5.0.1(supports-color@10.2.2) node-fetch: 2.6.7(encoding@0.1.13) transitivePeerDependencies: - encoding - supports-color - verdaccio-auth-memory@10.2.2: + verdaccio-auth-memory@10.3.1: dependencies: - '@verdaccio/commons-api': 10.2.0 + '@verdaccio/core': 8.0.0-next-8.21 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color - verdaccio-htpasswd@13.0.0-next-8.15: + verdaccio-htpasswd@13.0.0-next-8.28: dependencies: - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/file-locking': 13.0.0-next-8.3 + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/file-locking': 13.0.0-next-8.6 apache-md5: 1.1.8 bcryptjs: 2.4.3 - core-js: 3.40.0 - debug: 4.4.0(supports-color@10.0.0) + debug: 4.4.3(supports-color@10.2.2) http-errors: 2.0.0 unix-crypt-td-js: 1.1.4 transitivePeerDependencies: - supports-color - verdaccio@6.1.2(encoding@0.1.13): - dependencies: - '@cypress/request': 3.0.8 - '@verdaccio/auth': 8.0.0-next-8.15 - '@verdaccio/config': 8.0.0-next-8.15 - '@verdaccio/core': 8.0.0-next-8.15 - '@verdaccio/loaders': 8.0.0-next-8.6 - '@verdaccio/local-storage-legacy': 11.0.2 - '@verdaccio/logger': 8.0.0-next-8.15 - '@verdaccio/middleware': 8.0.0-next-8.15 - '@verdaccio/search-indexer': 8.0.0-next-8.4 - '@verdaccio/signature': 8.0.0-next-8.7 + verdaccio@6.2.4(encoding@0.1.13): + dependencies: + '@cypress/request': 3.0.9 + '@verdaccio/auth': 8.0.0-next-8.28 + '@verdaccio/config': 8.0.0-next-8.28 + '@verdaccio/core': 8.0.0-next-8.28 + '@verdaccio/hooks': 8.0.0-next-8.28 + '@verdaccio/loaders': 8.0.0-next-8.18 + '@verdaccio/local-storage-legacy': 11.1.1 + '@verdaccio/logger': 8.0.0-next-8.28 + '@verdaccio/middleware': 8.0.0-next-8.28 + '@verdaccio/search-indexer': 8.0.0-next-8.5 + '@verdaccio/signature': 8.0.0-next-8.20 '@verdaccio/streams': 10.2.1 - '@verdaccio/tarball': 13.0.0-next-8.15 - '@verdaccio/ui-theme': 8.0.0-next-8.15 - '@verdaccio/url': 13.0.0-next-8.15 - '@verdaccio/utils': 8.1.0-next-8.15 + '@verdaccio/tarball': 13.0.0-next-8.28 + '@verdaccio/ui-theme': 8.0.0-next-8.28 + '@verdaccio/url': 13.0.0-next-8.28 + '@verdaccio/utils': 8.1.0-next-8.28 JSONStream: 1.3.5 async: 3.2.6 clipanion: 4.0.0-rc.4 - compression: 1.8.0 + compression: 1.8.1 cors: 2.8.5 - debug: 4.4.0(supports-color@10.0.0) - envinfo: 7.14.0 + debug: 4.4.3(supports-color@10.2.2) + envinfo: 7.15.0 express: 4.21.2 - handlebars: 4.7.8 lodash: 4.17.21 lru-cache: 7.18.3 mime: 3.0.0 - mkdirp: 1.0.4 - pkginfo: 0.4.1 - semver: 7.6.3 - verdaccio-audit: 13.0.0-next-8.15(encoding@0.1.13) - verdaccio-htpasswd: 13.0.0-next-8.15 + semver: 7.7.3 + verdaccio-audit: 13.0.0-next-8.28(encoding@0.1.13) + verdaccio-htpasswd: 13.0.0-next-8.28 transitivePeerDependencies: + - bare-abort-controller - encoding + - react-native-b4a - supports-color verror@1.10.0: @@ -16249,70 +18409,50 @@ snapshots: core-util-is: 1.0.2 extsprintf: 1.3.0 - vite-node@3.1.3(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1): - dependencies: - cac: 6.7.14 - debug: 4.4.0(supports-color@10.0.0) - es-module-lexer: 1.7.0 - pathe: 2.0.3 - vite: 6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) - transitivePeerDependencies: - - '@types/node' - - jiti - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - - vite@6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1): + vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): dependencies: - esbuild: 0.25.4 - fdir: 6.4.4(picomatch@4.0.2) - picomatch: 4.0.2 - postcss: 8.5.3 - rollup: 4.40.2 - tinyglobby: 0.2.13 + esbuild: 0.27.1 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.53.5 + tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 20.17.44 + '@types/node': 24.10.4 fsevents: 2.3.3 - jiti: 1.21.7 - less: 4.3.0 - sass: 1.87.0 - terser: 5.39.0 - yaml: 2.7.1 - - vitest@3.1.3(@types/node@20.17.44)(jiti@1.21.7)(jsdom@26.1.0)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1): - dependencies: - '@vitest/expect': 3.1.3 - '@vitest/mocker': 3.1.3(vite@6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1)) - '@vitest/pretty-format': 3.1.3 - '@vitest/runner': 3.1.3 - '@vitest/snapshot': 3.1.3 - '@vitest/spy': 3.1.3 - '@vitest/utils': 3.1.3 - chai: 5.2.0 - debug: 4.4.0(supports-color@10.0.0) - expect-type: 1.2.1 - magic-string: 0.30.17 + jiti: 2.6.1 + less: 4.4.2 + sass: 1.97.0 + terser: 5.44.1 + tsx: 4.21.0 + yaml: 2.8.2 + + vitest@4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): + dependencies: + '@vitest/expect': 4.0.15 + '@vitest/mocker': 4.0.15(vite@7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) + '@vitest/pretty-format': 4.0.15 + '@vitest/runner': 4.0.15 + '@vitest/snapshot': 4.0.15 + '@vitest/spy': 4.0.15 + '@vitest/utils': 4.0.15 + es-module-lexer: 1.7.0 + expect-type: 1.3.0 + magic-string: 0.30.21 + obug: 2.1.1 pathe: 2.0.3 - std-env: 3.9.0 + picomatch: 4.0.3 + std-env: 3.10.0 tinybench: 2.9.0 - tinyexec: 0.3.2 - tinyglobby: 0.2.13 - tinypool: 1.0.2 - tinyrainbow: 2.0.0 - vite: 6.3.5(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) - vite-node: 3.1.3(@types/node@20.17.44)(jiti@1.21.7)(less@4.3.0)(sass@1.87.0)(terser@5.39.0)(yaml@2.7.1) + tinyexec: 1.0.2 + tinyglobby: 0.2.15 + tinyrainbow: 3.0.3 + vite: 7.3.0(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(sass@1.97.0)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.17.44 - jsdom: 26.1.0 + '@opentelemetry/api': 1.9.0 + '@types/node': 24.10.4 + jsdom: 27.3.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) transitivePeerDependencies: - jiti - less @@ -16322,7 +18462,6 @@ snapshots: - sass-embedded - stylus - sugarss - - supports-color - terser - tsx - yaml @@ -16333,7 +18472,7 @@ snapshots: dependencies: xml-name-validator: 5.0.0 - watchpack@2.4.2: + watchpack@2.4.4: dependencies: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 @@ -16342,17 +18481,15 @@ snapshots: dependencies: minimalistic-assert: 1.0.1 - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - weak-lru-cache@1.2.2: optional: true - web-features@2.34.2: {} - web-streams-polyfill@3.3.3: {} + web-vitals@4.2.4: {} + + webdriver-bidi-protocol@0.3.10: {} + webdriver-js-extender@2.1.0: dependencies: '@types/selenium-webdriver': 3.0.26 @@ -16376,49 +18513,51 @@ snapshots: webidl-conversions@7.0.0: {} - webpack-dev-middleware@7.4.2(webpack@5.99.8(esbuild@0.25.4)): + webidl-conversions@8.0.0: {} + + webpack-dev-middleware@7.4.5(webpack@5.104.0(esbuild@0.27.1)): dependencies: colorette: 2.0.20 - memfs: 4.17.1 - mime-types: 2.1.35 + memfs: 4.51.1 + mime-types: 3.0.2 on-finished: 2.4.1 range-parser: 1.2.1 - schema-utils: 4.3.2 + schema-utils: 4.3.3 optionalDependencies: - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) - webpack-dev-server@5.2.1(webpack@5.99.8(esbuild@0.25.4)): + webpack-dev-server@5.2.2(bufferutil@4.0.9)(utf-8-validate@6.0.5)(webpack@5.104.0(esbuild@0.27.1)): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 - '@types/express': 4.17.21 - '@types/express-serve-static-core': 4.19.6 + '@types/express': 4.17.25 + '@types/express-serve-static-core': 4.19.7 '@types/serve-index': 1.9.4 - '@types/serve-static': 1.15.7 + '@types/serve-static': 1.15.10 '@types/sockjs': 0.3.36 '@types/ws': 8.18.1 ansi-html-community: 0.0.8 bonjour-service: 1.3.0 chokidar: 3.6.0 colorette: 2.0.20 - compression: 1.8.0 + compression: 1.8.1 connect-history-api-fallback: 2.0.0 - express: 4.21.2 + express: 4.22.1 graceful-fs: 4.2.11 - http-proxy-middleware: 2.0.9(@types/express@4.17.21) - ipaddr.js: 2.2.0 - launch-editor: 2.10.0 - open: 10.1.2 + http-proxy-middleware: 2.0.9(@types/express@4.17.25) + ipaddr.js: 2.3.0 + launch-editor: 2.12.0 + open: 10.2.0 p-retry: 6.2.1 - schema-utils: 4.3.2 + schema-utils: 4.3.3 selfsigned: 2.4.1 serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 7.4.2(webpack@5.99.8(esbuild@0.25.4)) - ws: 8.18.2 + webpack-dev-middleware: 7.4.5(webpack@5.104.0(esbuild@0.27.1)) + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) optionalDependencies: - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) transitivePeerDependencies: - bufferutil - debug @@ -16431,39 +18570,40 @@ snapshots: flat: 5.0.2 wildcard: 2.0.1 - webpack-sources@3.2.3: {} + webpack-sources@3.3.3: {} - webpack-subresource-integrity@5.1.0(webpack@5.99.8(esbuild@0.25.4)): + webpack-subresource-integrity@5.1.0(webpack@5.104.0(esbuild@0.27.1)): dependencies: typed-assert: 1.0.9 - webpack: 5.99.8(esbuild@0.25.4) + webpack: 5.104.0(esbuild@0.27.1) - webpack@5.99.8(esbuild@0.25.4): + webpack@5.104.0(esbuild@0.27.1): dependencies: '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 '@types/json-schema': 7.0.15 '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.14.1 - browserslist: 4.24.5 + acorn: 8.15.0 + acorn-import-phases: 1.0.4(acorn@8.15.0) + browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.18.1 - es-module-lexer: 1.7.0 + enhanced-resolve: 5.18.4 + es-module-lexer: 2.0.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.0 + loader-runner: 4.3.1 mime-types: 2.1.35 neo-async: 2.6.2 - schema-utils: 4.3.2 - tapable: 2.2.1 - terser-webpack-plugin: 5.3.14(esbuild@0.25.4)(webpack@5.99.8(esbuild@0.25.4)) - watchpack: 2.4.2 - webpack-sources: 3.2.3 + schema-utils: 4.3.3 + tapable: 2.3.0 + terser-webpack-plugin: 5.3.16(esbuild@0.27.1)(webpack@5.104.0(esbuild@0.27.1)) + watchpack: 2.4.4 + webpack-sources: 3.3.3 transitivePeerDependencies: - '@swc/core' - esbuild @@ -16488,6 +18628,11 @@ snapshots: tr46: 5.1.1 webidl-conversions: 7.0.0 + whatwg-url@15.1.0: + dependencies: + tr46: 6.0.0 + webidl-conversions: 8.0.0 + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 @@ -16509,7 +18654,7 @@ snapshots: is-async-function: 2.1.1 is-date-object: 1.1.0 is-finalizationregistry: 1.1.1 - is-generator-function: 1.1.0 + is-generator-function: 1.1.2 is-regex: 1.2.1 is-weakref: 1.1.1 isarray: 2.0.5 @@ -16544,7 +18689,7 @@ snapshots: dependencies: isexe: 2.0.0 - which@5.0.0: + which@6.0.0: dependencies: isexe: 3.1.1 @@ -16559,7 +18704,7 @@ snapshots: wordwrap@1.0.0: {} - wordwrapjs@5.1.0: {} + wordwrapjs@5.1.1: {} wrap-ansi@6.2.0: dependencies: @@ -16575,25 +18720,44 @@ snapshots: wrap-ansi@8.1.0: dependencies: - ansi-styles: 6.2.1 + ansi-styles: 6.2.3 string-width: 5.1.2 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 - wrap-ansi@9.0.0: + wrap-ansi@9.0.2: dependencies: - ansi-styles: 6.2.1 + ansi-styles: 6.2.3 string-width: 7.2.0 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 wrappy@1.0.2: {} - ws@7.5.10: {} + ws@7.5.10(bufferutil@4.0.9): + optionalDependencies: + bufferutil: 4.0.9 + + ws@8.17.1(bufferutil@4.0.9)(utf-8-validate@6.0.5): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 6.0.5 + + ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 6.0.5 - ws@8.17.1: {} + ws@8.9.0(bufferutil@4.0.9): + optionalDependencies: + bufferutil: 4.0.9 - ws@8.18.2: {} + wsl-utils@0.1.0: + dependencies: + is-wsl: 3.1.0 - ws@8.9.0: {} + wsl-utils@0.3.0: + dependencies: + is-wsl: 3.1.0 + powershell-utils: 0.1.0 xhr2@0.2.1: {} @@ -16601,7 +18765,7 @@ snapshots: xml2js@0.4.23: dependencies: - sax: 1.4.1 + sax: 1.4.3 xmlbuilder: 11.0.1 xmlbuilder@11.0.1: {} @@ -16622,7 +18786,7 @@ snapshots: yallist@5.0.0: {} - yaml@2.7.1: {} + yaml@2.8.2: {} yargs-parser@18.1.3: dependencies: @@ -16633,6 +18797,8 @@ snapshots: yargs-parser@21.1.1: {} + yargs-parser@22.0.0: {} + yargs@15.4.1: dependencies: cliui: 6.0.0 @@ -16667,6 +18833,15 @@ snapshots: y18n: 5.0.8 yargs-parser: 21.1.1 + yargs@18.0.0: + dependencies: + cliui: 9.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + string-width: 7.2.0 + y18n: 5.0.8 + yargs-parser: 22.0.0 + yauzl@2.10.0: dependencies: buffer-crc32: 0.2.13 @@ -16678,12 +18853,16 @@ snapshots: yocto-queue@0.1.0: {} - yoctocolors-cjs@2.1.2: {} + yoctocolors-cjs@2.1.3: {} - zod-to-json-schema@3.24.5(zod@3.24.4): + yoctocolors@2.1.2: {} + + zod-to-json-schema@3.25.0(zod@4.2.1): dependencies: - zod: 3.24.4 + zod: 4.2.1 + + zod@3.25.76: {} - zod@3.24.4: {} + zod@4.2.1: {} - zone.js@0.15.0: {} + zone.js@0.16.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 977541458634..ecfbec6f3cb9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -15,4 +15,13 @@ packages: - packages/ngtools/webpack - modules/testing/builder - tests - - tools/baseline_browserslist +# The minimum age of a release to be considered for dependency installation. +# The value is in minutes (1440 minutes = 1 day). +minimumReleaseAge: 1440 +# List of packages to exclude from the minimum release age check. +minimumReleaseAgeExclude: + - '@angular-devkit/*' + - '@angular/*' + - '@ngtools/webpack' + - '@schematics/*' + - 'ng-packagr' diff --git a/renovate.json b/renovate.json index 46266084e448..3b2c5ab2f6a6 100644 --- a/renovate.json +++ b/renovate.json @@ -1,72 +1,14 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "rangeStrategy": "replace", - "semanticCommits": "enabled", - "semanticCommitType": "build", - "semanticCommitScope": "", - "separateMajorMinor": false, - "prHourlyLimit": 2, - "labels": ["target: minor", "action: merge"], - "timezone": "America/Tijuana", - "lockFileMaintenance": { - "enabled": true - }, - "dependencyDashboard": true, - "schedule": ["after 10:00pm every weekday", "before 4:00am every weekday", "every weekend"], - "baseBranches": ["main"], - "ignoreDeps": ["@types/node", "build_bazel_rules_nodejs", "rules_pkg", "yarn"], - "includePaths": [ - "WORKSPACE", - "package.json", - "**/package.json", - ".github/workflows/**/*.yml", - ".nvmrc" - ], - "ignorePaths": ["tests/legacy-cli/e2e/assets/**", "tests/schematics/update/packages/**"], + "baseBranchPatterns": ["main", "21.0.x"], + "extends": ["github>angular/dev-infra//renovate-presets/default.json5"], + "ignoreDeps": ["less"], + "ignorePaths": ["tests/e2e/assets/**", "tests/schematics/update/packages/**"], "packageRules": [ - { - "matchDepNames": ["node"], - "matchUpdateTypes": ["minor", "patch"] - }, { "enabled": false, - "matchDepNames": ["node"], - "matchUpdateTypes": ["major"] - }, - { - "matchPackageNames": ["quicktype-core"], - "schedule": ["before 4:00am on the first day of the month"] - }, - { - "matchCurrentVersion": "/^[~^]?0\\.0\\.0-/", - "enabled": false - }, - { - "groupName": "angular", - "followTag": "next", - "matchDepNames": ["/^@angular/.*/", "/angular/dev-infra/"] - }, - { - "groupName": "babel", - "matchDepNames": ["/^@babel/.*/"] - }, - { - "groupName": "bazel", - "matchDepNames": ["/^@bazel/.*/", "/^build_bazel.*/"] - }, - { - "separateMinorPatch": true, - "matchPackageNames": ["typescript", "rxjs", "tslib"] - }, - { - "enabled": false, - "matchPackageNames": ["typescript", "rxjs", "tslib"], - "matchUpdateTypes": ["major"] - }, - { - "enabled": false, - "matchPackageNames": ["typescript"], - "matchUpdateTypes": ["minor"] + "matchFileNames": ["tests/e2e/ng-snapshot/package.json"], + "matchBaseBranches": ["!main"] }, { "matchFileNames": [ @@ -76,27 +18,9 @@ ], "matchPackageNames": ["*"], "groupName": "schematics dependencies", - "groupSlug": "all-schematics-dependencies", "lockFileMaintenance": { "enabled": false } - }, - { - "matchFileNames": [ - "!packages/angular_devkit/schematics_cli/blank/project-files/package.json", - "!packages/angular_devkit/schematics_cli/schematic/files/package.json", - "!packages/schematics/angular/utility/latest-versions/package.json" - ], - "matchPackageNames": ["*", "!/^@angular/.*/", "!/angular/dev-infra/"], - "matchUpdateTypes": ["minor", "patch"], - "groupName": "all non-major dependencies", - "groupSlug": "all-minor-patch" - }, - { - "matchFileNames": [".github/workflows/scorecard.yml"], - "matchPackageNames": ["*"], - "groupName": "scorecard action dependencies", - "groupSlug": "scorecard-action" } ] } diff --git a/scripts/build-packages-dist.mts b/scripts/build-packages-dist.mts index 441a3a2a021a..2a424d68aea7 100644 --- a/scripts/build-packages-dist.mts +++ b/scripts/build-packages-dist.mts @@ -12,11 +12,19 @@ * distribution folder within the project. */ -import { BuiltPackage } from '@angular/ng-dev'; +import type { BuiltPackage } from '@angular/ng-dev'; import { execSync } from 'node:child_process'; -import { chmodSync, copyFileSync, mkdirSync, rmSync } from 'node:fs'; +import { + chmodSync, + copyFileSync, + cpSync, + existsSync, + lstatSync, + mkdirSync, + readdirSync, + rmSync, +} from 'node:fs'; import { dirname, join } from 'node:path'; -import sh from 'shelljs'; /** Name of the Bazel tag that will be used to find release package targets. */ const releaseTargetTag = 'release-package'; @@ -67,7 +75,7 @@ function buildReleasePackages( // List of targets to build. e.g. "packages/angular/cli:npm_package" const targets = exec(queryPackagesCmd, true).split(/\r?\n/); const packageNames = getPackageNamesOfTargets(targets); - const bazelBinPath = exec(`${bazelCmd} info bazel-bin`, true); + const bazelBinPath = join(import.meta.dirname, '../dist/bin'); const getBazelOutputPath = (pkgName: string) => join(bazelBinPath, 'packages', pkgName, 'npm_package'); const getDistPath = (pkgName: string) => join(distPath, pkgName); @@ -89,14 +97,15 @@ function buildReleasePackages( // Archive output is created by the npm_package_archive target const archiveOutputPath = directoryOutputPath + '_archive.tgz'; - if (sh.test('-d', directoryOutputPath)) { - sh.chmod('-R', 'u+w', directoryOutputPath); - sh.rm('-rf', directoryOutputPath); + if (existsSync(directoryOutputPath)) { + chmodRecursiveSync(directoryOutputPath, '0755'); + rmSync(directoryOutputPath, { recursive: true, force: true }); } - try { + + if (existsSync(archiveOutputPath)) { chmodSync(archiveOutputPath, '0755'); rmSync(archiveOutputPath, { force: true }); - } catch {} + } }); // Build both the npm_package and npm_package_archive targets for each package @@ -123,8 +132,8 @@ function buildReleasePackages( mkdirSync(dirname(targetFolder), { recursive: true }); // Copy package contents to target directory - sh.cp('-R', directoryOutputPath, targetFolder); - sh.chmod('-R', 'u+w', targetFolder); + cpSync(directoryOutputPath, targetFolder, { recursive: true }); + chmodRecursiveSync(targetFolder, '0755'); // Copy archive of package to target directory const archiveTargetPath = join(distPath, `${pkgName.replace('/', '_')}.tgz`); @@ -176,3 +185,25 @@ function exec(command: string, captureStdout?: true) { return stdout.toString().trim(); } } + +/** + * Recursively changes the permissions (mode) of a directory and all its contents (files and subdirectories). + * @param startPath The starting directory path. + * @param mode The new permissions mode (e.g., 0755). + */ +function chmodRecursiveSync(startPath: string, mode: string): void { + chmodSync(startPath, mode); + + const files = readdirSync(startPath); + + for (const file of files) { + const filePath = join(startPath, file); + const stat = lstatSync(filePath); + + if (stat.isDirectory()) { + chmodRecursiveSync(filePath, mode); + } else { + chmodSync(filePath, mode); + } + } +} diff --git a/scripts/build-schema.mts b/scripts/build-schema.mts deleted file mode 100644 index ffc042af9630..000000000000 --- a/scripts/build-schema.mts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { spawn } from 'node:child_process'; -import { rm } from 'node:fs/promises'; -import { join, resolve } from 'node:path'; - -const __dirname = import.meta.dirname; -const baseDir = resolve(`${__dirname}/..`); -const bazelCmd = process.env.BAZEL ?? `pnpm -s bazel`; -const distRoot = join(baseDir, '/dist-schema/'); - -function _clean() { - console.info('Cleaning...'); - console.info(' Removing dist-schema/...'); - - return rm(join(__dirname, '../dist-schema'), { force: true, recursive: true, maxRetries: 3 }); -} - -function _exec(cmd: string, captureStdout: boolean): Promise { - return new Promise((resolve, reject) => { - const proc = spawn(cmd, { - stdio: 'pipe', - shell: true, - env: { - HOME: process.env.HOME, - PATH: process.env.PATH, - }, - }); - - let output = ''; - proc.stdout.on('data', (data) => { - console.info(data.toString().trim()); - if (captureStdout) { - output += data.toString(); - } - }); - proc.stderr.on('data', (data) => console.info(data.toString().trim())); - - proc.on('error', (error) => { - console.error(error.message); - }); - - proc.on('exit', (status) => { - if (status !== 0) { - reject(`Command failed: ${cmd}`); - } else { - resolve(output); - } - }); - }); -} - -async function _buildSchemas(): Promise { - console.info(`Building schemas...`); - - const queryTargetsCmd = `${bazelCmd} query --output=label "attr(name, .*_schema, //packages/...)"`; - const targets = (await _exec(queryTargetsCmd, true)).split(/\r?\n/); - - await _exec(`${bazelCmd} build ${targets.join(' ')} --symlink_prefix=${distRoot}`, false); -} - -export default async function (argv: {}): Promise { - await _clean(); - - await _buildSchemas(); -} diff --git a/scripts/build.mts b/scripts/build.mts index b78df0d6b904..9f100b513352 100644 --- a/scripts/build.mts +++ b/scripts/build.mts @@ -122,8 +122,7 @@ export default async function ( argv: { local?: boolean; snapshot?: boolean } = {}, ): Promise<{ name: string; outputPath: string; tarPath: string }[]> { const logger = globalThis.console; - - const bazelBin = await _exec(`${bazelCmd} info bazel-bin`, true, logger); + const bazelBin = join(import.meta.dirname, '../dist/bin'); await _clean(logger); diff --git a/scripts/circular-deps-test.conf.mjs b/scripts/circular-deps-test.conf.mjs index 790be477858d..1505630371b0 100644 --- a/scripts/circular-deps-test.conf.mjs +++ b/scripts/circular-deps-test.conf.mjs @@ -9,7 +9,7 @@ import { statSync } from 'node:fs'; import { join } from 'node:path'; -import { packages } from './packages.mjs'; +import { packages } from './packages.mts'; export const baseDir = '../'; export const goldenFile = '../goldens/circular-deps/packages.json'; diff --git a/scripts/create.mts b/scripts/create.mts index 9ed02a64b316..56e125da46f2 100644 --- a/scripts/create.mts +++ b/scripts/create.mts @@ -11,8 +11,8 @@ import * as child_process from 'node:child_process'; import { copyFile, readFile, rm, writeFile } from 'node:fs/promises'; import * as path from 'node:path'; import { pathToFileURL } from 'node:url'; -import build from './build.mjs'; -import { packages } from './packages.mjs'; +import build from './build.mts'; +import { packages } from './packages.mts'; export interface CreateOptions extends Record { _: string[]; diff --git a/scripts/devkit-admin.mts b/scripts/devkit-admin.mts index 3240759f3b54..0a17df9f45a1 100644 --- a/scripts/devkit-admin.mts +++ b/scripts/devkit-admin.mts @@ -7,17 +7,25 @@ * found in the LICENSE file at https://angular.dev/license */ -import colors from 'ansi-colors'; import path from 'node:path'; -import yargsParser from 'yargs-parser'; +import { parseArgs, styleText } from 'node:util'; -const args = yargsParser(process.argv.slice(2), { - boolean: ['verbose'], - configuration: { - 'camel-case-expansion': false, +const { values, positionals } = parseArgs({ + args: process.argv.slice(2), + options: { + verbose: { + type: 'boolean', + }, }, + allowPositionals: true, + strict: false, // Allow unknown options to pass through. }); -const scriptName = args._.shift(); + +const scriptName = positionals.shift(); +const args = { + ...values, + _: positionals, +}; const cwd = process.cwd(); const scriptDir = import.meta.dirname; @@ -26,15 +34,15 @@ process.chdir(path.join(scriptDir, '..')); const originalConsole = { ...console }; console.warn = function (...args) { const [m, ...rest] = args; - originalConsole.warn(colors.yellow(m), ...rest); + originalConsole.warn(styleText(['yellow'], m), ...rest); }; console.error = function (...args) { const [m, ...rest] = args; - originalConsole.error(colors.red(m), ...rest); + originalConsole.error(styleText(['red'], m), ...rest); }; try { - const script = await import(`./${scriptName}.mjs`); + const script = await import(`./${scriptName}.mts`); const exitCode = await script.default(args, cwd); process.exitCode = typeof exitCode === 'number' ? exitCode : 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/scripts/diff-release-package.mts b/scripts/diff-release-package.mts index 0cc4524ad03d..ae2d4ec2e87b 100644 --- a/scripts/diff-release-package.mts +++ b/scripts/diff-release-package.mts @@ -18,10 +18,9 @@ import { GitClient } from '@angular/ng-dev'; import childProcess from 'node:child_process'; -import fs from 'node:fs'; +import fs, { chmodSync, lstatSync, readdirSync } from 'node:fs'; import os from 'node:os'; -import path from 'node:path'; -import sh from 'shelljs'; +import path, { join } from 'node:path'; // Do not remove `.git` as we use Git for comparisons later. // Also preserve `uniqueId` as it's irrelevant for the diff and not included via Bazel. @@ -63,31 +62,17 @@ async function main(packageName: string) { git.run(['clone', `https://github.com/${snapshotRepoName}.git`, tmpDir]); console.log(`--> Cloned snapshot repo.`); - const bazelBinDir = childProcess - .spawnSync(bazel, ['info', 'bazel-bin'], { - shell: true, - encoding: 'utf8', - stdio: ['pipe', 'pipe', 'inherit'], - }) - .stdout.trim(); - if (bazelBinDir === '') { - throw new Error('Could not determine bazel-bin directory.'); - } - + const bazelBinDir = join(import.meta.dirname, '../dist/bin'); const outputPath = path.join(bazelBinDir, 'packages/', targetDir, 'npm_package'); // Delete old directory to avoid surprises, or stamping being outdated. await deleteDir(outputPath); - childProcess.spawnSync( - bazel, - ['build', `//packages/${targetDir}:npm_package`, '--config=snapshot'], - { - shell: true, - stdio: 'inherit', - encoding: 'utf8', - }, - ); + childProcess.spawnSync(`${bazel} build //packages/${targetDir}:npm_package --config=snapshot`, { + shell: true, + stdio: 'inherit', + encoding: 'utf8', + }); console.log('--> Built npm package with --config=snapshot'); console.error(`--> Output: ${outputPath}`); @@ -134,6 +119,28 @@ async function deleteDir(dirPath: string) { } // Needed as Bazel artifacts are readonly and cannot be deleted otherwise. - sh.chmod('-R', 'u+w', dirPath); + chmodRecursiveSync(dirPath, '0755'); await fs.promises.rm(dirPath, { recursive: true, force: true, maxRetries: 3 }); } + +/** + * Recursively changes the permissions (mode) of a directory and all its contents (files and subdirectories). + * @param startPath The starting directory path. + * @param mode The new permissions mode (e.g., 0755). + */ +function chmodRecursiveSync(startPath: string, mode: string): void { + chmodSync(startPath, mode); + + const files = readdirSync(startPath); + + for (const file of files) { + const filePath = join(startPath, file); + const stat = lstatSync(filePath); + + if (stat.isDirectory()) { + chmodRecursiveSync(filePath, mode); + } else { + chmodSync(filePath, mode); + } + } +} diff --git a/scripts/json-help.mts b/scripts/json-help.mts index 34271a8925bc..739c79463484 100644 --- a/scripts/json-help.mts +++ b/scripts/json-help.mts @@ -10,7 +10,7 @@ import { spawnSync } from 'node:child_process'; import { promises as fs } from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; -import create from './create.mjs'; +import create from './create.mts'; const __dirname = import.meta.dirname; diff --git a/scripts/release-checks/dependency-ranges/index.mts b/scripts/release-checks/dependency-ranges/index.mts index 9f507a8b4425..cc163fbd7377 100644 --- a/scripts/release-checks/dependency-ranges/index.mts +++ b/scripts/release-checks/dependency-ranges/index.mts @@ -8,8 +8,8 @@ import { Log, ReleasePrecheckError, bold } from '@angular/ng-dev'; import semver from 'semver'; -import { checkSchematicsAngularLatestVersion } from './latest-versions-check.mjs'; -import { PackageJson, checkPeerDependencies } from './peer-deps-check.mjs'; +import { checkSchematicsAngularLatestVersion } from './latest-versions-check.mts'; +import { type PackageJson, checkPeerDependencies } from './peer-deps-check.mts'; /** Environment variable that can be used to skip this pre-check. */ const skipEnvVar = 'SKIP_DEPENDENCY_RANGE_PRECHECK'; diff --git a/scripts/snapshots.mts b/scripts/snapshots.mts index 1e7a751aeab2..5ab1e161492b 100644 --- a/scripts/snapshots.mts +++ b/scripts/snapshots.mts @@ -10,9 +10,9 @@ import { execSync, spawnSync } from 'node:child_process'; import * as fs from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; -import build from './build.mjs'; -import jsonHelp, { createTemporaryProject } from './json-help.mjs'; -import { PackageInfo, packages } from './packages.mjs'; +import build from './build.mts'; +import jsonHelp, { createTemporaryProject } from './json-help.mts'; +import { type PackageInfo, packages } from './packages.mts'; const __dirname = import.meta.dirname; diff --git a/scripts/templates.mts b/scripts/templates.mts index 06623a193a4d..c36ec8aea364 100644 --- a/scripts/templates.mts +++ b/scripts/templates.mts @@ -7,40 +7,42 @@ */ import lodash from 'lodash'; -import * as fs from 'node:fs'; +import { readFile, writeFile } from 'node:fs/promises'; import * as path from 'node:path'; -import { releasePackages } from './packages.mjs'; +import { releasePackages } from './packages.mts'; const __dirname = import.meta.dirname; -async function _runTemplate(inputPath: string, outputPath: string) { +async function runTemplate(inputPath: string, outputPath: string) { inputPath = path.resolve(__dirname, inputPath); outputPath = path.resolve(__dirname, outputPath); console.info(`Building ${path.relative(path.dirname(__dirname), outputPath)}...`); - // TODO(ESM): Consider making this an actual import statement. - const { COMMIT_TYPES, ScopeRequirement } = await new Function( - `return import('@angular/ng-dev');`, - )(); + const { COMMIT_TYPES, ScopeRequirement } = await import('@angular/ng-dev'); - const monorepo = JSON.parse(fs.readFileSync('./.monorepo.json', 'utf-8')); - const content = lodash.template(fs.readFileSync(inputPath, 'utf-8'))({ + const [monorepoRaw, templateContent] = await Promise.all([ + readFile('./.monorepo.json', 'utf-8'), + readFile(inputPath, 'utf-8'), + ]); + + const monorepo = JSON.parse(monorepoRaw); + const content = lodash.template(templateContent)({ monorepo, packages: releasePackages.map(({ name }) => name), - encode: (x: string) => global.encodeURIComponent(x), + encode: (x: string) => encodeURIComponent(x), // Pass-through `ng-dev` ESM commit message information for the `contributing.ejs` // template. EJS templates using the devkit template cannot use ESM. COMMIT_TYPES: COMMIT_TYPES, ScopeRequirement: ScopeRequirement, }); - fs.writeFileSync(outputPath, content, 'utf-8'); + await writeFile(outputPath, content, 'utf-8'); } -export default async function (_options: {}): Promise { +export default async function (): Promise { await Promise.all([ - _runTemplate('./templates/readme.ejs', '../README.md'), - _runTemplate('./templates/contributing.ejs', '../CONTRIBUTING.md'), + runTemplate('./templates/readme.ejs', '../README.md'), + runTemplate('./templates/contributing.ejs', '../CONTRIBUTING.md'), ]); return 0; diff --git a/scripts/templates/contributing.ejs b/scripts/templates/contributing.ejs index b5bb997911ce..d0eb7a59cee2 100644 --- a/scripts/templates/contributing.ejs +++ b/scripts/templates/contributing.ejs @@ -284,22 +284,10 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise [coc]: https://github.com/angular/code-of-conduct/blob/main/CODE_OF_CONDUCT.md [commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# [corporate-cla]: https://code.google.com/legal/corporate-cla-v1.0.html -[dev-doc]: https://github.com/angular/angular-cli/blob/main/packages/angular/cli/README.md#development-hints-for-working-on-angular-cli +[dev-doc]: https://github.com/angular/angular-cli/blob/main/docs/DEVELOPER.md [GitHub]: https://github.com/angular/angular-cli [gitter]: https://gitter.im/angular/angular-cli [individual-cla]: https://code.google.com/legal/individual-cla-v1.0.html [js-style-guide]: https://google.github.io/styleguide/jsguide.html [stackoverflow]: https://stackoverflow.com/questions/tagged/angular-devkit -##
Updating the Public API -Our Public API surface is tracked using golden files. - -You check all golden files by running: -```bash -pnpm public-api:check -``` - -If you modified the public API, the test will fail. To update the golden files you need to run: -```bash -pnpm public-api:update -``` diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 2a26627bc905..4b4f57994123 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -3,6 +3,9 @@ "compilerOptions": { "module": "Node16", "moduleResolution": "Node16", + "erasableSyntaxOnly": true, + "verbatimModuleSyntax": true, + "rewriteRelativeImportExtensions": true, "noEmit": true, "types": [] }, diff --git a/scripts/validate-user-analytics.mts b/scripts/validate-user-analytics.mts index 521e17bbf924..d66d84dee809 100644 --- a/scripts/validate-user-analytics.mts +++ b/scripts/validate-user-analytics.mts @@ -15,7 +15,7 @@ import { EventCustomDimension, EventCustomMetric, UserCustomDimension, -} from '../packages/angular/cli/src/analytics/analytics-parameters.mjs'; +} from '../packages/angular/cli/src/analytics/analytics-parameters.ts'; const __dirname = import.meta.dirname; const userAnalyticsTable = lodash.template( @@ -82,7 +82,7 @@ async function _checkDimensions(dimensionsTable: string) { }; // Find all the schemas - const { packages } = await import('./packages.mjs'); + const { packages } = await import('./packages.mts'); const packagesPaths = packages.map(({ root }) => root); for (const packagePath of packagesPaths) { const schemasPaths = await glob('**/schema.json', { cwd: packagePath }); diff --git a/scripts/validate.mts b/scripts/validate.mts index 2eebce377b44..70d0f27a31d1 100644 --- a/scripts/validate.mts +++ b/scripts/validate.mts @@ -7,14 +7,16 @@ */ import { execSync } from 'node:child_process'; -import templates from './templates.mjs'; -import validateUserAnalytics from './validate-user-analytics.mjs'; +import templates from './templates.mts'; +import validateUserAnalytics from './validate-user-analytics.mts'; export default async function (options: { verbose: boolean }) { let error = false; - if (execSync(`git status --porcelain`).toString()) { - console.error('There are local changes.'); + const changes = execSync(`git status --porcelain`).toString(); + if (changes) { + console.error('There are local changes. See below:'); + console.error(changes); if (!options.verbose) { return 101; } @@ -22,7 +24,7 @@ export default async function (options: { verbose: boolean }) { } console.info('Running templates validation...'); - await templates({}); + await templates(); if (execSync(`git status --porcelain`).toString()) { console.error( 'Running templates updated files... Please run "devkit-admin templates" before submitting a PR.', diff --git a/scripts/windows-testing/convert-symlinks.mjs b/scripts/windows-testing/convert-symlinks.mjs deleted file mode 100644 index a170e350dae2..000000000000 --- a/scripts/windows-testing/convert-symlinks.mjs +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @fileoverview Script that takes a directory and converts all its Unix symlinks - * to relative Windows-compatible symlinks. This is necessary because when building - * tests via Bazel inside WSL; the output cannot simply be used outside WSL to perform - * native Windows testing. This is a known limitation/bug of the WSL <> Windows interop. - * - * Symlinks are commonly used by Bazel inside the `.runfiles` directory, which is relevant - * for executing tests outside Bazel on the host machine. In addition, `rules_js` heavily - * relies on symlinks for node modules. - * - * Some more details in: - * - https://blog.trailofbits.com/2024/02/12/why-windows-cant-follow-wsl-symlinks/. - * - https://pnpm.io/symlinked-node-modules-structure. - */ - -import path from 'node:path'; -import fs from 'node:fs/promises'; -import childProcess from 'node:child_process'; - -const [rootDir, cmdPath] = process.argv.slice(2); - -// GitHub actions can set this environment variable when pressing the "re-run" button. -const debug = process.env.ACTIONS_STEP_DEBUG === 'true'; -const skipDirectories = [ - // Modules that we don't need and would unnecessarily slow-down this. - '_windows_amd64/bin/nodejs/node_modules', -]; - -// Dereferencing can be parallelized and doesn't cause any WSL flakiness (no exe is invoked). -const dereferenceFns = []; -// Re-linking can be parallelized, but should only be in batched. WSL exe is involved and it can be flaky. -// Note: Relinking should not happen during removing & copying of dereference tasks. -const relinkFns = []; - -async function transformDir(p) { - // We explore directories after all files were checked at this level. - const directoriesToVisit = []; - - for (const file of await fs.readdir(p, { withFileTypes: true })) { - const subPath = path.join(p, file.name); - if (skipDirectories.some((d) => subPath.endsWith(d))) { - continue; - } - - if (file.isSymbolicLink()) { - let realTarget = ''; - let linkTarget = ''; - - try { - realTarget = await fs.realpath(subPath); - linkTarget = await fs.readlink(subPath); - } catch (e) { - throw new Error(`Skipping; cannot dereference & read link: ${subPath}: ${e}`); - } - - // Transform relative links but preserve them. - // This is needed for pnpm. - if (!path.isAbsolute(linkTarget)) { - relinkFns.push(async () => { - const wslSubPath = path.relative(rootDir, subPath).replace(/\//g, '\\'); - const linkTargetWindowsPath = linkTarget.replace(/\//g, '\\'); - - await fs.unlink(subPath); - - if ((await fs.stat(realTarget)).isDirectory()) { - // This is a symlink to a directory, create a dir junction. - // Re-create this symlink on the Windows FS using the Windows mklink command. - await exec(`${cmdPath} /c mklink /d "${wslSubPath}" "${linkTargetWindowsPath}"`); - } else { - // This is a symlink to a file, create a file junction. - // Re-create this symlink on the Windows FS using the Windows mklink command. - await exec(`${cmdPath} /c mklink "${wslSubPath}" "${linkTargetWindowsPath}"`); - } - }); - } else { - dereferenceFns.push(async () => { - await fs.unlink(subPath); - // Note: NodeJS `fs.cp` can have issues when sources are readonly. - await exec(`cp -R ${realTarget} ${subPath}`); - }); - } - } else if (file.isDirectory()) { - directoriesToVisit.push(subPath); - } - } - - await Promise.all(directoriesToVisit.map((d) => transformDir(d))); -} - -function exec(cmd, maxRetries = 3) { - return new Promise((resolve, reject) => { - childProcess.exec(cmd, { cwd: rootDir }, (error) => { - if (error !== null) { - // Windows command spawned within WSL (which is untypical) seem to be flaky rarely. - // This logic tries to make it fully stable by re-trying if this surfaces: - // See: https://github.com/microsoft/WSL/issues/8677. - if ( - maxRetries > 0 && - error.stderr !== undefined && - error.stderr.includes(`accept4 failed 110`) - ) { - resolve(exec(cmd, maxRetries - 1)); - return; - } - - reject(error); - } else { - resolve(); - } - }); - }); -} - -try { - await transformDir(rootDir); - - // Dereference first. - await Promise.all(dereferenceFns.map((fn) => fn())); - - // Re-link symlinks to work inside Windows. - // This is done in batches to avoid flakiness due to WSL - // See: https://github.com/microsoft/WSL/issues/8677. - const batchSize = 75; - for (let i = 0; i < relinkFns.length; i += batchSize) { - await Promise.all(relinkFns.slice(i, i + batchSize).map((fn) => fn())); - } -} catch (err) { - console.error('Could not convert symlinks:', err); - process.exitCode = 1; -} diff --git a/scripts/windows-testing/parallel-executor.mjs b/scripts/windows-testing/parallel-executor.mjs index b5c496578277..50660cff22df 100644 --- a/scripts/windows-testing/parallel-executor.mjs +++ b/scripts/windows-testing/parallel-executor.mjs @@ -1,3 +1,11 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + import * as child_process from 'node:child_process'; import path from 'node:path'; import { stripVTControlCharacters } from 'node:util'; @@ -5,37 +13,35 @@ import { stripVTControlCharacters } from 'node:util'; const initialStatusRegex = /Running (\d+) tests/; async function main() { - const [runfilesDir, targetName, testArgs] = process.argv.slice(2); - const maxShards = 4; - + const [runfilesDir, targetName, ...testArgs] = process.argv.slice(2); const testEntrypoint = path.resolve(runfilesDir, '../', targetName); const testWorkingDir = path.resolve(runfilesDir, '_main'); const tasks = []; const progress = {}; - for (let i = 0; i < maxShards; i++) { - tasks.push( - spawnTest( - 'bash', - [testEntrypoint, ...testArgs.split(' ').filter((arg) => arg !== '')], - { - cwd: testWorkingDir, - env: { - // Try to construct a pretty hermetic environment, as within Bazel. - PATH: process.env.PATH, - TEST_TOTAL_SHARDS: maxShards, - TEST_SHARD_INDEX: i, - E2E_SHARD_TOTAL: process.env.E2E_SHARD_TOTAL, - E2E_SHARD_INDEX: process.env.E2E_SHARD_INDEX, - FORCE_COLOR: '3', - // Needed by `rules_js` - BAZEL_BINDIR: '.', - }, + tasks.push( + spawnTest( + 'bash', + [testEntrypoint, ...testArgs], + { + cwd: testWorkingDir, + env: { + // Try to construct a pretty hermetic environment, as within Bazel. + PATH: process.env.PATH, + E2E_SHARD_TOTAL: process.env.E2E_SHARD_TOTAL, + E2E_SHARD_INDEX: process.env.E2E_SHARD_INDEX, + FORCE_COLOR: '0', + // Needed by `rules_js` + BAZEL_BINDIR: '.', + // Needed to run the E2E in a different temp path. + E2E_TEMP: process.env.E2E_TEMP, + // Using the `--glob` causes a bunch of issues due to path expansion in nested bash scripts. + TESTBRIDGE_TEST_ONLY: process.env.TESTBRIDGE_TEST_ONLY, }, - (s) => (progress[i] = s), - ), - ); - } + }, + (s) => (progress[0] = s), + ), + ); const printUpdate = () => { console.error(`----`); diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 2c0b57b1fe3e..318bf3b965e4 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -1,11 +1,79 @@ +load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path") load("@npm//:defs.bzl", "npm_link_all_packages") +load("@npm//:rollup/package_json.bzl", rollup = "bin") +load("//tools:defaults.bzl", "ts_project") +load(":e2e.bzl", "e2e_suites") -# Copyright Google Inc. All Rights Reserved. -# -# Use of this source code is governed by an MIT-style license that can be -# found in the LICENSE file at https://angular.dev/license package(default_visibility = ["//visibility:public"]) licenses(["notice"]) npm_link_all_packages() + +ts_project( + name = "runner", + testonly = True, + srcs = [ + "e2e_runner.ts", + ], + deps = [ + "//:node_modules/@types/node", + "//:node_modules/fast-glob", + "//packages/angular_devkit/core", + "//packages/angular_devkit/core/node", + "//tests/e2e/utils", + ], +) + +rollup.rollup( + name = "runner_bundled", + testonly = True, + srcs = [ + "rollup.config.mjs", + ":runner", + "//:node_modules/@rollup/plugin-alias", + "//:node_modules/@rollup/plugin-commonjs", + "//:node_modules/@rollup/plugin-json", + "//:node_modules/@rollup/plugin-node-resolve", + "//:node_modules/fast-glob", + "//tests/e2e/initialize", + "//tests/e2e/ng-snapshot", + "//tests/e2e/setup", + "//tests/e2e/tests", + ], + args = [ + "--format=cjs", + "--config=./rollup.config.mjs", + ], + chdir = package_name(), + out_dirs = ["runner_bundled_out"], + progress_message = "Bundling e2e test runner", +) + +directory_path( + name = "runner_entrypoint", + testonly = True, + directory = ":runner_bundled", + path = "./e2e_runner.js", +) + +e2e_suites( + name = "e2e", + data = [ + ":runner_bundled", + "verdaccio.yaml", + "verdaccio_auth.yaml", + + # Dynamically loaded. + "//tests/e2e/assets", + "//:node_modules/verdaccio", + "//:node_modules/verdaccio-auth-memory", + + # Extra runtime deps due to bundling issues. + # TODO: Clean this up. + "//:node_modules/express", + "//:node_modules/undici", + "//:node_modules/puppeteer", + ], + runner = ":runner_entrypoint", +) diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index e507add2cea7..000000000000 --- a/tests/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# `/tests` Folder - -Contains all e2e tests and test assets. - -## `legacy-cli/` - -Contains all assets and all e2e tests from the legacy CLI repo. - -## Others - -Other folders contain test assets related to the Package namespace folders matching their name. diff --git a/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json b/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json index 7ec5d5af8a7f..5859d1717c89 100644 --- a/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json +++ b/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json @@ -547,7 +547,7 @@ }, "packageManager": { "description": "Specify which package manager tool to use.", - "enum": ["npm", "cnpm", "yarn", "default"], + "enum": ["npm", "yarn", "default"], "default": "default", "type": "string" }, diff --git a/tests/legacy-cli/e2e.bzl b/tests/e2e.bzl similarity index 91% rename from tests/legacy-cli/e2e.bzl rename to tests/e2e.bzl index 2152f6dcd229..07004fcb09d0 100644 --- a/tests/legacy-cli/e2e.bzl +++ b/tests/e2e.bzl @@ -37,11 +37,13 @@ ESBUILD_TESTS = [ "tests/commands/serve/ssr-http-requests-assets.js", "tests/i18n/**", "tests/vite/**", + "tests/vitest/**", "tests/test/**", ] WEBPACK_IGNORE_TESTS = [ "tests/vite/**", + "tests/vitest/**", "tests/build/app-shell/**", "tests/i18n/ivy-localize-app-shell.js", "tests/i18n/ivy-localize-app-shell-service-worker.js", @@ -53,6 +55,8 @@ WEBPACK_IGNORE_TESTS = [ "tests/build/wasm-esm.js", "tests/build/auto-csp*", "tests/build/incremental-watch.js", + "tests/build/chunk-optimizer.js", + "tests/build/chunk-optimizer-lazy.js", ] def _to_glob(patterns): @@ -79,11 +83,14 @@ def e2e_suites(name, runner, data): # Default target meant to be run manually for debugging, customizing test cli via bazel _e2e_tests(name + "_" + toolchain_name, runner, data = data, toolchain = toolchain, tags = ["manual"]) - _e2e_suite(name, runner, "npm", data, toolchain_name, toolchain) + # Main test suites + _e2e_suite(name, runner, "webpack", data, toolchain_name, toolchain) + _e2e_suite(name, runner, "esbuild", data, toolchain_name, toolchain) + + # Package manager subsets _e2e_suite(name, runner, "bun", data, toolchain_name, toolchain) _e2e_suite(name, runner, "pnpm", data, toolchain_name, toolchain) _e2e_suite(name, runner, "yarn", data, toolchain_name, toolchain) - _e2e_suite(name, runner, "esbuild", data, toolchain_name, toolchain) # Saucelabs tests are only run on the default toolchain _e2e_suite(name, runner, "saucelabs", data) @@ -110,12 +117,12 @@ def _e2e_tests(name, runner, toolchain, **kwargs): # Chromium browser toolchain env.update({ - "CHROME_BIN": "$(CHROMIUM)", - "CHROME_PATH": "$(CHROMIUM)", + "CHROME_BIN": "$(CHROME-HEADLESS-SHELL)", + "CHROME_PATH": "$(CHROME-HEADLESS-SHELL)", "CHROMEDRIVER_BIN": "$(CHROMEDRIVER)", }) - toolchains = toolchains + ["@devinfra//bazel/browsers/chromium:toolchain_alias"] - data = data + ["@devinfra//bazel/browsers/chromium"] + toolchains = toolchains + ["@rules_browsers//browsers/chromium:toolchain_alias"] + data = data + ["@rules_browsers//browsers/chromium"] js_test( name = name, @@ -127,8 +134,7 @@ def _e2e_tests(name, runner, toolchain, **kwargs): toolchains = toolchains, node_toolchain = toolchain, include_npm = select({ - # For Windows testing mode, we use the real global NPM as otherwise this - # will be a lot of files that need to be brought from WSL to the host FS. + # TODO(alanagius): check why on windows this fails. "@platforms//os:windows": False, "//conditions:default": True, }), @@ -159,7 +165,7 @@ def _e2e_suite(name, runner, type, data, toolchain_name = "", toolchain = None): args.append("--esbuild") tests = BROWSER_TESTS ignore = None - elif type == "npm": + elif type == "webpack": tests = None ignore = BROWSER_TESTS + WEBPACK_IGNORE_TESTS diff --git a/tests/legacy-cli/e2e/assets/17.0-project/.editorconfig b/tests/e2e/assets/19.0-project/.editorconfig similarity index 87% rename from tests/legacy-cli/e2e/assets/17.0-project/.editorconfig rename to tests/e2e/assets/19.0-project/.editorconfig index 59d9a3a3e73f..f166060da1cb 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/.editorconfig +++ b/tests/e2e/assets/19.0-project/.editorconfig @@ -10,6 +10,7 @@ trim_trailing_whitespace = true [*.ts] quote_type = single +ij_typescript_use_double_quotes = false [*.md] max_line_length = off diff --git a/tests/legacy-cli/e2e/assets/17.0-project/.gitignore b/tests/e2e/assets/19.0-project/.gitignore similarity index 100% rename from tests/legacy-cli/e2e/assets/17.0-project/.gitignore rename to tests/e2e/assets/19.0-project/.gitignore diff --git a/tests/e2e/assets/19.0-project/README.md b/tests/e2e/assets/19.0-project/README.md new file mode 100644 index 000000000000..80d80f5a3f1f --- /dev/null +++ b/tests/e2e/assets/19.0-project/README.md @@ -0,0 +1,59 @@ +# NineteenProject + +This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.13. + +## Development server + +To start a local development server, run: + +```bash +ng serve +``` + +Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. + +## Code scaffolding + +Angular CLI includes powerful code scaffolding tools. To generate a new component, run: + +```bash +ng generate component component-name +``` + +For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: + +```bash +ng generate --help +``` + +## Building + +To build the project run: + +```bash +ng build +``` + +This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. + +## Running unit tests + +To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: + +```bash +ng test +``` + +## Running end-to-end tests + +For end-to-end (e2e) testing, run: + +```bash +ng e2e +``` + +Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. + +## Additional Resources + +For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. diff --git a/tests/legacy-cli/e2e/assets/17.0-project/angular.json b/tests/e2e/assets/19.0-project/angular.json similarity index 66% rename from tests/legacy-cli/e2e/assets/17.0-project/angular.json rename to tests/e2e/assets/19.0-project/angular.json index 4e6c604d0031..b435223e9930 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/angular.json +++ b/tests/e2e/assets/19.0-project/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "seventeen-project": { + "nineteen-project": { "projectType": "application", "schematics": {}, "root": "", @@ -13,20 +13,18 @@ "build": { "builder": "@angular-devkit/build-angular:application", "options": { - "outputPath": "dist/seventeen-project", + "outputPath": "dist/nineteen-project", "index": "src/index.html", "browser": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.css" + { + "glob": "**/*", + "input": "public" + } ], + "styles": ["src/styles.css"], "scripts": [] }, "configurations": { @@ -34,13 +32,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "500kB", + "maximumError": "1MB" }, { "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" + "maximumWarning": "4kB", + "maximumError": "8kB" } ], "outputHashing": "all" @@ -57,35 +55,29 @@ "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { - "buildTarget": "seventeen-project:build:production" + "buildTarget": "nineteen-project:build:production" }, "development": { - "buildTarget": "seventeen-project:build:development" + "buildTarget": "nineteen-project:build:development" } }, "defaultConfiguration": "development" }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "seventeen-project:build" - } + "builder": "@angular-devkit/build-angular:extract-i18n" }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.css" + { + "glob": "**/*", + "input": "public" + } ], + "styles": ["src/styles.css"], "scripts": [] } } diff --git a/tests/e2e/assets/19.0-project/package.json b/tests/e2e/assets/19.0-project/package.json new file mode 100644 index 000000000000..7b65d66807a2 --- /dev/null +++ b/tests/e2e/assets/19.0-project/package.json @@ -0,0 +1,37 @@ +{ + "name": "nineteen-project", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development", + "test": "ng test" + }, + "private": true, + "dependencies": { + "@angular/common": "^19.2.0", + "@angular/compiler": "^19.2.0", + "@angular/core": "^19.2.0", + "@angular/forms": "^19.2.0", + "@angular/platform-browser": "^19.2.0", + "@angular/platform-browser-dynamic": "^19.2.0", + "@angular/router": "^19.2.0", + "rxjs": "~7.8.0", + "tslib": "^2.3.0", + "zone.js": "~0.15.0" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^19.2.13", + "@angular/cli": "^19.2.13", + "@angular/compiler-cli": "^19.2.0", + "@types/jasmine": "~5.1.0", + "jasmine-core": "~5.6.0", + "karma": "~6.4.0", + "karma-chrome-launcher": "~3.2.0", + "karma-coverage": "~2.2.0", + "karma-jasmine": "~5.1.0", + "karma-jasmine-html-reporter": "~2.1.0", + "typescript": "~5.7.2" + } +} diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/favicon.ico b/tests/e2e/assets/19.0-project/public/favicon.ico similarity index 100% rename from tests/legacy-cli/e2e/assets/17.0-project/src/favicon.ico rename to tests/e2e/assets/19.0-project/public/favicon.ico diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.css b/tests/e2e/assets/19.0-project/src/app/app.component.css similarity index 100% rename from tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.css rename to tests/e2e/assets/19.0-project/src/app/app.component.css diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.html b/tests/e2e/assets/19.0-project/src/app/app.component.html similarity index 93% rename from tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.html rename to tests/e2e/assets/19.0-project/src/app/app.component.html index 36093e187977..f8135391366c 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.html +++ b/tests/e2e/assets/19.0-project/src/app/app.component.html @@ -36,9 +36,18 @@ --pill-accent: var(--bright-blue); - font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol"; + font-family: + 'Inter', + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Helvetica, + Arial, + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol'; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -51,9 +60,18 @@ line-height: 100%; letter-spacing: -0.125rem; margin: 0; - font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol"; + font-family: + 'Inter Tight', + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Helvetica, + Arial, + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol'; } p { @@ -209,14 +227,7 @@ - + @@ -231,19 +242,20 @@

Hello, {{ title }}

- @for (item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, - ]; track item.title) { - + @for ( + item of [ + { title: 'Explore the Docs', link: 'https://angular.dev' }, + { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, + { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, + { + title: 'Angular Language Service', + link: 'https://angular.dev/tools/language-service', + }, + { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, + ]; + track item.title + ) { + {{ item.title }} Hello, {{ title }} /> - + Hello, {{ title }} - diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.spec.ts b/tests/e2e/assets/19.0-project/src/app/app.component.spec.ts similarity index 85% rename from tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.spec.ts rename to tests/e2e/assets/19.0-project/src/app/app.component.spec.ts index 81f10c9432b5..e390fd7bd137 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.spec.ts +++ b/tests/e2e/assets/19.0-project/src/app/app.component.spec.ts @@ -14,16 +14,16 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); }); - it(`should have the 'seventeen-project' title`, () => { + it(`should have the 'nineteen-project' title`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; - expect(app.title).toEqual('seventeen-project'); + expect(app.title).toEqual('nineteen-project'); }); it('should render title', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Hello, seventeen-project'); + expect(compiled.querySelector('h1')?.textContent).toContain('Hello, nineteen-project'); }); }); diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.ts b/tests/e2e/assets/19.0-project/src/app/app.component.ts similarity index 72% rename from tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.ts rename to tests/e2e/assets/19.0-project/src/app/app.component.ts index ec163593670e..620c8a058372 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.component.ts +++ b/tests/e2e/assets/19.0-project/src/app/app.component.ts @@ -3,11 +3,10 @@ import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', - standalone: true, imports: [RouterOutlet], templateUrl: './app.component.html', - styleUrl: './app.component.css' + styleUrl: './app.component.css', }) export class AppComponent { - title = 'seventeen-project'; + title = 'nineteen-project'; } diff --git a/tests/e2e/assets/19.0-project/src/app/app.config.ts b/tests/e2e/assets/19.0-project/src/app/app.config.ts new file mode 100644 index 000000000000..7afc797fbab7 --- /dev/null +++ b/tests/e2e/assets/19.0-project/src/app/app.config.ts @@ -0,0 +1,8 @@ +import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; +import { provideRouter } from '@angular/router'; + +import { routes } from './app.routes'; + +export const appConfig: ApplicationConfig = { + providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)], +}; diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.routes.ts b/tests/e2e/assets/19.0-project/src/app/app.routes.ts similarity index 100% rename from tests/legacy-cli/e2e/assets/17.0-project/src/app/app.routes.ts rename to tests/e2e/assets/19.0-project/src/app/app.routes.ts diff --git a/tests/e2e/assets/19.0-project/src/index.html b/tests/e2e/assets/19.0-project/src/index.html new file mode 100644 index 000000000000..f374b0fe3d5e --- /dev/null +++ b/tests/e2e/assets/19.0-project/src/index.html @@ -0,0 +1,13 @@ + + + + + NineteenProject + + + + + + + + diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/main.ts b/tests/e2e/assets/19.0-project/src/main.ts similarity index 66% rename from tests/legacy-cli/e2e/assets/17.0-project/src/main.ts rename to tests/e2e/assets/19.0-project/src/main.ts index 35b00f346331..17447a5dce2c 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/src/main.ts +++ b/tests/e2e/assets/19.0-project/src/main.ts @@ -2,5 +2,4 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; -bootstrapApplication(AppComponent, appConfig) - .catch((err) => console.error(err)); +bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err)); diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/styles.css b/tests/e2e/assets/19.0-project/src/styles.css similarity index 100% rename from tests/legacy-cli/e2e/assets/17.0-project/src/styles.css rename to tests/e2e/assets/19.0-project/src/styles.css diff --git a/tests/e2e/assets/19.0-project/tsconfig.app.json b/tests/e2e/assets/19.0-project/tsconfig.app.json new file mode 100644 index 000000000000..8886e903f8d0 --- /dev/null +++ b/tests/e2e/assets/19.0-project/tsconfig.app.json @@ -0,0 +1,11 @@ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": ["src/main.ts"], + "include": ["src/**/*.d.ts"] +} diff --git a/tests/legacy-cli/e2e/assets/17.0-project/tsconfig.json b/tests/e2e/assets/19.0-project/tsconfig.json similarity index 64% rename from tests/legacy-cli/e2e/assets/17.0-project/tsconfig.json rename to tests/e2e/assets/19.0-project/tsconfig.json index eb49734a4325..5525117c6744 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/tsconfig.json +++ b/tests/e2e/assets/19.0-project/tsconfig.json @@ -1,4 +1,5 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ { "compileOnSave": false, "compilerOptions": { @@ -9,19 +10,13 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "skipLibCheck": true, + "isolatedModules": true, "esModuleInterop": true, - "sourceMap": true, - "declaration": false, "experimentalDecorators": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", - "module": "ES2022", - "useDefineForClassFields": false, - "lib": [ - "ES2022", - "dom" - ] + "module": "ES2022" }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, diff --git a/tests/e2e/assets/19.0-project/tsconfig.spec.json b/tests/e2e/assets/19.0-project/tsconfig.spec.json new file mode 100644 index 000000000000..e00e30e6d4fb --- /dev/null +++ b/tests/e2e/assets/19.0-project/tsconfig.spec.json @@ -0,0 +1,10 @@ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": ["jasmine"] + }, + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] +} diff --git a/tests/legacy-cli/e2e/assets/BUILD.bazel b/tests/e2e/assets/BUILD.bazel similarity index 59% rename from tests/legacy-cli/e2e/assets/BUILD.bazel rename to tests/e2e/assets/BUILD.bazel index 946db62d0d5a..11bc738d4a29 100644 --- a/tests/legacy-cli/e2e/assets/BUILD.bazel +++ b/tests/e2e/assets/BUILD.bazel @@ -2,6 +2,9 @@ load("//tools:defaults.bzl", "copy_to_bin") copy_to_bin( name = "assets", - srcs = glob(["**"]), + srcs = glob( + include = ["**"], + exclude = ["BUILD.bazel"], + ), visibility = ["//visibility:public"], ) diff --git a/tests/legacy-cli/e2e/assets/add-collection-peer-bad/collection.json b/tests/e2e/assets/add-collection-dir/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection-peer-bad/collection.json rename to tests/e2e/assets/add-collection-dir/collection.json diff --git a/tests/e2e/assets/add-collection-dir/index.js b/tests/e2e/assets/add-collection-dir/index.js new file mode 100644 index 000000000000..0c38ee4e9fd9 --- /dev/null +++ b/tests/e2e/assets/add-collection-dir/index.js @@ -0,0 +1 @@ +exports.default = (options) => (tree) => tree.create(options.name || 'empty-file', ''); diff --git a/tests/legacy-cli/e2e/assets/add-collection/package.json b/tests/e2e/assets/add-collection-dir/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection/package.json rename to tests/e2e/assets/add-collection-dir/package.json diff --git a/tests/legacy-cli/e2e/assets/add-collection-peer-good/collection.json b/tests/e2e/assets/add-collection-peer-bad/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection-peer-good/collection.json rename to tests/e2e/assets/add-collection-peer-bad/collection.json diff --git a/tests/e2e/assets/add-collection-peer-bad/index.js b/tests/e2e/assets/add-collection-peer-bad/index.js new file mode 100644 index 000000000000..df08babad74f --- /dev/null +++ b/tests/e2e/assets/add-collection-peer-bad/index.js @@ -0,0 +1 @@ +exports.default = (options) => (tree) => tree.create(options.name || 'empty-file-peer-bad', ''); diff --git a/tests/legacy-cli/e2e/assets/add-collection-peer-bad/package.json b/tests/e2e/assets/add-collection-peer-bad/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection-peer-bad/package.json rename to tests/e2e/assets/add-collection-peer-bad/package.json diff --git a/tests/legacy-cli/e2e/assets/add-collection/collection.json b/tests/e2e/assets/add-collection-peer-good/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection/collection.json rename to tests/e2e/assets/add-collection-peer-good/collection.json diff --git a/tests/e2e/assets/add-collection-peer-good/index.js b/tests/e2e/assets/add-collection-peer-good/index.js new file mode 100644 index 000000000000..bddee127cebf --- /dev/null +++ b/tests/e2e/assets/add-collection-peer-good/index.js @@ -0,0 +1 @@ +exports.default = (options) => (tree) => tree.create(options.name || 'empty-file-peer-good', ''); diff --git a/tests/legacy-cli/e2e/assets/add-collection-peer-good/package.json b/tests/e2e/assets/add-collection-peer-good/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection-peer-good/package.json rename to tests/e2e/assets/add-collection-peer-good/package.json diff --git a/tests/legacy-cli/e2e/assets/add-collection.tgz b/tests/e2e/assets/add-collection.tgz similarity index 100% rename from tests/legacy-cli/e2e/assets/add-collection.tgz rename to tests/e2e/assets/add-collection.tgz diff --git a/tests/legacy-cli/e2e/assets/images/spectrum.png b/tests/e2e/assets/images/spectrum.png similarity index 100% rename from tests/legacy-cli/e2e/assets/images/spectrum.png rename to tests/e2e/assets/images/spectrum.png diff --git a/tests/legacy-cli/e2e/assets/nested-schematic-dependency/collection.json b/tests/e2e/assets/nested-schematic-dependency/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/nested-schematic-dependency/collection.json rename to tests/e2e/assets/nested-schematic-dependency/collection.json diff --git a/tests/e2e/assets/nested-schematic-dependency/index.js b/tests/e2e/assets/nested-schematic-dependency/index.js new file mode 100644 index 000000000000..0c38ee4e9fd9 --- /dev/null +++ b/tests/e2e/assets/nested-schematic-dependency/index.js @@ -0,0 +1 @@ +exports.default = (options) => (tree) => tree.create(options.name || 'empty-file', ''); diff --git a/tests/legacy-cli/e2e/assets/nested-schematic-dependency/package.json b/tests/e2e/assets/nested-schematic-dependency/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/nested-schematic-dependency/package.json rename to tests/e2e/assets/nested-schematic-dependency/package.json diff --git a/tests/legacy-cli/e2e/assets/nested-schematic-main/collection.json b/tests/e2e/assets/nested-schematic-main/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/nested-schematic-main/collection.json rename to tests/e2e/assets/nested-schematic-main/collection.json diff --git a/tests/e2e/assets/nested-schematic-main/index.js b/tests/e2e/assets/nested-schematic-main/index.js new file mode 100644 index 000000000000..1894dbd19b88 --- /dev/null +++ b/tests/e2e/assets/nested-schematic-main/index.js @@ -0,0 +1,2 @@ +exports.default = (options) => + require('@angular-devkit/schematics').externalSchematic('empty-app-nested', 'nested', {}); diff --git a/tests/legacy-cli/e2e/assets/nested-schematic-main/package.json b/tests/e2e/assets/nested-schematic-main/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/nested-schematic-main/package.json rename to tests/e2e/assets/nested-schematic-main/package.json diff --git a/tests/legacy-cli/e2e/assets/protractor-saucelabs.conf.js b/tests/e2e/assets/protractor-saucelabs.conf.js similarity index 100% rename from tests/legacy-cli/e2e/assets/protractor-saucelabs.conf.js rename to tests/e2e/assets/protractor-saucelabs.conf.js diff --git a/tests/legacy-cli/e2e/assets/schematic-allow-scripts/collection.json b/tests/e2e/assets/schematic-allow-scripts/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/schematic-allow-scripts/collection.json rename to tests/e2e/assets/schematic-allow-scripts/collection.json diff --git a/tests/e2e/assets/schematic-allow-scripts/index.js b/tests/e2e/assets/schematic-allow-scripts/index.js new file mode 100644 index 000000000000..b4a44b829a15 --- /dev/null +++ b/tests/e2e/assets/schematic-allow-scripts/index.js @@ -0,0 +1,24 @@ +const tasks = require('@angular-devkit/schematics/tasks'); + +exports.default = ({ allowScripts, ignoreScripts = false }) => { + return (tree, context) => { + tree.create( + '/install-test/package.json', + JSON.stringify({ + name: 'install-test', + version: '0.0.0', + scripts: { + postinstall: `node run-post.js`, + }, + }), + ); + tree.create('/install-test/.npmrc', `ignore-scripts=${ignoreScripts}`); + tree.create( + '/install-test/run-post.js', + 'require("fs").writeFileSync(__dirname + "/post-script-ran", "12345");', + ); + context.addTask( + new tasks.NodePackageInstallTask({ workingDirectory: 'install-test', allowScripts }), + ); + }; +}; diff --git a/tests/legacy-cli/e2e/assets/schematic-allow-scripts/package.json b/tests/e2e/assets/schematic-allow-scripts/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/schematic-allow-scripts/package.json rename to tests/e2e/assets/schematic-allow-scripts/package.json diff --git a/tests/e2e/assets/schematic-allow-scripts/schema.json b/tests/e2e/assets/schematic-allow-scripts/schema.json new file mode 100644 index 000000000000..3dc7b38c6f8d --- /dev/null +++ b/tests/e2e/assets/schematic-allow-scripts/schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "type": "object", + "additionalProperties": false, + "properties": { + "allowScripts": { + "type": "boolean" + }, + "ignoreScripts": { + "type": "boolean" + } + } +} diff --git a/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/collection.json b/tests/e2e/assets/schematic-boolean-option-negated/collection.json similarity index 100% rename from tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/collection.json rename to tests/e2e/assets/schematic-boolean-option-negated/collection.json diff --git a/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/index.js b/tests/e2e/assets/schematic-boolean-option-negated/index.js similarity index 100% rename from tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/index.js rename to tests/e2e/assets/schematic-boolean-option-negated/index.js diff --git a/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/package.json b/tests/e2e/assets/schematic-boolean-option-negated/package.json similarity index 100% rename from tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/package.json rename to tests/e2e/assets/schematic-boolean-option-negated/package.json diff --git a/tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/schema.json b/tests/e2e/assets/schematic-boolean-option-negated/schema.json similarity index 100% rename from tests/legacy-cli/e2e/assets/schematic-boolean-option-negated/schema.json rename to tests/e2e/assets/schematic-boolean-option-negated/schema.json diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/.gitignore b/tests/e2e/assets/ssr-project-webpack/.gitignore similarity index 100% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/.gitignore rename to tests/e2e/assets/ssr-project-webpack/.gitignore diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/README.md b/tests/e2e/assets/ssr-project-webpack/README.md similarity index 100% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/README.md rename to tests/e2e/assets/ssr-project-webpack/README.md diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/angular.json b/tests/e2e/assets/ssr-project-webpack/angular.json similarity index 87% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/angular.json rename to tests/e2e/assets/ssr-project-webpack/angular.json index 9a26600b1843..5637f8e484a2 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/angular.json +++ b/tests/e2e/assets/ssr-project-webpack/angular.json @@ -16,17 +16,10 @@ "outputPath": "dist/ssr-project-webpack/browser", "index": "src/index.html", "main": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.css" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.css"], "scripts": [] }, "configurations": { @@ -77,18 +70,10 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.css" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.css"], "scripts": [] } }, @@ -130,9 +115,7 @@ "prerender": { "builder": "@angular-devkit/build-angular:prerender", "options": { - "routes": [ - "/" - ] + "routes": ["/"] }, "configurations": { "production": { diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/package.json b/tests/e2e/assets/ssr-project-webpack/package.json similarity index 63% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/package.json rename to tests/e2e/assets/ssr-project-webpack/package.json index 607ff8d87288..9d6b1f7338e8 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/package.json +++ b/tests/e2e/assets/ssr-project-webpack/package.json @@ -14,24 +14,24 @@ }, "private": true, "dependencies": { - "@angular/animations": "^20.0.0-next.0", - "@angular/common": "^20.0.0-next.0", - "@angular/compiler": "^20.0.0-next.0", - "@angular/core": "^20.0.0-next.0", - "@angular/forms": "^20.0.0-next.0", - "@angular/platform-browser": "^20.0.0-next.0", - "@angular/platform-server": "^20.0.0-next.0", - "@angular/router": "^20.0.0-next.0", - "@angular/ssr": "^20.0.0-next.0", + "@angular/animations": "^21.0.0-next.0", + "@angular/common": "^21.0.0-next.0", + "@angular/compiler": "^21.0.0-next.0", + "@angular/core": "^21.0.0-next.0", + "@angular/forms": "^21.0.0-next.0", + "@angular/platform-browser": "^21.0.0-next.0", + "@angular/platform-server": "^21.0.0-next.0", + "@angular/router": "^21.0.0-next.0", + "@angular/ssr": "^21.0.0-next.0", "express": "^4.18.2", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" }, "devDependencies": { - "@angular-devkit/build-angular": "^20.0.0-next.0", - "@angular/cli": "^20.0.0-next.0", - "@angular/compiler-cli": "^20.0.0-next.0", + "@angular-devkit/build-angular": "^21.0.0-next.0", + "@angular/cli": "^21.0.0-next.0", + "@angular/compiler-cli": "^21.0.0-next.0", "@types/express": "^4.17.17", "@types/jasmine": "~4.3.0", "@types/mime": "^3.0.0", @@ -42,6 +42,6 @@ "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", - "typescript": "~5.8.2" + "typescript": "~5.9.2" } } diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/server.ts b/tests/e2e/assets/ssr-project-webpack/server.ts similarity index 93% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/server.ts rename to tests/e2e/assets/ssr-project-webpack/server.ts index c0db431c8657..59f788024bb6 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/server.ts +++ b/tests/e2e/assets/ssr-project-webpack/server.ts @@ -23,9 +23,12 @@ export function app(): express.Express { // Example Express Rest API endpoints // server.get('/api/**', (req, res) => { }); // Serve static files from /browser - server.get('*.*', express.static(distFolder, { - maxAge: '1y' - })); + server.get( + '*.*', + express.static(distFolder, { + maxAge: '1y', + }), + ); // All regular routes use the Angular engine server.get('*', (req, res, next) => { @@ -61,7 +64,7 @@ function run(): void { // The below code is to ensure that the server is run only when not requiring the bundle. declare const __non_webpack_require__: NodeRequire; const mainModule = __non_webpack_require__.main; -const moduleFilename = mainModule && mainModule.filename || ''; +const moduleFilename = (mainModule && mainModule.filename) || ''; if (moduleFilename === __filename || moduleFilename.includes('iisnode')) { run(); } diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts b/tests/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts similarity index 75% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts rename to tests/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts index 02972627f8df..f3daf250ad25 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts +++ b/tests/e2e/assets/ssr-project-webpack/src/app/app-routing.module.ts @@ -5,6 +5,6 @@ const routes: Routes = []; @NgModule({ imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.css b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.css similarity index 100% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.css rename to tests/e2e/assets/ssr-project-webpack/src/app/app.component.css diff --git a/tests/e2e/assets/ssr-project-webpack/src/app/app.component.html b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.html new file mode 100644 index 000000000000..e99c7ea22c86 --- /dev/null +++ b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.html @@ -0,0 +1,770 @@ + + + + + + + + + + + + + + +
+ +
+ + Rocket Ship + + + + + + + + + + {{ title }} app is running! + + + Rocket Ship Smoke + + +
+ + +

Resources

+

Here are some links to help you get started:

+ + + + +

Next Steps

+

What do you want to do next with your app?

+ + + +
+ + + + + + + + + + + +
+ + +
+
ng generate component xyz
+
ng add @angular/material
+
ng add @angular/pwa
+
ng add _____
+
ng test
+
ng build
+
+ + + + + + + + + Gray Clouds Background + + +
+ + + + + + + + + + diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts similarity index 79% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts rename to tests/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts index 7dfb0b7df47c..c3fc75313bcc 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts +++ b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.spec.ts @@ -3,10 +3,12 @@ import { RouterModule } from '@angular/router'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(() => TestBed.configureTestingModule({ - imports: [RouterModule.forRoot([])], - declarations: [AppComponent] - })); + beforeEach(() => + TestBed.configureTestingModule({ + imports: [RouterModule.forRoot([])], + declarations: [AppComponent], + }), + ); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); @@ -24,6 +26,8 @@ describe('AppComponent', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('.content span')?.textContent).toContain('20-ssr-project-webpack app is running!'); + expect(compiled.querySelector('.content span')?.textContent).toContain( + '20-ssr-project-webpack app is running!', + ); }); }); diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.ts b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.ts similarity index 84% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.ts rename to tests/e2e/assets/ssr-project-webpack/src/app/app.component.ts index f643fddc3586..20b0fef78f45 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.ts +++ b/tests/e2e/assets/ssr-project-webpack/src/app/app.component.ts @@ -4,7 +4,7 @@ import { Component } from '@angular/core'; selector: 'app-root', standalone: false, templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent { title = '20-ssr-project-webpack'; diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts b/tests/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts similarity index 83% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts rename to tests/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts index 795380cd2294..d182a9f3e994 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts +++ b/tests/e2e/assets/ssr-project-webpack/src/app/app.module.server.ts @@ -5,10 +5,7 @@ import { AppModule } from './app.module'; import { AppComponent } from './app.component'; @NgModule({ - imports: [ - AppModule, - ServerModule, - ], + imports: [AppModule, ServerModule], bootstrap: [AppComponent], }) export class AppServerModule {} diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.ts b/tests/e2e/assets/ssr-project-webpack/src/app/app.module.ts similarity index 55% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.ts rename to tests/e2e/assets/ssr-project-webpack/src/app/app.module.ts index a06d9e8b06b4..700cb243fffa 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.module.ts +++ b/tests/e2e/assets/ssr-project-webpack/src/app/app.module.ts @@ -5,16 +5,9 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - AppRoutingModule - ], - providers: [ - provideClientHydration() - ], - bootstrap: [AppComponent] + declarations: [AppComponent], + imports: [BrowserModule, AppRoutingModule], + providers: [provideClientHydration()], + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/assets/.gitkeep b/tests/e2e/assets/ssr-project-webpack/src/assets/.gitkeep similarity index 100% rename from tests/legacy-cli/e2e/assets/17.0-project/src/assets/.gitkeep rename to tests/e2e/assets/ssr-project-webpack/src/assets/.gitkeep diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/favicon.ico b/tests/e2e/assets/ssr-project-webpack/src/favicon.ico similarity index 100% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/favicon.ico rename to tests/e2e/assets/ssr-project-webpack/src/favicon.ico diff --git a/tests/e2e/assets/ssr-project-webpack/src/index.html b/tests/e2e/assets/ssr-project-webpack/src/index.html new file mode 100644 index 000000000000..28adeacc85ed --- /dev/null +++ b/tests/e2e/assets/ssr-project-webpack/src/index.html @@ -0,0 +1,13 @@ + + + + + 17SsrProjectWebpack + + + + + + + + diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.server.ts b/tests/e2e/assets/ssr-project-webpack/src/main.server.ts similarity index 100% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.server.ts rename to tests/e2e/assets/ssr-project-webpack/src/main.server.ts diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.ts b/tests/e2e/assets/ssr-project-webpack/src/main.ts similarity index 55% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.ts rename to tests/e2e/assets/ssr-project-webpack/src/main.ts index f3a8a045a0a7..55b91297823b 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/main.ts +++ b/tests/e2e/assets/ssr-project-webpack/src/main.ts @@ -1,5 +1,6 @@ import { platformBrowser } from '@angular/platform-browser'; import { AppModule } from './app/app.module'; -platformBrowser().bootstrapModule(AppModule) - .catch(err => console.error(err)); +platformBrowser() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)); diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/styles.css b/tests/e2e/assets/ssr-project-webpack/src/styles.css similarity index 100% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/src/styles.css rename to tests/e2e/assets/ssr-project-webpack/src/styles.css diff --git a/tests/legacy-cli/e2e/assets/17.0-project/tsconfig.app.json b/tests/e2e/assets/ssr-project-webpack/tsconfig.app.json similarity index 71% rename from tests/legacy-cli/e2e/assets/17.0-project/tsconfig.app.json rename to tests/e2e/assets/ssr-project-webpack/tsconfig.app.json index 374cc9d294aa..84f1f992d275 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/tsconfig.app.json +++ b/tests/e2e/assets/ssr-project-webpack/tsconfig.app.json @@ -5,10 +5,6 @@ "outDir": "./out-tsc/app", "types": [] }, - "files": [ - "src/main.ts" - ], - "include": [ - "src/**/*.d.ts" - ] + "files": ["src/main.ts"], + "include": ["src/**/*.d.ts"] } diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.json b/tests/e2e/assets/ssr-project-webpack/tsconfig.json similarity index 94% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.json rename to tests/e2e/assets/ssr-project-webpack/tsconfig.json index 532ea4d30a62..bbc051d01524 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.json +++ b/tests/e2e/assets/ssr-project-webpack/tsconfig.json @@ -17,10 +17,7 @@ "importHelpers": true, "target": "ES2022", "module": "ES2022", - "lib": [ - "ES2022", - "dom" - ] + "lib": ["ES2022", "dom"] }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.server.json b/tests/e2e/assets/ssr-project-webpack/tsconfig.server.json similarity index 65% rename from tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.server.json rename to tests/e2e/assets/ssr-project-webpack/tsconfig.server.json index e2ebe5a729be..3b9de71a23f6 100644 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.server.json +++ b/tests/e2e/assets/ssr-project-webpack/tsconfig.server.json @@ -3,12 +3,7 @@ "extends": "./tsconfig.app.json", "compilerOptions": { "outDir": "./out-tsc/server", - "types": [ - "node" - ] + "types": ["node"] }, - "files": [ - "src/main.server.ts", - "server.ts" - ] + "files": ["src/main.server.ts", "server.ts"] } diff --git a/tests/legacy-cli/e2e/assets/17.0-project/tsconfig.spec.json b/tests/e2e/assets/ssr-project-webpack/tsconfig.spec.json similarity index 63% rename from tests/legacy-cli/e2e/assets/17.0-project/tsconfig.spec.json rename to tests/e2e/assets/ssr-project-webpack/tsconfig.spec.json index be7e9da76f7b..47e3dd755170 100644 --- a/tests/legacy-cli/e2e/assets/17.0-project/tsconfig.spec.json +++ b/tests/e2e/assets/ssr-project-webpack/tsconfig.spec.json @@ -3,12 +3,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", - "types": [ - "jasmine" - ] + "types": ["jasmine"] }, - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] } diff --git a/tests/legacy-cli/e2e/initialize/300-log-environment.ts b/tests/e2e/initialize/300-log-environment.ts similarity index 100% rename from tests/legacy-cli/e2e/initialize/300-log-environment.ts rename to tests/e2e/initialize/300-log-environment.ts diff --git a/tests/legacy-cli/e2e/initialize/500-create-project.ts b/tests/e2e/initialize/500-create-project.ts similarity index 86% rename from tests/legacy-cli/e2e/initialize/500-create-project.ts rename to tests/e2e/initialize/500-create-project.ts index 837f54efbcde..b48c8733a9a5 100644 --- a/tests/legacy-cli/e2e/initialize/500-create-project.ts +++ b/tests/e2e/initialize/500-create-project.ts @@ -2,7 +2,7 @@ import { join } from 'node:path'; import { getGlobalVariable } from '../utils/env'; import { expectFileToExist } from '../utils/fs'; import { gitClean } from '../utils/git'; -import { setRegistry as setNPMConfigRegistry } from '../utils/packages'; +import { getActivePackageManager, setRegistry as setNPMConfigRegistry } from '../utils/packages'; import { ng } from '../utils/process'; import { prepareProjectForE2e, updateJsonFile } from '../utils/project'; @@ -20,7 +20,16 @@ export default async function () { // Ensure local test registry is used when outside a project await setNPMConfigRegistry(true); - await ng('new', 'test-project', '--skip-install'); + await ng( + 'new', + 'test-project', + '--skip-install', + '--test-runner', + 'karma', + '--package-manager', + getActivePackageManager(), + ); + await expectFileToExist(join(process.cwd(), 'test-project')); process.chdir('./test-project'); @@ -55,6 +64,9 @@ export default async function () { const test = json['projects']['test-project']['architect']['test']; test.builder = '@angular-devkit/build-angular:karma'; + test.options ??= {}; + test.options.tsConfig = 'tsconfig.spec.json'; + delete test.options.runner; }); await updateJsonFile('tsconfig.json', (tsconfig) => { delete tsconfig.compilerOptions.esModuleInterop; diff --git a/tests/legacy-cli/e2e/initialize/BUILD.bazel b/tests/e2e/initialize/BUILD.bazel similarity index 88% rename from tests/legacy-cli/e2e/initialize/BUILD.bazel rename to tests/e2e/initialize/BUILD.bazel index da2466d90621..2ab5b570925f 100644 --- a/tests/legacy-cli/e2e/initialize/BUILD.bazel +++ b/tests/e2e/initialize/BUILD.bazel @@ -11,6 +11,6 @@ ts_project( ], deps = [ "//:node_modules/@types/node", - "//tests/legacy-cli/e2e/utils", + "//tests/e2e/utils", ], ) diff --git a/tests/legacy-cli/e2e/ng-snapshot/BUILD.bazel b/tests/e2e/ng-snapshot/BUILD.bazel similarity index 100% rename from tests/legacy-cli/e2e/ng-snapshot/BUILD.bazel rename to tests/e2e/ng-snapshot/BUILD.bazel diff --git a/tests/e2e/ng-snapshot/package.json b/tests/e2e/ng-snapshot/package.json new file mode 100644 index 000000000000..a8565caab740 --- /dev/null +++ b/tests/e2e/ng-snapshot/package.json @@ -0,0 +1,22 @@ +{ + "description": "snapshot versions of Angular for e2e testing", + "private": true, + "dependencies": { + "@angular/animations": "github:angular/animations-builds#80524f5d854b7fdb33104e629ca5e1102255f6f5", + "@angular/cdk": "github:angular/cdk-builds#475fd8d473ba20045b3393423d8a14d93a2da938", + "@angular/common": "github:angular/common-builds#8aafef4ce946a2f96a0203c9b9623c29998995bb", + "@angular/compiler": "github:angular/compiler-builds#205d342032c053a41088e14de00ff14e28e56fce", + "@angular/compiler-cli": "github:angular/compiler-cli-builds#110918badaf4f73a2d20eb58f185fb6c1f8ae54a", + "@angular/core": "github:angular/core-builds#969d56512e639d39092dd3edf736bd7ba19a4c7d", + "@angular/forms": "github:angular/forms-builds#fafffa726c829fd644957e6c76bb5e42f09cbed7", + "@angular/language-service": "github:angular/language-service-builds#41e0bb51496678a972f37cb973ece48e40bc5cd1", + "@angular/localize": "github:angular/localize-builds#ef4c1e3562f99602b38312aabccb4cb5fb6bb53f", + "@angular/material": "github:angular/material-builds#998cd492b05bf024e5bb7a9a21e52a94dec740ef", + "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#f173ac254a842de20a90694e34628c165989e9b6", + "@angular/platform-browser": "github:angular/platform-browser-builds#90c22fc35fde1feb2bc28435d23062443ddaae68", + "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#fbb14077cfb88dcdb4e5d1b7a177b3d127e9f8be", + "@angular/platform-server": "github:angular/platform-server-builds#0e40e41e36ffd1d1aa740438f11262542da4cd7e", + "@angular/router": "github:angular/router-builds#ac4ab9493afbfbcb3cb457682d651113938d490b", + "@angular/service-worker": "github:angular/service-worker-builds#4ffbe09669ce6958a3ffb669fa7a059aa9e735c6" + } +} diff --git a/tests/legacy-cli/e2e/setup/002-npm-sandbox.ts b/tests/e2e/setup/001-npm-sandbox.ts similarity index 100% rename from tests/legacy-cli/e2e/setup/002-npm-sandbox.ts rename to tests/e2e/setup/001-npm-sandbox.ts diff --git a/tests/legacy-cli/e2e/setup/010-local-publish.ts b/tests/e2e/setup/010-local-publish.ts similarity index 100% rename from tests/legacy-cli/e2e/setup/010-local-publish.ts rename to tests/e2e/setup/010-local-publish.ts diff --git a/tests/legacy-cli/e2e/setup/100-global-cli.ts b/tests/e2e/setup/100-global-cli.ts similarity index 94% rename from tests/legacy-cli/e2e/setup/100-global-cli.ts rename to tests/e2e/setup/100-global-cli.ts index 63db2d365a4a..9f587fa5c38d 100644 --- a/tests/legacy-cli/e2e/setup/100-global-cli.ts +++ b/tests/e2e/setup/100-global-cli.ts @@ -5,8 +5,8 @@ import { globalNpm } from '../utils/process'; const PACKAGE_MANAGER_VERSION = { 'npm': '10.8.1', 'yarn': '1.22.22', - 'pnpm': '9.3.0', - 'bun': '1.1.13', + 'pnpm': '10.17.1', + 'bun': '1.3.2', }; export default async function () { diff --git a/tests/legacy-cli/e2e/setup/200-create-project-dir.ts b/tests/e2e/setup/200-create-project-dir.ts similarity index 100% rename from tests/legacy-cli/e2e/setup/200-create-project-dir.ts rename to tests/e2e/setup/200-create-project-dir.ts diff --git a/tests/legacy-cli/e2e/setup/BUILD.bazel b/tests/e2e/setup/BUILD.bazel similarity index 85% rename from tests/legacy-cli/e2e/setup/BUILD.bazel rename to tests/e2e/setup/BUILD.bazel index 0b83d8f92d7f..36fe39fa3409 100644 --- a/tests/legacy-cli/e2e/setup/BUILD.bazel +++ b/tests/e2e/setup/BUILD.bazel @@ -8,6 +8,6 @@ ts_project( srcs = glob(["**/*.ts"]), deps = [ "//:node_modules/@types/node", - "//tests/legacy-cli/e2e/utils", + "//tests/e2e/utils", ], ) diff --git a/tests/legacy-cli/e2e/tests/BUILD.bazel b/tests/e2e/tests/BUILD.bazel similarity index 81% rename from tests/legacy-cli/e2e/tests/BUILD.bazel rename to tests/e2e/tests/BUILD.bazel index 55f5019b568f..891814cb24eb 100644 --- a/tests/legacy-cli/e2e/tests/BUILD.bazel +++ b/tests/e2e/tests/BUILD.bazel @@ -12,7 +12,9 @@ ts_project( "//:node_modules/@types/semver", "//:node_modules/express", "//:node_modules/fast-glob", + "//:node_modules/puppeteer", "//:node_modules/semver", - "//tests/legacy-cli/e2e/utils", + "//:node_modules/undici", + "//tests/e2e/utils", ], ) diff --git a/tests/e2e/tests/architect_cli/direct_execution.ts b/tests/e2e/tests/architect_cli/direct_execution.ts new file mode 100644 index 000000000000..b91010d46283 --- /dev/null +++ b/tests/e2e/tests/architect_cli/direct_execution.ts @@ -0,0 +1,14 @@ +import * as assert from 'node:assert/strict'; +import { exec } from '../../utils/process'; +import { join } from 'node:path'; + +export default async function () { + // Run help command + const binPath = join('node_modules', '.bin', 'architect'); + const { stdout } = await exec(binPath, '--help'); + + assert.ok( + stdout.includes('architect [project][:target][:configuration] [options, ...]'), + 'Expected stdout to contain usage information.', + ); +} diff --git a/tests/e2e/tests/architect_cli/package_execution.ts b/tests/e2e/tests/architect_cli/package_execution.ts new file mode 100644 index 000000000000..60b3964b7521 --- /dev/null +++ b/tests/e2e/tests/architect_cli/package_execution.ts @@ -0,0 +1,22 @@ +import * as assert from 'node:assert/strict'; +import { exec } from '../../utils/process'; +import { installPackage, uninstallPackage } from '../../utils/packages'; +import { join } from 'node:path'; + +export default async function () { + // Install CLI package + await installPackage('@angular-devkit/architect-cli'); + + try { + // Run help command + const binPath = join('node_modules', '.bin', 'architect'); + const { stdout } = await exec(binPath, '--help'); + + assert.ok( + stdout.includes('architect [project][:target][:configuration] [options, ...]'), + 'Expected stdout to contain usage information.', + ); + } finally { + await uninstallPackage('@angular-devkit/architect-cli'); + } +} diff --git a/tests/legacy-cli/e2e/tests/basic/aot.ts b/tests/e2e/tests/basic/aot.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/basic/aot.ts rename to tests/e2e/tests/basic/aot.ts diff --git a/tests/legacy-cli/e2e/tests/basic/build.ts b/tests/e2e/tests/basic/build.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/basic/build.ts rename to tests/e2e/tests/basic/build.ts diff --git a/tests/legacy-cli/e2e/tests/basic/command-scope.ts b/tests/e2e/tests/basic/command-scope.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/basic/command-scope.ts rename to tests/e2e/tests/basic/command-scope.ts diff --git a/tests/legacy-cli/e2e/tests/basic/rebuild.ts b/tests/e2e/tests/basic/rebuild.ts similarity index 83% rename from tests/legacy-cli/e2e/tests/basic/rebuild.ts rename to tests/e2e/tests/basic/rebuild.ts index d7c75cce9fc5..a0b0f1ddc79d 100644 --- a/tests/legacy-cli/e2e/tests/basic/rebuild.ts +++ b/tests/e2e/tests/basic/rebuild.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { setTimeout } from 'node:timers/promises'; import { getGlobalVariable } from '../../utils/env'; import { appendToFile, replaceInFile, writeMultipleFiles } from '../../utils/fs'; @@ -68,15 +69,9 @@ export default async function () { { const response = await fetch(`http://localhost:${port}/main.js`); const body = await response.text(); - if (!body.match(/\$\$_E2E_GOLDEN_VALUE_1/)) { - throw new Error('Expected golden value 1.'); - } - if (!body.match(/\$\$_E2E_GOLDEN_VALUE_2/)) { - throw new Error('Expected golden value 2.'); - } - if (!body.match(/\$\$_E2E_GOLDEN_VALUE_3/)) { - throw new Error('Expected golden value 3.'); - } + assert.match(body, /\$\$_E2E_GOLDEN_VALUE_1/); + assert.match(body, /\$\$_E2E_GOLDEN_VALUE_2/); + assert.match(body, /\$\$_E2E_GOLDEN_VALUE_3/); } await setTimeout(500); @@ -90,9 +85,7 @@ export default async function () { { const response = await fetch(`http://localhost:${port}/main.js`); const body = await response.text(); - if (!body.match(/testingTESTING123/)) { - throw new Error('Expected component HTML to update.'); - } + assert.match(body, /testingTESTING123/); } await setTimeout(500); @@ -106,9 +99,7 @@ export default async function () { { const response = await fetch(`http://localhost:${port}/main.js`); const body = await response.text(); - if (!body.match(/color:\s?blue/)) { - throw new Error('Expected component CSS to update.'); - } + assert.match(body, /color:\s?blue/); } await setTimeout(500); @@ -122,8 +113,6 @@ export default async function () { { const response = await fetch(`http://localhost:${port}/styles.css`); const body = await response.text(); - if (!body.match(/color:\s?green/)) { - throw new Error('Expected global CSS to update.'); - } + assert.match(body, /color:\s?green/); } } diff --git a/tests/legacy-cli/e2e/tests/basic/run.ts b/tests/e2e/tests/basic/run.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/basic/run.ts rename to tests/e2e/tests/basic/run.ts diff --git a/tests/legacy-cli/e2e/tests/basic/scripts-array.ts b/tests/e2e/tests/basic/scripts-array.ts similarity index 96% rename from tests/legacy-cli/e2e/tests/basic/scripts-array.ts rename to tests/e2e/tests/basic/scripts-array.ts index 09bca1c04fb9..0721b120da2b 100644 --- a/tests/legacy-cli/e2e/tests/basic/scripts-array.ts +++ b/tests/e2e/tests/basic/scripts-array.ts @@ -58,7 +58,6 @@ export default async function () { await expectFileToMatch( 'dist/test-project/browser/index.html', [ - '', '', '', '', @@ -69,7 +68,6 @@ export default async function () { 'dist/test-project/browser/index.html', [ '', - '', '', '', '', diff --git a/tests/legacy-cli/e2e/tests/basic/serve.ts b/tests/e2e/tests/basic/serve.ts similarity index 65% rename from tests/legacy-cli/e2e/tests/basic/serve.ts rename to tests/e2e/tests/basic/serve.ts index e5f5af674475..eac4823a3126 100644 --- a/tests/legacy-cli/e2e/tests/basic/serve.ts +++ b/tests/e2e/tests/basic/serve.ts @@ -1,5 +1,7 @@ +import assert from 'node:assert/strict'; import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; export default async function () { // Serve works without HMR @@ -10,18 +12,14 @@ export default async function () { // Serve works with HMR const hmrPort = await ngServe('--hmr'); await verifyResponse(hmrPort); + + await executeBrowserTest({ baseUrl: `http://localhost:${hmrPort}/` }); } async function verifyResponse(port: number): Promise { const indexResponse = await fetch(`http://localhost:${port}/`); - - if (!/<\/app-root>/.test(await indexResponse.text())) { - throw new Error('Response does not match expected value.'); - } + assert.match(await indexResponse.text(), /<\/app-root>/); const assetResponse = await fetch(`http://localhost:${port}/favicon.ico`); - - if (!assetResponse.ok) { - throw new Error('Expected favicon asset to be available.'); - } + assert(assetResponse.ok, 'Expected favicon asset to be available.'); } diff --git a/tests/legacy-cli/e2e/tests/basic/styles-array.ts b/tests/e2e/tests/basic/styles-array.ts similarity index 90% rename from tests/legacy-cli/e2e/tests/basic/styles-array.ts rename to tests/e2e/tests/basic/styles-array.ts index 1639f8863aac..cc4d6d56f506 100644 --- a/tests/legacy-cli/e2e/tests/basic/styles-array.ts +++ b/tests/e2e/tests/basic/styles-array.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; @@ -42,8 +43,5 @@ export default async function () { ); // Non injected styles should be listed under lazy chunk files - if (!/Lazy chunk files[\s\S]+renamed-lazy-style\.css/m.test(stdout)) { - console.log(stdout); - throw new Error(`Expected "renamed-lazy-style.css" to be listed under "Lazy chunk files".`); - } + assert.match(stdout, /Lazy chunk files[\s\S]+renamed-lazy-style\.css/m); } diff --git a/tests/legacy-cli/e2e/tests/basic/test.ts b/tests/e2e/tests/basic/test.ts similarity index 84% rename from tests/legacy-cli/e2e/tests/basic/test.ts rename to tests/e2e/tests/basic/test.ts index d9066946ae8e..50580581d442 100644 --- a/tests/legacy-cli/e2e/tests/basic/test.ts +++ b/tests/e2e/tests/basic/test.ts @@ -1,5 +1,6 @@ import { ng } from '../../utils/process'; import { writeMultipleFiles } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; export default async function () { // make sure both --watch=false work @@ -48,5 +49,11 @@ export default async function () { `, }); - await ng('test', '--watch=false', '--karma-config=karma.conf.bis.js'); + const isWebpack = !getGlobalVariable('argv')['esbuild']; + + if (isWebpack) { + await ng('test', '--watch=false', '--karma-config=karma.conf.bis.js'); + } else { + await ng('test', '--watch=false', '--runner-config=karma.conf.bis.js'); + } } diff --git a/tests/legacy-cli/e2e/tests/build/app-shell/app-shell-ngmodule.ts b/tests/e2e/tests/build/app-shell/app-shell-ngmodule.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/app-shell/app-shell-ngmodule.ts rename to tests/e2e/tests/build/app-shell/app-shell-ngmodule.ts diff --git a/tests/legacy-cli/e2e/tests/build/app-shell/app-shell-with-schematic.ts b/tests/e2e/tests/build/app-shell/app-shell-with-schematic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/app-shell/app-shell-with-schematic.ts rename to tests/e2e/tests/build/app-shell/app-shell-with-schematic.ts diff --git a/tests/legacy-cli/e2e/tests/build/app-shell/app-shell-with-service-worker.ts b/tests/e2e/tests/build/app-shell/app-shell-with-service-worker.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/app-shell/app-shell-with-service-worker.ts rename to tests/e2e/tests/build/app-shell/app-shell-with-service-worker.ts diff --git a/tests/legacy-cli/e2e/tests/build/assets.ts b/tests/e2e/tests/build/assets.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/assets.ts rename to tests/e2e/tests/build/assets.ts diff --git a/tests/legacy-cli/e2e/tests/build/auto-csp.ts b/tests/e2e/tests/build/auto-csp.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/auto-csp.ts rename to tests/e2e/tests/build/auto-csp.ts diff --git a/tests/legacy-cli/e2e/tests/build/bundle-budgets.ts b/tests/e2e/tests/build/bundle-budgets.ts similarity index 79% rename from tests/legacy-cli/e2e/tests/build/bundle-budgets.ts rename to tests/e2e/tests/build/bundle-budgets.ts index d5cbf7059873..1401d8d3c6e3 100644 --- a/tests/legacy-cli/e2e/tests/build/bundle-budgets.ts +++ b/tests/e2e/tests/build/bundle-budgets.ts @@ -5,6 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +import assert from 'node:assert/strict'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; import { expectToFail } from '../../utils/utils'; @@ -18,9 +19,7 @@ export default async function () { }); const { message: errorMessage } = await expectToFail(() => ng('build')); - if (!/Error.+budget/i.test(errorMessage)) { - throw new Error('Budget error: all, max error.'); - } + assert.match(errorMessage, /Error.+budget/i, 'Budget error: all, max error.'); // Warning await updateJsonFile('angular.json', (json) => { @@ -30,9 +29,7 @@ export default async function () { }); const { stderr } = await ng('build'); - if (!/Warning.+budget/i.test(stderr)) { - throw new Error('Budget warning: all, min warning'); - } + assert.match(stderr, /Warning.+budget/i, 'Budget warning: all, min warning'); // Pass await updateJsonFile('angular.json', (json) => { @@ -42,7 +39,5 @@ export default async function () { }); const { stderr: stderr2 } = await ng('build'); - if (/(Warning|Error)/i.test(stderr2)) { - throw new Error('BIG max for all, should not error'); - } + assert.doesNotMatch(stderr2, /(Warning|Error)/i, 'BIG max for all, should not error'); } diff --git a/tests/e2e/tests/build/chunk-optimizer-lazy.ts b/tests/e2e/tests/build/chunk-optimizer-lazy.ts new file mode 100644 index 000000000000..7f57e6d88e68 --- /dev/null +++ b/tests/e2e/tests/build/chunk-optimizer-lazy.ts @@ -0,0 +1,52 @@ +import assert from 'node:assert/strict'; +import { readdir } from 'node:fs/promises'; +import { replaceInFile } from '../../utils/fs'; +import { execWithEnv, ng } from '../../utils/process'; + +export default async function () { + // Add lazy routes. + await ng('generate', 'component', 'lazy-a'); + await ng('generate', 'component', 'lazy-b'); + await ng('generate', 'component', 'lazy-c'); + await replaceInFile( + 'src/app/app.routes.ts', + 'routes: Routes = [];', + `routes: Routes = [ + { + path: 'lazy-a', + loadComponent: () => import('./lazy-a/lazy-a').then(m => m.LazyA), + }, + { + path: 'lazy-b', + loadComponent: () => import('./lazy-b/lazy-b').then(m => m.LazyB), + }, + { + path: 'lazy-c', + loadComponent: () => import('./lazy-c/lazy-c').then(m => m.LazyC), + }, + ];`, + ); + + // Build without chunk optimization + await ng('build', '--output-hashing=none'); + const unoptimizedFiles = await readdir('dist/test-project/browser'); + const unoptimizedJsFiles = unoptimizedFiles.filter((f) => f.endsWith('.js')); + + // Build with chunk optimization + await execWithEnv('ng', ['build', '--output-hashing=none'], { + ...process.env, + NG_BUILD_OPTIMIZE_CHUNKS: '1', + }); + const optimizedFiles = await readdir('dist/test-project/browser'); + const optimizedJsFiles = optimizedFiles.filter((f) => f.endsWith('.js')); + + // Check that the number of chunks is reduced but not all combined + assert.ok( + optimizedJsFiles.length < unoptimizedJsFiles.length, + `Expected chunk count to be less than ${unoptimizedJsFiles.length}, but was ${optimizedJsFiles.length}.`, + ); + assert.ok( + optimizedJsFiles.length > 1, + `Expected more than one chunk, but found ${optimizedJsFiles.length}.`, + ); +} diff --git a/tests/legacy-cli/e2e/tests/build/chunk-optimizer.ts b/tests/e2e/tests/build/chunk-optimizer.ts similarity index 91% rename from tests/legacy-cli/e2e/tests/build/chunk-optimizer.ts rename to tests/e2e/tests/build/chunk-optimizer.ts index edc43729718e..366eaa7b4f3d 100644 --- a/tests/legacy-cli/e2e/tests/build/chunk-optimizer.ts +++ b/tests/e2e/tests/build/chunk-optimizer.ts @@ -15,5 +15,5 @@ export default async function () { }); const content = await readFile('dist/test-project/browser/main.js', 'utf-8'); - assert.match(content, /\\u0275\\u0275defineComponent/); + assert.match(content, /ɵɵdefineComponent/u); } diff --git a/tests/legacy-cli/e2e/tests/build/config-file-fallback.ts b/tests/e2e/tests/build/config-file-fallback.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/config-file-fallback.ts rename to tests/e2e/tests/build/config-file-fallback.ts diff --git a/tests/legacy-cli/e2e/tests/build/css-urls.ts b/tests/e2e/tests/build/css-urls.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/css-urls.ts rename to tests/e2e/tests/build/css-urls.ts diff --git a/tests/legacy-cli/e2e/tests/build/disk-cache-purge.ts b/tests/e2e/tests/build/disk-cache-purge.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/disk-cache-purge.ts rename to tests/e2e/tests/build/disk-cache-purge.ts diff --git a/tests/legacy-cli/e2e/tests/build/disk-cache.ts b/tests/e2e/tests/build/disk-cache.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/disk-cache.ts rename to tests/e2e/tests/build/disk-cache.ts diff --git a/tests/legacy-cli/e2e/tests/build/esbuild-unsupported.ts b/tests/e2e/tests/build/esbuild-unsupported.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/esbuild-unsupported.ts rename to tests/e2e/tests/build/esbuild-unsupported.ts diff --git a/tests/legacy-cli/e2e/tests/build/extract-licenses.ts b/tests/e2e/tests/build/extract-licenses.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/extract-licenses.ts rename to tests/e2e/tests/build/extract-licenses.ts diff --git a/tests/legacy-cli/e2e/tests/build/incremental-watch.ts b/tests/e2e/tests/build/incremental-watch.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/incremental-watch.ts rename to tests/e2e/tests/build/incremental-watch.ts diff --git a/tests/legacy-cli/e2e/tests/build/jit-ngmodule.ts b/tests/e2e/tests/build/jit-ngmodule.ts similarity index 77% rename from tests/legacy-cli/e2e/tests/build/jit-ngmodule.ts rename to tests/e2e/tests/build/jit-ngmodule.ts index 910f8993a16d..aa6b3fda86bb 100644 --- a/tests/legacy-cli/e2e/tests/build/jit-ngmodule.ts +++ b/tests/e2e/tests/build/jit-ngmodule.ts @@ -1,13 +1,10 @@ import { getGlobalVariable } from '../../utils/env'; import { ng } from '../../utils/process'; -import { updateJsonFile, useCIChrome, useCIDefaults } from '../../utils/project'; +import { updateJsonFile, useCIDefaults } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; export default async function () { await ng('generate', 'app', 'test-project-two', '--no-standalone', '--skip-install'); - await ng('generate', 'private-e2e', '--related-app-name=test-project-two'); - - // Setup testing to use CI Chrome. - await useCIChrome('test-project-two', './projects/test-project-two/e2e'); await useCIDefaults('test-project-two'); // Make prod use JIT. @@ -46,6 +43,6 @@ export default async function () { serve.builder = '@angular-devkit/build-angular:dev-server'; }); // Test it works - await ng('e2e', 'test-project-two', '--configuration=production'); - await ng('e2e', 'test-project-two', '--configuration=development'); + await executeBrowserTest({ project: 'test-project-two', configuration: 'production' }); + await executeBrowserTest({ project: 'test-project-two', configuration: 'development' }); } diff --git a/tests/legacy-cli/e2e/tests/build/jit-prod.ts b/tests/e2e/tests/build/jit-prod.ts similarity index 85% rename from tests/legacy-cli/e2e/tests/build/jit-prod.ts rename to tests/e2e/tests/build/jit-prod.ts index 2042b0a8c93d..b2dc9d0bdddc 100644 --- a/tests/legacy-cli/e2e/tests/build/jit-prod.ts +++ b/tests/e2e/tests/build/jit-prod.ts @@ -1,6 +1,6 @@ import { getGlobalVariable } from '../../utils/env'; -import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; export default async function () { // Make prod use JIT. @@ -18,5 +18,5 @@ export default async function () { }); // Test it works - await ng('e2e', '--configuration=production'); + await executeBrowserTest({ configuration: 'production' }); } diff --git a/tests/legacy-cli/e2e/tests/build/lazy-load-syntax.ts b/tests/e2e/tests/build/lazy-load-syntax.ts similarity index 52% rename from tests/legacy-cli/e2e/tests/build/lazy-load-syntax.ts rename to tests/e2e/tests/build/lazy-load-syntax.ts index 2b91b3f63b45..bc0a375673dc 100644 --- a/tests/legacy-cli/e2e/tests/build/lazy-load-syntax.ts +++ b/tests/e2e/tests/build/lazy-load-syntax.ts @@ -5,10 +5,11 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import { setTimeout } from 'node:timers/promises'; -import { replaceInFile, writeFile } from '../../utils/fs'; + +import { replaceInFile } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; export default async function () { // Add lazy route. @@ -22,29 +23,6 @@ export default async function () { }];`, ); - // Add lazy route e2e - await writeFile( - 'e2e/src/app.e2e-spec.ts', - ` - import { browser, logging, element, by } from 'protractor'; - - describe('workspace-project App', () => { - it('should display lazy route', async () => { - await browser.get(browser.baseUrl + '/lazy'); - expect(await element(by.css('app-lazy-comp p')).getText()).toEqual('lazy-comp works!'); - }); - - afterEach(async () => { - // Assert that there are no errors emitted from the browser - const logs = await browser.manage().logs().get(logging.Type.BROWSER); - expect(logs).not.toContain(jasmine.objectContaining({ - level: logging.Level.SEVERE, - })); - }); - }); - `, - ); - // Convert the default config to use JIT and prod to just do AOT. // This way we can use `ng e2e` to test JIT and `ng e2e --configuration=production` to test AOT. await updateJsonFile('angular.json', (json) => { @@ -53,7 +31,17 @@ export default async function () { buildTarget['configurations']['development']['aot'] = false; }); - await ng('e2e'); - await setTimeout(500); - await ng('e2e', '--configuration=production'); + const checkFn = async (page: any) => { + await page.goto(page.url() + 'lazy'); + await page.waitForFunction( + () => + !!(globalThis as any).document + .querySelector('app-lazy-comp p') + ?.textContent?.includes('lazy-comp works!'), + { timeout: 10000 }, + ); + }; + + await executeBrowserTest({ checkFn }); + await executeBrowserTest({ configuration: 'production', checkFn }); } diff --git a/tests/legacy-cli/e2e/tests/build/library-with-demo-app.ts b/tests/e2e/tests/build/library-with-demo-app.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/library-with-demo-app.ts rename to tests/e2e/tests/build/library-with-demo-app.ts diff --git a/tests/e2e/tests/build/library/lib-consumption-full-aot.ts b/tests/e2e/tests/build/library/lib-consumption-full-aot.ts new file mode 100644 index 000000000000..08d114f1de4a --- /dev/null +++ b/tests/e2e/tests/build/library/lib-consumption-full-aot.ts @@ -0,0 +1,14 @@ +import { ng } from '../../../utils/process'; +import { executeBrowserTest } from '../../../utils/puppeteer'; +import { browserCheck, libraryConsumptionSetup } from './setup'; + +export default async function () { + await libraryConsumptionSetup(); + + // Build library in full mode (development) + await ng('build', 'my-lib', '--configuration=development'); + + // Check that the e2e succeeds prod and non prod mode + await executeBrowserTest({ configuration: 'production', checkFn: browserCheck }); + await executeBrowserTest({ configuration: 'development', checkFn: browserCheck }); +} diff --git a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-jit.ts b/tests/e2e/tests/build/library/lib-consumption-full-jit.ts similarity index 69% rename from tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-jit.ts rename to tests/e2e/tests/build/library/lib-consumption-full-jit.ts index edded2bebc88..906a920dba44 100644 --- a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-jit.ts +++ b/tests/e2e/tests/build/library/lib-consumption-full-jit.ts @@ -1,8 +1,8 @@ -import { setTimeout } from 'node:timers/promises'; import { updateJsonFile } from '../../../utils/project'; import { expectFileToMatch } from '../../../utils/fs'; import { ng } from '../../../utils/process'; -import { libraryConsumptionSetup } from './setup'; +import { executeBrowserTest } from '../../../utils/puppeteer'; +import { browserCheck, libraryConsumptionSetup } from './setup'; import { getGlobalVariable } from '../../../utils/env'; export default async function () { @@ -15,15 +15,15 @@ export default async function () { await updateJsonFile('angular.json', (config) => { const build = config.projects['test-project'].architect.build; build.options.aot = false; + build.configurations.production.budgets = undefined; if (!getGlobalVariable('argv')['esbuild']) { build.configurations.production.buildOptimizer = false; } }); - // Check that the e2e succeeds prod and non prod mode - await ng('e2e', '--configuration=production'); - await setTimeout(500); - await ng('e2e', '--configuration=development'); + // Ensure app works in prod and non prod mode + await executeBrowserTest({ configuration: 'production', checkFn: browserCheck }); + await executeBrowserTest({ configuration: 'development', checkFn: browserCheck }); // Validate that sourcemaps for the library exists. await ng('build', '--configuration=development'); diff --git a/tests/e2e/tests/build/library/lib-consumption-partial-aot.ts b/tests/e2e/tests/build/library/lib-consumption-partial-aot.ts new file mode 100644 index 000000000000..f906be54b0e6 --- /dev/null +++ b/tests/e2e/tests/build/library/lib-consumption-partial-aot.ts @@ -0,0 +1,14 @@ +import { ng } from '../../../utils/process'; +import { executeBrowserTest } from '../../../utils/puppeteer'; +import { browserCheck, libraryConsumptionSetup } from './setup'; + +export default async function () { + await libraryConsumptionSetup(); + + // Build library in partial mode (production) + await ng('build', 'my-lib', '--configuration=production'); + + // Check that the e2e succeeds prod and non prod mode + await executeBrowserTest({ configuration: 'production', checkFn: browserCheck }); + await executeBrowserTest({ configuration: 'development', checkFn: browserCheck }); +} diff --git a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-jit.ts b/tests/e2e/tests/build/library/lib-consumption-partial-jit.ts similarity index 66% rename from tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-jit.ts rename to tests/e2e/tests/build/library/lib-consumption-partial-jit.ts index 4bba94549952..503c09e525e9 100644 --- a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-jit.ts +++ b/tests/e2e/tests/build/library/lib-consumption-partial-jit.ts @@ -1,7 +1,7 @@ -import { setTimeout } from 'node:timers/promises'; import { updateJsonFile } from '../../../utils/project'; import { ng } from '../../../utils/process'; -import { libraryConsumptionSetup } from './setup'; +import { executeBrowserTest } from '../../../utils/puppeteer'; +import { browserCheck, libraryConsumptionSetup } from './setup'; import { getGlobalVariable } from '../../../utils/env'; export default async function () { @@ -14,13 +14,14 @@ export default async function () { await updateJsonFile('angular.json', (config) => { const build = config.projects['test-project'].architect.build; build.options.aot = false; + build.configurations.production.budgets = undefined; + if (!getGlobalVariable('argv')['esbuild']) { build.configurations.production.buildOptimizer = false; } }); // Check that the e2e succeeds prod and non prod mode - await ng('e2e', '--configuration=production'); - await setTimeout(500); - await ng('e2e', '--configuration=development'); + await executeBrowserTest({ configuration: 'production', checkFn: browserCheck }); + await executeBrowserTest({ configuration: 'development', checkFn: browserCheck }); } diff --git a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-sourcemaps.ts b/tests/e2e/tests/build/library/lib-consumption-sourcemaps.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/library/lib-consumption-sourcemaps.ts rename to tests/e2e/tests/build/library/lib-consumption-sourcemaps.ts diff --git a/tests/legacy-cli/e2e/tests/build/library/lib-unused-decorated-class-treeshake.ts b/tests/e2e/tests/build/library/lib-unused-decorated-class-treeshake.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/library/lib-unused-decorated-class-treeshake.ts rename to tests/e2e/tests/build/library/lib-unused-decorated-class-treeshake.ts diff --git a/tests/legacy-cli/e2e/tests/build/library/setup.ts b/tests/e2e/tests/build/library/setup.ts similarity index 53% rename from tests/legacy-cli/e2e/tests/build/library/setup.ts rename to tests/e2e/tests/build/library/setup.ts index bc67a5b1c6aa..621b740cf4bc 100644 --- a/tests/legacy-cli/e2e/tests/build/library/setup.ts +++ b/tests/e2e/tests/build/library/setup.ts @@ -1,3 +1,4 @@ +import type { Page } from 'puppeteer'; import { writeMultipleFiles } from '../../../utils/fs'; import { silentNg } from '../../../utils/process'; @@ -10,7 +11,6 @@ export async function libraryConsumptionSetup(): Promise { 'projects/my-lib/src/lib/my-lib.ts': `import { Component } from '@angular/core'; @Component({ - standalone: true, selector: 'lib-my-lib', templateUrl: './my-lib.html', }) @@ -20,7 +20,6 @@ export async function libraryConsumptionSetup(): Promise { import { MyLibComponent } from 'my-lib'; @Component({ - standalone: true, selector: 'app-root', template: '', imports: [MyLibComponent], @@ -32,30 +31,15 @@ export async function libraryConsumptionSetup(): Promise { } } `, - 'e2e/src/app.e2e-spec.ts': ` - import { browser, logging, element, by } from 'protractor'; - import { AppPage } from './app.po'; - - describe('workspace-project App', () => { - let page: AppPage; - - beforeEach(() => { - page = new AppPage(); - }); - - it('should display text from library component', async () => { - await page.navigateTo(); - expect(await element(by.css('lib-my-lib p')).getText()).toEqual('my-lib works!'); - }); - - afterEach(async () => { - // Assert that there are no errors emitted from the browser - const logs = await browser.manage().logs().get(logging.Type.BROWSER); - expect(logs).not.toContain(jasmine.objectContaining({ - level: logging.Level.SEVERE, - })); - }); - }); -`, }); } + +export async function browserCheck(page: Page): Promise { + await page.waitForFunction( + () => + !!(globalThis as any).document + .querySelector('lib-my-lib p') + ?.textContent?.includes('my-lib works!'), + { timeout: 10000 }, + ); +} diff --git a/tests/legacy-cli/e2e/tests/build/material.ts b/tests/e2e/tests/build/material.ts similarity index 84% rename from tests/legacy-cli/e2e/tests/build/material.ts rename to tests/e2e/tests/build/material.ts index 0d369ac4db25..bc4862f735fc 100644 --- a/tests/legacy-cli/e2e/tests/build/material.ts +++ b/tests/e2e/tests/build/material.ts @@ -1,5 +1,4 @@ -import assert from 'node:assert/strict'; -import { appendFile, readdir } from 'node:fs/promises'; +import { appendFile } from 'node:fs/promises'; import { getGlobalVariable } from '../../utils/env'; import { readFile, replaceInFile } from '../../utils/fs'; import { @@ -7,8 +6,9 @@ import { installPackage, installWorkspacePackages, } from '../../utils/packages'; -import { execWithEnv, ng } from '../../utils/process'; +import { ng } from '../../utils/process'; import { isPrereleaseCli, updateJsonFile } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; const snapshots = require('../../ng-snapshot/package.json'); @@ -55,9 +55,9 @@ export default async function () { // Issue: https://github.com/angular/angular-cli/issues/17320 await replaceInFile( 'src/app/app.config.ts', - `import { ApplicationConfig } from '@angular/core';`, + `from '@angular/core';`, ` - import { ApplicationConfig } from '@angular/core'; + from '@angular/core'; import { MomentDateAdapter, MAT_MOMENT_DATE_FORMATS @@ -72,10 +72,8 @@ export default async function () { await replaceInFile( 'src/app/app.config.ts', - `providers: [provideRouter(routes) ]`, - ` - providers: [ - provideRouter(routes), + `provideRouter(routes)`, + `provideRouter(routes), { provide: DateAdapter, useClass: MomentDateAdapter, @@ -84,10 +82,8 @@ export default async function () { { provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS - } - ] - `, + }`, ); - await ng('e2e', '--configuration=production'); + await executeBrowserTest({ configuration: 'production' }); } diff --git a/tests/legacy-cli/e2e/tests/build/multiple-configs.ts b/tests/e2e/tests/build/multiple-configs.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/multiple-configs.ts rename to tests/e2e/tests/build/multiple-configs.ts diff --git a/tests/legacy-cli/e2e/tests/build/output-dir.ts b/tests/e2e/tests/build/output-dir.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/output-dir.ts rename to tests/e2e/tests/build/output-dir.ts diff --git a/tests/legacy-cli/e2e/tests/build/poll.ts b/tests/e2e/tests/build/poll.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/poll.ts rename to tests/e2e/tests/build/poll.ts diff --git a/tests/legacy-cli/e2e/tests/build/prerender/discover-routes-ngmodule.ts b/tests/e2e/tests/build/prerender/discover-routes-ngmodule.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/prerender/discover-routes-ngmodule.ts rename to tests/e2e/tests/build/prerender/discover-routes-ngmodule.ts diff --git a/tests/legacy-cli/e2e/tests/build/prerender/discover-routes-standalone.ts b/tests/e2e/tests/build/prerender/discover-routes-standalone.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/prerender/discover-routes-standalone.ts rename to tests/e2e/tests/build/prerender/discover-routes-standalone.ts diff --git a/tests/legacy-cli/e2e/tests/build/prerender/error-with-sourcemaps.ts b/tests/e2e/tests/build/prerender/error-with-sourcemaps.ts similarity index 93% rename from tests/legacy-cli/e2e/tests/build/prerender/error-with-sourcemaps.ts rename to tests/e2e/tests/build/prerender/error-with-sourcemaps.ts index b7970cec4000..875638877fbd 100644 --- a/tests/legacy-cli/e2e/tests/build/prerender/error-with-sourcemaps.ts +++ b/tests/e2e/tests/build/prerender/error-with-sourcemaps.ts @@ -20,19 +20,18 @@ export default async function () { await writeMultipleFiles({ 'src/app/app.ts': ` - import { Component } from '@angular/core'; + import { Component, signal } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', - standalone: true, imports: [CommonModule, RouterOutlet], templateUrl: './app.html', styleUrls: ['./app.css'] }) export class App { - title = 'test-ssr'; + protected readonly title = signal('test-ssr'); constructor() { console.log(window) diff --git a/tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts b/tests/e2e/tests/build/prerender/http-requests-assets.ts similarity index 83% rename from tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts rename to tests/e2e/tests/build/prerender/http-requests-assets.ts index b68e0a72b92a..71288b3c242e 100644 --- a/tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts +++ b/tests/e2e/tests/build/prerender/http-requests-assets.ts @@ -1,7 +1,7 @@ import { ng } from '../../../utils/process'; import { getGlobalVariable } from '../../../utils/env'; -import { expectFileToMatch, rimraf, writeMultipleFiles } from '../../../utils/fs'; -import { installWorkspacePackages } from '../../../utils/packages'; +import { expectFileToMatch, writeMultipleFiles } from '../../../utils/fs'; +import { installWorkspacePackages, uninstallPackage } from '../../../utils/packages'; import { useSha } from '../../../utils/project'; export default async function () { @@ -11,9 +11,8 @@ export default async function () { return; } - // Forcibly remove in case another test doesn't clean itself up. - await rimraf('node_modules/@angular/ssr'); - await ng('add', '@angular/ssr', '--skip-confirmation'); + await uninstallPackage('@angular/ssr'); + await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); await useSha(); await installWorkspacePackages(); @@ -45,14 +44,13 @@ export default async function () { // Update component to do an HTTP call to asset. 'src/app/app.ts': ` - import { Component, inject } from '@angular/core'; + import { ChangeDetectorRef, Component, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterOutlet } from '@angular/router'; import { HttpClient } from '@angular/common/http'; @Component({ selector: 'app-root', - standalone: true, imports: [CommonModule, RouterOutlet], template: \`

{{ data | json }}

@@ -63,15 +61,18 @@ export default async function () { export class App { data: any; dataWithSpace: any; + private readonly cdr: ChangeDetectorRef = inject(ChangeDetectorRef); constructor() { const http = inject(HttpClient); http.get('/media.json').subscribe((d) => { this.data = d; + this.cdr.markForCheck(); }); http.get('/media%20with-space.json').subscribe((d) => { this.dataWithSpace = d; + this.cdr.markForCheck(); }); } } diff --git a/tests/legacy-cli/e2e/tests/build/prod-build.ts b/tests/e2e/tests/build/prod-build.ts similarity index 84% rename from tests/legacy-cli/e2e/tests/build/prod-build.ts rename to tests/e2e/tests/build/prod-build.ts index 3c450aa8d98d..dee45876e379 100644 --- a/tests/legacy-cli/e2e/tests/build/prod-build.ts +++ b/tests/e2e/tests/build/prod-build.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { statSync } from 'node:fs'; import { join } from 'node:path'; import { getGlobalVariable } from '../../utils/env'; @@ -10,17 +11,15 @@ function verifySize(bundle: string, baselineBytes: number) { const maxSize = baselineBytes + percentageBaseline; const minSize = baselineBytes - percentageBaseline; - if (size >= maxSize) { - throw new Error( - `Expected ${bundle} size to be less than ${maxSize / 1024}Kb but it was ${size / 1024}Kb.`, - ); - } + assert( + size < maxSize, + `Expected ${bundle} size to be less than ${maxSize / 1024}Kb but it was ${size / 1024}Kb.`, + ); - if (size <= minSize) { - throw new Error( - `Expected ${bundle} size to be greater than ${minSize / 1024}Kb but it was ${size / 1024}Kb.`, - ); - } + assert( + size > minSize, + `Expected ${bundle} size to be greater than ${minSize / 1024}Kb but it was ${size / 1024}Kb.`, + ); } export default async function () { diff --git a/tests/legacy-cli/e2e/tests/build/progress-and-stats.ts b/tests/e2e/tests/build/progress-and-stats.ts similarity index 52% rename from tests/legacy-cli/e2e/tests/build/progress-and-stats.ts rename to tests/e2e/tests/build/progress-and-stats.ts index d16c671872fb..940179df052e 100644 --- a/tests/legacy-cli/e2e/tests/build/progress-and-stats.ts +++ b/tests/e2e/tests/build/progress-and-stats.ts @@ -4,15 +4,8 @@ import { ng } from '../../utils/process'; export default async function () { const { stderr: stderrProgress, stdout } = await ng('build', '--progress'); - if (!stdout.includes('Initial total')) { - throw new Error(`Expected stdout to contain 'Initial total' but it did not.\n${stdout}`); - } - - if (!stdout.includes('Estimated transfer size')) { - throw new Error( - `Expected stdout to contain 'Estimated transfer size' but it did not.\n${stdout}`, - ); - } + assert.match(stdout, /Initial total/); + assert.match(stdout, /Estimated transfer size/); let logs; if (getGlobalVariable('argv')['esbuild']) { @@ -28,15 +21,11 @@ export default async function () { } for (const log of logs) { - if (!stderrProgress.includes(log)) { - throw new Error(`Expected stderr to contain '${log}' but didn't.\n${stderrProgress}`); - } + assert.match(stderrProgress, new RegExp(log)); } const { stderr: stderrNoProgress } = await ng('build', '--no-progress'); for (const log of logs) { - if (stderrNoProgress.includes(log)) { - throw new Error(`Expected stderr not to contain '${log}' but it did.\n${stderrProgress}`); - } + assert.doesNotMatch(stderrNoProgress, new RegExp(log)); } } diff --git a/tests/legacy-cli/e2e/tests/build/project-name.ts b/tests/e2e/tests/build/project-name.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/project-name.ts rename to tests/e2e/tests/build/project-name.ts diff --git a/tests/legacy-cli/e2e/tests/build/rebuild-deps-type-check.ts b/tests/e2e/tests/build/rebuild-deps-type-check.ts similarity index 72% rename from tests/legacy-cli/e2e/tests/build/rebuild-deps-type-check.ts rename to tests/e2e/tests/build/rebuild-deps-type-check.ts index e390563fda9d..1f4964f6689b 100644 --- a/tests/legacy-cli/e2e/tests/build/rebuild-deps-type-check.ts +++ b/tests/e2e/tests/build/rebuild-deps-type-check.ts @@ -1,6 +1,7 @@ -import { waitForAnyProcessOutputToMatch, execAndWaitForOutputToMatch } from '../../utils/process'; -import { writeFile, prependToFile, appendToFile } from '../../utils/fs'; +import assert from 'node:assert/strict'; import { getGlobalVariable } from '../../utils/env'; +import { appendToFile, prependToFile, writeFile } from '../../utils/fs'; +import { execAndWaitForOutputToMatch, waitForAnyProcessOutputToMatch } from '../../utils/process'; const doneRe = getGlobalVariable('argv')['esbuild'] ? /Application bundle generation complete\./ @@ -69,14 +70,11 @@ export default function () { ]), ) .then((results) => { - const stderr = results[0].stderr; - if ( - !stderr.includes( - "Argument of type 'string' is not assignable to parameter of type 'number'", - ) - ) { - throw new Error('Expected an error but none happened.'); - } + const { stderr } = results[0]; + assert.match( + stderr, + /Argument of type 'string' is not assignable to parameter of type 'number'/, + ); }) // Change an UNRELATED file and the error should still happen. // Should trigger a rebuild, this time an error is also expected. @@ -92,14 +90,11 @@ export default function () { ]), ) .then((results) => { - const stderr = results[0].stderr; - if ( - !stderr.includes( - "Argument of type 'string' is not assignable to parameter of type 'number'", - ) - ) { - throw new Error('Expected an error to still be there but none was.'); - } + const { stderr } = results[0]; + assert.match( + stderr, + /Argument of type 'string' is not assignable to parameter of type 'number'/, + ); }) // Fix the error! .then(() => @@ -116,14 +111,11 @@ export default function () { ]), ) .then((results) => { - const stderr = results[0].stderr; - if ( - stderr.includes( - "Argument of type 'string' is not assignable to parameter of type 'number'", - ) - ) { - throw new Error('Expected no error but an error was shown.'); - } + const { stderr } = results[0]; + assert.doesNotMatch( + stderr, + /Argument of type 'string' is not assignable to parameter of type 'number'/, + ); }) ); } diff --git a/tests/legacy-cli/e2e/tests/build/rebuild-dot-dirname.ts b/tests/e2e/tests/build/rebuild-dot-dirname.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/rebuild-dot-dirname.ts rename to tests/e2e/tests/build/rebuild-dot-dirname.ts diff --git a/tests/legacy-cli/e2e/tests/build/rebuild-replacements.ts b/tests/e2e/tests/build/rebuild-replacements.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/rebuild-replacements.ts rename to tests/e2e/tests/build/rebuild-replacements.ts diff --git a/tests/legacy-cli/e2e/tests/build/rebuild-symlink.ts b/tests/e2e/tests/build/rebuild-symlink.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/rebuild-symlink.ts rename to tests/e2e/tests/build/rebuild-symlink.ts diff --git a/tests/legacy-cli/e2e/tests/build/relative-sourcemap.ts b/tests/e2e/tests/build/relative-sourcemap.ts similarity index 78% rename from tests/legacy-cli/e2e/tests/build/relative-sourcemap.ts rename to tests/e2e/tests/build/relative-sourcemap.ts index 11b2cccd082b..209e29aabd76 100644 --- a/tests/legacy-cli/e2e/tests/build/relative-sourcemap.ts +++ b/tests/e2e/tests/build/relative-sourcemap.ts @@ -1,5 +1,5 @@ +import assert from 'node:assert/strict'; import * as fs from 'node:fs'; - import { isAbsolute } from 'node:path'; import { getGlobalVariable } from '../../utils/env'; import { ng } from '../../utils/process'; @@ -41,22 +41,17 @@ export default async function () { const { sources } = JSON.parse(content) as { sources: string[] }; let mainFileFound = false; for (const source of sources) { - if (isAbsolute(source)) { - throw new Error(`Expected ${source} to be relative.`); - } + assert(!isAbsolute(source), `Expected ${source} to be relative.`); if (source.endsWith('main.ts')) { mainFileFound = true; - if ( - source !== 'projects/secondary-project/src/main.ts' && - source !== './projects/secondary-project/src/main.ts' - ) { - throw new Error(`Expected main file ${source} to be relative to the workspace root.`); - } + assert( + source === 'projects/secondary-project/src/main.ts' || + source === './projects/secondary-project/src/main.ts', + `Expected main file ${source} to be relative to the workspace root.`, + ); } } - if (!mainFileFound) { - throw new Error('Could not find the main file in the application sourcemap sources array.'); - } + assert(mainFileFound, 'Could not find the main file in the application sourcemap sources array.'); } diff --git a/tests/legacy-cli/e2e/tests/build/scripts-output-hashing.ts b/tests/e2e/tests/build/scripts-output-hashing.ts similarity index 90% rename from tests/legacy-cli/e2e/tests/build/scripts-output-hashing.ts rename to tests/e2e/tests/build/scripts-output-hashing.ts index 517e185d4af0..8b34662c485e 100644 --- a/tests/legacy-cli/e2e/tests/build/scripts-output-hashing.ts +++ b/tests/e2e/tests/build/scripts-output-hashing.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { getGlobalVariable } from '../../utils/env'; import { expectFileMatchToExist, @@ -55,9 +56,10 @@ export default async function () { `dist/test-project/browser/${filenameBuild2}`, 'try{console.log()}catch{}', ); - if (filenameBuild1 === filenameBuild2) { - throw new Error( - 'Contents of the built file changed between builds, but the content hash stayed the same!', - ); - } + + assert.notEqual( + filenameBuild1, + filenameBuild2, + 'Contents of the built file changed between builds, but the content hash stayed the same!', + ); } diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-csp-nonce.ts b/tests/e2e/tests/build/server-rendering/express-engine-csp-nonce.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-csp-nonce.ts rename to tests/e2e/tests/build/server-rendering/express-engine-csp-nonce.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-ngmodule.ts b/tests/e2e/tests/build/server-rendering/express-engine-ngmodule.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-ngmodule.ts rename to tests/e2e/tests/build/server-rendering/express-engine-ngmodule.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-standalone.ts b/tests/e2e/tests/build/server-rendering/express-engine-standalone.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-standalone.ts rename to tests/e2e/tests/build/server-rendering/express-engine-standalone.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-external-dependencies.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-external-dependencies.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-external-dependencies.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-external-dependencies.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-base-href.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-base-href.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-base-href.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-base-href.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-sub-path.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-sub-path.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-sub-path.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n-sub-path.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-i18n.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-platform-neutral.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-platform-neutral.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server-platform-neutral.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-server-platform-neutral.ts diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server.ts similarity index 97% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-server.ts index 77b9f9adab61..5205d20eeb0a 100644 --- a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-server.ts +++ b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-server.ts @@ -21,10 +21,10 @@ export default async function () { await installWorkspacePackages(); // Test scenario to verify that the content length, including \r\n, is accurate - await replaceInFile('src/app/app.ts', "title = '", "title = 'Title\\r\\n"); + await replaceInFile('src/app/app.ts', "title = signal('", "title = signal('Title\\r\\n"); // Ensure text has been updated. - assert.match(await readFile('src/app/app.ts'), /title = 'Title/); + assert.match(await readFile('src/app/app.ts'), /title = signal\('Title/); // Add routes await writeFile( diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts similarity index 94% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts index 8e7483f77ee4..b565144b37bf 100644 --- a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts +++ b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts @@ -22,14 +22,13 @@ export default async function () { 'public/media.json': JSON.stringify({ dataFromAssets: true }), // Update component to do an HTTP call to asset and API. 'src/app/app.ts': ` - import { Component, inject } from '@angular/core'; + import { ChangeDetectorRef, Component, inject } from '@angular/core'; import { JsonPipe } from '@angular/common'; import { RouterOutlet } from '@angular/router'; import { HttpClient } from '@angular/common/http'; @Component({ selector: 'app-root', - standalone: true, imports: [JsonPipe, RouterOutlet], template: \`

{{ assetsData | json }}

@@ -40,16 +39,19 @@ export default async function () { export class App { assetsData: any; apiData: any; + private readonly cdr: ChangeDetectorRef = inject(ChangeDetectorRef); constructor() { const http = inject(HttpClient); http.get('/media.json').toPromise().then((d) => { this.assetsData = d; + this.cdr.markForCheck(); }); http.get('/api').toPromise().then((d) => { this.apiData = d; + this.cdr.markForCheck(); }); } } diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-i18n_APP_BASE_HREF.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-static-i18n_APP_BASE_HREF.ts similarity index 91% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-i18n_APP_BASE_HREF.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-static-i18n_APP_BASE_HREF.ts index 51f5e3990bae..245375101946 100644 --- a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-i18n_APP_BASE_HREF.ts +++ b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-static-i18n_APP_BASE_HREF.ts @@ -1,7 +1,7 @@ import { join } from 'node:path'; import { existsSync } from 'node:fs'; import assert from 'node:assert'; -import { expectFileNotToExist, expectFileToMatch, writeFile } from '../../../utils/fs'; +import { expectFileToMatch, writeFile } from '../../../utils/fs'; import { ng, noSilentNg, silentNg } from '../../../utils/process'; import { installWorkspacePackages, uninstallPackage } from '../../../utils/packages'; import { useSha } from '../../../utils/project'; @@ -66,7 +66,7 @@ export default async function () { await writeFile( 'src/app/app.config.ts', ` - import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; + import { ApplicationConfig } from '@angular/core'; import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; @@ -75,7 +75,6 @@ export default async function () { export const appConfig: ApplicationConfig = { providers: [ - provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(), { diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static.ts b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-static.ts similarity index 89% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static.ts rename to tests/e2e/tests/build/server-rendering/server-routes-output-mode-static.ts index 617776a94dc7..77f954be4f4d 100644 --- a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static.ts +++ b/tests/e2e/tests/build/server-rendering/server-routes-output-mode-static.ts @@ -29,7 +29,8 @@ export default async function () { await writeFile( 'src/app/app.routes.ts', ` - import { Routes } from '@angular/router'; + import { inject } from '@angular/core'; + import { Routes, Router } from '@angular/router'; import { Home } from './home/home'; import { Ssg } from './ssg/ssg'; import { SsgWithParams } from './ssg-with-params/ssg-with-params'; @@ -47,6 +48,12 @@ export default async function () { path: 'ssg-redirect', redirectTo: 'ssg' }, + { + path: 'ssg-redirect-via-guard', + canActivate: [() => { + return inject(Router).createUrlTree(['ssg'], { queryParams: { foo: 'bar' }}) + }], + }, { path: 'ssg/:id', component: SsgWithParams, @@ -106,8 +113,10 @@ export default async function () { 'ssg/index.html': /ng-server-context="ssg".+ssg works!/, 'ssg/one/index.html': /ng-server-context="ssg".+ssg-with-params works!/, 'ssg/two/index.html': /ng-server-context="ssg".+ssg-with-params works!/, - // When static redirects as generated as meta tags. + // When static redirects are generated as meta tags. 'ssg-redirect/index.html': '', + 'ssg-redirect-via-guard/index.html': + '', }; for (const [filePath, fileMatch] of Object.entries(expects)) { diff --git a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-preload-links.ts b/tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts similarity index 97% rename from tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-preload-links.ts rename to tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts index 19697ace5657..f1437392492d 100644 --- a/tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-preload-links.ts +++ b/tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts @@ -143,17 +143,15 @@ const RESPONSE_EXPECTS: Record< matches: [ //, //, - //, ], - notMatches: [/home/, /ssr/, /csr/, /ssg-two/, /ssg\-component/], + notMatches: [/home/, /ssr/, /csr/, /ssg-two/, /ssg\-component/, /cross-dep-/], }, '/ssg/two': { matches: [ //, //, - //, ], - notMatches: [/home/, /ssr/, /csr/, /ssg-one/, /ssg\-component/], + notMatches: [/home/, /ssr/, /csr/, /ssg-one/, /ssg\-component/, /cross-dep-/], }, '/ssr': { matches: [//], diff --git a/tests/legacy-cli/e2e/tests/build/sourcemap.ts b/tests/e2e/tests/build/sourcemap.ts similarity index 71% rename from tests/legacy-cli/e2e/tests/build/sourcemap.ts rename to tests/e2e/tests/build/sourcemap.ts index b601ac08656d..2e153e637f30 100644 --- a/tests/legacy-cli/e2e/tests/build/sourcemap.ts +++ b/tests/e2e/tests/build/sourcemap.ts @@ -1,7 +1,8 @@ +import assert from 'node:assert/strict'; import * as fs from 'node:fs'; +import { getGlobalVariable } from '../../utils/env'; import { expectFileToExist } from '../../utils/fs'; import { ng } from '../../utils/process'; -import { getGlobalVariable } from '../../utils/env'; export default async function () { const useWebpackBuilder = !getGlobalVariable('argv')['esbuild']; @@ -11,10 +12,10 @@ export default async function () { await ng('build', '--output-hashing=bundles', '--source-map', '--configuration=development'); await ng('build', '--output-hashing=none', '--source-map'); - await testForSourceMaps(useWebpackBuilder ? 3 : 2); + await testForSourceMaps(useWebpackBuilder ? 2 : 1); await ng('build', '--output-hashing=none', '--source-map', '--configuration=development'); - await testForSourceMaps(useWebpackBuilder ? 4 : 2); + await testForSourceMaps(useWebpackBuilder ? 3 : 1); } async function testForSourceMaps(expectedNumberOfFiles: number): Promise { @@ -30,9 +31,7 @@ async function testForSourceMaps(expectedNumberOfFiles: number): Promise { ++count; - if (!files.includes(file + '.map')) { - throw new Error('Sourcemap not generated for ' + file); - } + assert(files.includes(file + '.map'), 'Sourcemap not generated for ' + file); const content = fs.readFileSync('./dist/test-project/browser/' + file, 'utf8'); let lastLineIndex = content.lastIndexOf('\n'); @@ -41,15 +40,15 @@ async function testForSourceMaps(expectedNumberOfFiles: number): Promise { lastLineIndex = content.lastIndexOf('\n', lastLineIndex - 1); } const comment = lastLineIndex !== -1 && content.slice(lastLineIndex).trim(); - if (comment !== `//# sourceMappingURL=${file}.map`) { - console.log('CONTENT:\n' + content); - throw new Error('Sourcemap comment not generated for ' + file); - } - } - - if (count < expectedNumberOfFiles) { - throw new Error( - `Javascript file count is low. Expected ${expectedNumberOfFiles} but found ${count}`, + assert.equal( + comment, + `//# sourceMappingURL=${file}.map`, + 'Sourcemap comment not generated for ' + file, ); } + + assert( + count >= expectedNumberOfFiles, + `Javascript file count is low. Expected ${expectedNumberOfFiles} but found ${count}`, + ); } diff --git a/tests/legacy-cli/e2e/tests/build/styles/bootstrap.ts b/tests/e2e/tests/build/styles/bootstrap.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/bootstrap.ts rename to tests/e2e/tests/build/styles/bootstrap.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/include-paths.ts b/tests/e2e/tests/build/styles/include-paths.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/include-paths.ts rename to tests/e2e/tests/build/styles/include-paths.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/less.ts b/tests/e2e/tests/build/styles/less.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/less.ts rename to tests/e2e/tests/build/styles/less.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/loaders.ts b/tests/e2e/tests/build/styles/loaders.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/loaders.ts rename to tests/e2e/tests/build/styles/loaders.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/sass-pkg-importer.ts b/tests/e2e/tests/build/styles/sass-pkg-importer.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/sass-pkg-importer.ts rename to tests/e2e/tests/build/styles/sass-pkg-importer.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/sass.ts b/tests/e2e/tests/build/styles/sass.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/sass.ts rename to tests/e2e/tests/build/styles/sass.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/scss-partial-resolution.ts b/tests/e2e/tests/build/styles/scss-partial-resolution.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/scss-partial-resolution.ts rename to tests/e2e/tests/build/styles/scss-partial-resolution.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/scss.ts b/tests/e2e/tests/build/styles/scss.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/scss.ts rename to tests/e2e/tests/build/styles/scss.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/symlinked-global.ts b/tests/e2e/tests/build/styles/symlinked-global.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/symlinked-global.ts rename to tests/e2e/tests/build/styles/symlinked-global.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/tailwind-v2.ts b/tests/e2e/tests/build/styles/tailwind-v2.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/tailwind-v2.ts rename to tests/e2e/tests/build/styles/tailwind-v2.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/tailwind-v3-cjs.ts b/tests/e2e/tests/build/styles/tailwind-v3-cjs.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/tailwind-v3-cjs.ts rename to tests/e2e/tests/build/styles/tailwind-v3-cjs.ts diff --git a/tests/legacy-cli/e2e/tests/build/styles/tailwind-v3.ts b/tests/e2e/tests/build/styles/tailwind-v3.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/styles/tailwind-v3.ts rename to tests/e2e/tests/build/styles/tailwind-v3.ts diff --git a/tests/legacy-cli/e2e/tests/build/ts-paths.ts b/tests/e2e/tests/build/ts-paths.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/build/ts-paths.ts rename to tests/e2e/tests/build/ts-paths.ts diff --git a/tests/legacy-cli/e2e/tests/build/ts-standard-decorators.ts b/tests/e2e/tests/build/ts-standard-decorators.ts similarity index 88% rename from tests/legacy-cli/e2e/tests/build/ts-standard-decorators.ts rename to tests/e2e/tests/build/ts-standard-decorators.ts index 07bf93e3b545..05d056675d3b 100644 --- a/tests/legacy-cli/e2e/tests/build/ts-standard-decorators.ts +++ b/tests/e2e/tests/build/ts-standard-decorators.ts @@ -1,6 +1,7 @@ import { getGlobalVariable } from '../../utils/env'; import { ng } from '../../utils/process'; import { updateJsonFile, updateTsConfig } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; export default async function () { // Update project to disable experimental decorators @@ -31,6 +32,6 @@ export default async function () { // Unit tests (JIT only) await ng('test', '--no-watch'); - // E2E tests to ensure application functions in a browser - await ng('e2e'); + // Ensure application functions in a browser + await executeBrowserTest(); } diff --git a/tests/legacy-cli/e2e/tests/build/wasm-esm.ts b/tests/e2e/tests/build/wasm-esm.ts similarity index 77% rename from tests/legacy-cli/e2e/tests/build/wasm-esm.ts rename to tests/e2e/tests/build/wasm-esm.ts index 43d3708c2c36..70633a1021c1 100644 --- a/tests/legacy-cli/e2e/tests/build/wasm-esm.ts +++ b/tests/e2e/tests/build/wasm-esm.ts @@ -11,6 +11,7 @@ import { ng } from '../../utils/process'; import { prependToFile, replaceInFile } from '../../utils/fs'; import { updateJsonFile, useSha } from '../../utils/project'; import { installWorkspacePackages } from '../../utils/packages'; +import { executeBrowserTest } from '../../utils/puppeteer'; /** * Compiled and base64 encoded WASM file for the following WAT: @@ -62,39 +63,14 @@ export default async function () { // of a JIT production build. json.projects['test-project'].architect.build.options.polyfills = []; }); - await replaceInFile( - 'src/app/app.config.ts', - 'provideZoneChangeDetection', - 'provideZonelessChangeDetection', - ); - await replaceInFile( - 'src/app/app.config.ts', - 'provideZoneChangeDetection({ eventCoalescing: true })', - 'provideZonelessChangeDetection()', - ); await ng('build'); // Update E2E test to check for WASM execution - await writeFile( - 'e2e/src/app.e2e-spec.ts', - ` - import { AppPage } from './app.po'; - import { browser, logging } from 'protractor'; - describe('WASM execution', () => { - it('should log WASM result messages', async () => { - const page = new AppPage(); - await page.navigateTo(); - expect(await page.getTitleText()).toEqual('Hello, 32'); - }); - }); - `, - ); - - await ng('e2e'); + await executeBrowserTest({ expectedTitleText: 'Hello, 32' }); // Setup prerendering and build to test Node.js functionality - await ng('add', '@angular/ssr', '--skip-confirmation'); + await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); await useSha(); await installWorkspacePackages(); diff --git a/tests/legacy-cli/e2e/tests/build/worker.ts b/tests/e2e/tests/build/worker.ts similarity index 96% rename from tests/legacy-cli/e2e/tests/build/worker.ts rename to tests/e2e/tests/build/worker.ts index 7b6cdb390cb7..53e60aa34772 100644 --- a/tests/legacy-cli/e2e/tests/build/worker.ts +++ b/tests/e2e/tests/build/worker.ts @@ -6,10 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ +import assert from 'node:assert/strict'; import { readdir } from 'node:fs/promises'; +import { getGlobalVariable } from '../../utils/env'; import { expectFileToExist, expectFileToMatch, replaceInFile, writeFile } from '../../utils/fs'; import { ng } from '../../utils/process'; -import { getGlobalVariable } from '../../utils/env'; import { expectToFail } from '../../utils/utils'; export default async function () { @@ -83,9 +84,7 @@ async function getWorkerOutputFile(useWebpackBuilder: boolean): Promise fileName = files.find((f) => /worker-[\dA-Z]{8}\.js/.test(f)); } - if (!fileName) { - throw new Error('Cannot determine worker output file name.'); - } + assert(fileName, 'Cannot determine worker output file name.'); return fileName; } diff --git a/tests/legacy-cli/e2e/tests/commands/add/add-material.ts b/tests/e2e/tests/commands/add/add-material.ts similarity index 98% rename from tests/legacy-cli/e2e/tests/commands/add/add-material.ts rename to tests/e2e/tests/commands/add/add-material.ts index 56d47a8744a7..238e5d94dddb 100644 --- a/tests/legacy-cli/e2e/tests/commands/add/add-material.ts +++ b/tests/e2e/tests/commands/add/add-material.ts @@ -28,7 +28,7 @@ export default async function () { 'add', `@angular/material${tag}`, '--theme', - 'custom', + 'azure-blue', '--verbose', '--skip-confirmation', ); diff --git a/tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts b/tests/e2e/tests/commands/add/add-pwa.ts similarity index 81% rename from tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts rename to tests/e2e/tests/commands/add/add-pwa.ts index e4c3be19cc88..c01cc185c84b 100644 --- a/tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts +++ b/tests/e2e/tests/commands/add/add-pwa.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { getGlobalVariable } from '../../../utils/env'; import { expectFileToExist, readFile, rimraf } from '../../../utils/fs'; import { installWorkspacePackages } from '../../../utils/packages'; @@ -17,9 +18,7 @@ export default async function () { const hasPWADep = Object.keys({ ...dependencies, ...devDependencies }).some( (d) => d === '@angular/pwa', ); - if (hasPWADep) { - throw new Error(`Expected 'package.json' not to contain a dependency on '@angular/pwa'.`); - } + assert.ok(!hasPWADep, `Expected 'package.json' not to contain a dependency on '@angular/pwa'.`); const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots']; if (isSnapshotBuild) { @@ -55,13 +54,10 @@ export default async function () { })); const emptyAssetGroups = assetGroups.filter(({ urlCount }) => urlCount === 0); - if (assetGroups.length === 0) { - throw new Error("Expected 'ngsw.json' to contain at least one asset-group."); - } - if (emptyAssetGroups.length > 0) { - throw new Error( - 'Expected all asset-groups to contain at least one URL, but the following groups are empty: ' + - emptyAssetGroups.map(({ name }) => name).join(', '), - ); - } + assert.ok(assetGroups.length > 0, "Expected 'ngsw.json' to contain at least one asset-group."); + assert.ok( + emptyAssetGroups.length === 0, + 'Expected all asset-groups to contain at least one URL, but the following groups are empty: ' + + emptyAssetGroups.map(({ name }) => name).join(', '), + ); } diff --git a/tests/e2e/tests/commands/add/add-tailwindcss.ts b/tests/e2e/tests/commands/add/add-tailwindcss.ts new file mode 100644 index 000000000000..1444bb6a9a07 --- /dev/null +++ b/tests/e2e/tests/commands/add/add-tailwindcss.ts @@ -0,0 +1,28 @@ +import { expectFileToExist, expectFileToMatch, rimraf } from '../../../utils/fs'; +import { getActivePackageManager, uninstallPackage } from '../../../utils/packages'; +import { ng } from '../../../utils/process'; + +export default async function () { + // In case a previous test installed tailwindcss, clear it. + // (we don't clear node module directories between tests) + // npm does not appear to fully uninstall sometimes + if (getActivePackageManager() === 'npm') { + await rimraf('node_modules/tailwindcss'); + } + + try { + await ng('add', 'tailwindcss', '--skip-confirmation'); + await expectFileToExist('.postcssrc.json'); + await expectFileToMatch('src/styles.css', /@import "tailwindcss";/); + await expectFileToMatch('package.json', /"tailwindcss":/); + await expectFileToMatch('package.json', /"@tailwindcss\/postcss":/); + await expectFileToMatch('package.json', /"postcss":/); + + // Ensure the project builds + await ng('build', '--configuration=development'); + } finally { + await uninstallPackage('tailwindcss'); + await uninstallPackage('@tailwindcss/postcss'); + await uninstallPackage('postcss'); + } +} diff --git a/tests/legacy-cli/e2e/tests/commands/add/add-version.ts b/tests/e2e/tests/commands/add/add-version.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/add/add-version.ts rename to tests/e2e/tests/commands/add/add-version.ts diff --git a/tests/legacy-cli/e2e/tests/commands/add/add.ts b/tests/e2e/tests/commands/add/add.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/add/add.ts rename to tests/e2e/tests/commands/add/add.ts diff --git a/tests/legacy-cli/e2e/tests/commands/add/base.ts b/tests/e2e/tests/commands/add/base.ts similarity index 86% rename from tests/legacy-cli/e2e/tests/commands/add/base.ts rename to tests/e2e/tests/commands/add/base.ts index f4e7048df6ac..d31210c6c242 100644 --- a/tests/legacy-cli/e2e/tests/commands/add/base.ts +++ b/tests/e2e/tests/commands/add/base.ts @@ -4,7 +4,7 @@ import { ng } from '../../../utils/process'; import { expectToFail } from '../../../utils/utils'; export default async function () { - await symlinkFile(assetDir('add-collection'), `./node_modules/add-collection`, 'dir'); + await symlinkFile(assetDir('add-collection-dir'), `./node_modules/add-collection`, 'dir'); await ng('add', 'add-collection'); await expectFileToExist('empty-file'); diff --git a/tests/e2e/tests/commands/add/dir.ts b/tests/e2e/tests/commands/add/dir.ts new file mode 100644 index 000000000000..7cb00704cc8e --- /dev/null +++ b/tests/e2e/tests/commands/add/dir.ts @@ -0,0 +1,19 @@ +import { cp } from 'node:fs/promises'; +import { resolve } from 'node:path'; +import { assetDir } from '../../../utils/assets'; +import { expectFileToExist } from '../../../utils/fs'; +import { ng } from '../../../utils/process'; + +export default async function () { + const collectionName = 'add-collection-dir'; + const dirCollectionPath = resolve(collectionName); + + // Copy locally as bun doesn't install the dependency correctly if it has symlinks. + await cp(assetDir(collectionName), dirCollectionPath, { + recursive: true, + dereference: true, + }); + + await ng('add', dirCollectionPath, '--name=blah', '--skip-confirmation'); + await expectFileToExist('blah'); +} diff --git a/tests/e2e/tests/commands/add/file.ts b/tests/e2e/tests/commands/add/file.ts new file mode 100644 index 000000000000..5b22b4211ceb --- /dev/null +++ b/tests/e2e/tests/commands/add/file.ts @@ -0,0 +1,13 @@ +import { copyFile } from 'node:fs/promises'; +import { assetDir } from '../../../utils/assets'; +import { expectFileToExist } from '../../../utils/fs'; +import { ng } from '../../../utils/process'; + +export default async function () { + // Avoids ERR_PNPM_ENAMETOOLONG errors. + const tarball = './add-collection.tgz'; + await copyFile(assetDir(tarball), tarball); + + await ng('add', tarball, '--name=blah', '--skip-confirmation'); + await expectFileToExist('blah'); +} diff --git a/tests/legacy-cli/e2e/tests/commands/add/npm-config.ts b/tests/e2e/tests/commands/add/npm-config.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/add/npm-config.ts rename to tests/e2e/tests/commands/add/npm-config.ts diff --git a/tests/e2e/tests/commands/add/peer.ts b/tests/e2e/tests/commands/add/peer.ts new file mode 100644 index 000000000000..143542e4533c --- /dev/null +++ b/tests/e2e/tests/commands/add/peer.ts @@ -0,0 +1,44 @@ +import assert from 'node:assert/strict'; +import { resolve } from 'node:path'; +import { cp } from 'node:fs/promises'; +import { assetDir } from '../../../utils/assets'; +import { ng } from '../../../utils/process'; + +export default async function (): Promise { + const warning = /Adding the package may not succeed/; + + const stdout1 = await runNgAdd('add-collection-peer-bad'); + assert.match( + stdout1, + warning, + `Peer warning should be shown for add-collection-peer-bad but was not.`, + ); + + const stdout2 = await runNgAdd('add-collection-dir'); + assert.doesNotMatch( + stdout2, + warning, + `Peer warning should NOT be shown for add-collection-dir but was.`, + ); + + const stdout3 = await runNgAdd('add-collection-peer-good'); + assert.doesNotMatch( + stdout3, + warning, + `Peer warning should NOT be shown for add-collection-peer-good but was.`, + ); +} + +async function runNgAdd(collectionName: string): Promise { + const collectionPath = resolve(collectionName); + + // Copy locally as bun doesn't install the dependency correctly if it has symlinks. + await cp(assetDir(collectionName), collectionPath, { + recursive: true, + dereference: true, + }); + + const { stdout } = await ng('add', collectionPath, '--skip-confirmation'); + + return stdout; +} diff --git a/tests/legacy-cli/e2e/tests/commands/add/registry-option.ts b/tests/e2e/tests/commands/add/registry-option.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/add/registry-option.ts rename to tests/e2e/tests/commands/add/registry-option.ts diff --git a/tests/e2e/tests/commands/add/secure-registry.ts b/tests/e2e/tests/commands/add/secure-registry.ts new file mode 100644 index 000000000000..4a640607f8be --- /dev/null +++ b/tests/e2e/tests/commands/add/secure-registry.ts @@ -0,0 +1,50 @@ +import { expectFileNotToExist, expectFileToExist, rimraf } from '../../../utils/fs'; +import { getActivePackageManager, installWorkspacePackages } from '../../../utils/packages'; +import { git, ng } from '../../../utils/process'; +import { createNpmConfigForAuthentication } from '../../../utils/registry'; +import { expectToFail } from '../../../utils/utils'; + +export default async function () { + const originalNpmConfigRegistry = process.env['NPM_CONFIG_REGISTRY']; + try { + // The environment variable has priority over the .npmrc + delete process.env['NPM_CONFIG_REGISTRY']; + const packageManager = getActivePackageManager(); + const supportsUnscopedAuth = packageManager === 'yarn'; + const command = ['add', '@angular/pwa', '--skip-confirmation']; + + // Works with unscoped registry authentication details + if (supportsUnscopedAuth) { + // Some package managers such as Bun and NPM do not support unscoped auth. + await createNpmConfigForAuthentication(false); + + await expectFileNotToExist('public/manifest.webmanifest'); + + await ng(...command); + await expectFileToExist('public/manifest.webmanifest'); + await git('clean', '-dxf'); + } + + // Works with scoped registry authentication details + await expectFileNotToExist('public/manifest.webmanifest'); + + await createNpmConfigForAuthentication(true); + await ng(...command); + await expectFileToExist('public/manifest.webmanifest'); + await git('clean', '-dxf'); + + // Invalid authentication token + if (supportsUnscopedAuth) { + // Some package managers such as Bun and NPM do not support unscoped auth. + await createNpmConfigForAuthentication(false, true); + await expectToFail(() => ng(...command)); + } + + await createNpmConfigForAuthentication(true, true); + await expectToFail(() => ng(...command)); + } finally { + process.env['NPM_CONFIG_REGISTRY'] = originalNpmConfigRegistry; + await git('clean', '-dxf'); + await installWorkspacePackages(); + } +} diff --git a/tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts b/tests/e2e/tests/commands/add/version-specifier.ts similarity index 69% rename from tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts rename to tests/e2e/tests/commands/add/version-specifier.ts index 7bd09835ee9c..f88d60a51ec9 100644 --- a/tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts +++ b/tests/e2e/tests/commands/add/version-specifier.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { appendFile } from 'node:fs/promises'; import { expectFileToMatch } from '../../../utils/fs'; import { getActivePackageManager, uninstallPackage } from '../../../utils/packages'; @@ -21,24 +22,32 @@ export default async function () { await expectFileToMatch('package.json', /@angular\/localize/); const output1 = await ng('add', '@angular/localize', '--skip-confirmation'); - if (!output1.stdout.includes('Skipping installation: Package already installed')) { - throw new Error('Installation was not skipped'); - } + assert.match( + output1.stdout, + /Skipping installation: Package already installed/, + 'Installation was not skipped', + ); const output2 = await ng('add', '@angular/localize@latest', '--skip-confirmation'); - if (output2.stdout.includes('Skipping installation: Package already installed')) { - throw new Error('Installation should not have been skipped'); - } + assert.doesNotMatch( + output2.stdout, + /Skipping installation: Package already installed/, + 'Installation should not have been skipped', + ); const output3 = await ng('add', '@angular/localize@19.1.0', '--skip-confirmation'); - if (output3.stdout.includes('Skipping installation: Package already installed')) { - throw new Error('Installation should not have been skipped'); - } + assert.doesNotMatch( + output3.stdout, + /Skipping installation: Package already installed/, + 'Installation should not have been skipped', + ); const output4 = await ng('add', '@angular/localize@19', '--skip-confirmation'); - if (!output4.stdout.includes('Skipping installation: Package already installed')) { - throw new Error('Installation was not skipped'); - } + assert.match( + output4.stdout, + /Skipping installation: Package already installed/, + 'Installation was not skipped', + ); await uninstallPackage('@angular/localize'); } diff --git a/tests/legacy-cli/e2e/tests/commands/add/yarn-env-vars.ts b/tests/e2e/tests/commands/add/yarn-env-vars.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/add/yarn-env-vars.ts rename to tests/e2e/tests/commands/add/yarn-env-vars.ts diff --git a/tests/legacy-cli/e2e/tests/commands/additional-properties.ts b/tests/e2e/tests/commands/additional-properties.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/additional-properties.ts rename to tests/e2e/tests/commands/additional-properties.ts diff --git a/tests/legacy-cli/e2e/tests/commands/analytics/analytics-enable-disable.ts b/tests/e2e/tests/commands/analytics/analytics-enable-disable.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/analytics/analytics-enable-disable.ts rename to tests/e2e/tests/commands/analytics/analytics-enable-disable.ts diff --git a/tests/legacy-cli/e2e/tests/commands/analytics/analytics-info.ts b/tests/e2e/tests/commands/analytics/analytics-info.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/analytics/analytics-info.ts rename to tests/e2e/tests/commands/analytics/analytics-info.ts diff --git a/tests/legacy-cli/e2e/tests/commands/analytics/ask-analytics-command.ts b/tests/e2e/tests/commands/analytics/ask-analytics-command.ts similarity index 70% rename from tests/legacy-cli/e2e/tests/commands/analytics/ask-analytics-command.ts rename to tests/e2e/tests/commands/analytics/ask-analytics-command.ts index 3791d6850a8d..ae20bb21f2fa 100644 --- a/tests/legacy-cli/e2e/tests/commands/analytics/ask-analytics-command.ts +++ b/tests/e2e/tests/commands/analytics/ask-analytics-command.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { execWithEnv } from '../../../utils/process'; import { mockHome } from '../../../utils/utils'; @@ -17,9 +18,7 @@ export default async function () { 'n\n' /* stdin */, ); - if (!ANALYTICS_PROMPT.test(stdout)) { - throw new Error('CLI did not prompt for analytics permission.'); - } + assert.match(stdout, ANALYTICS_PROMPT, 'CLI did not prompt for analytics permission.'); }); // CLI should skip analytics prompt with `NG_CLI_ANALYTICS=false`. @@ -31,9 +30,11 @@ export default async function () { NG_FORCE_AUTOCOMPLETE: 'false', }); - if (ANALYTICS_PROMPT.test(stdout)) { - throw new Error('CLI prompted for analytics permission when it should be forced off.'); - } + assert.doesNotMatch( + stdout, + ANALYTICS_PROMPT, + 'CLI prompted for analytics permission when it should be forced off.', + ); }); // CLI should skip analytics prompt during `ng update`. @@ -44,10 +45,10 @@ export default async function () { NG_FORCE_AUTOCOMPLETE: 'false', }); - if (ANALYTICS_PROMPT.test(stdout)) { - throw new Error( - 'CLI prompted for analytics permission during an update where it should not' + ' have.', - ); - } + assert.doesNotMatch( + stdout, + ANALYTICS_PROMPT, + 'CLI prompted for analytics permission during an update where it should not have.', + ); }); } diff --git a/tests/legacy-cli/e2e/tests/commands/builder-not-found.ts b/tests/e2e/tests/commands/builder-not-found.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/builder-not-found.ts rename to tests/e2e/tests/commands/builder-not-found.ts diff --git a/tests/legacy-cli/e2e/tests/commands/builder-project-by-cwd.ts b/tests/e2e/tests/commands/builder-project-by-cwd.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/builder-project-by-cwd.ts rename to tests/e2e/tests/commands/builder-project-by-cwd.ts diff --git a/tests/legacy-cli/e2e/tests/commands/cache/cache-clean.ts b/tests/e2e/tests/commands/cache/cache-clean.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/cache/cache-clean.ts rename to tests/e2e/tests/commands/cache/cache-clean.ts diff --git a/tests/e2e/tests/commands/cache/cache-enable-disable.ts b/tests/e2e/tests/commands/cache/cache-enable-disable.ts new file mode 100644 index 000000000000..1cfbf705787e --- /dev/null +++ b/tests/e2e/tests/commands/cache/cache-enable-disable.ts @@ -0,0 +1,19 @@ +import assert from 'node:assert/strict'; +import { readFile } from '../../../utils/fs'; +import { ng } from '../../../utils/process'; + +export default async function () { + await ng('cache', 'enable'); + assert.strictEqual( + JSON.parse(await readFile('angular.json')).cli.cache.enabled, + true, + `Expected 'cli.cache.enable' to be true.`, + ); + + await ng('cache', 'disable'); + assert.strictEqual( + JSON.parse(await readFile('angular.json')).cli.cache.enabled, + false, + `Expected 'cli.cache.enable' to be false.`, + ); +} diff --git a/tests/legacy-cli/e2e/tests/commands/cache/cache-info.ts b/tests/e2e/tests/commands/cache/cache-info.ts similarity index 58% rename from tests/legacy-cli/e2e/tests/commands/cache/cache-info.ts rename to tests/e2e/tests/commands/cache/cache-info.ts index 46ae15aef796..bad2df6c3bdc 100644 --- a/tests/legacy-cli/e2e/tests/commands/cache/cache-info.ts +++ b/tests/e2e/tests/commands/cache/cache-info.ts @@ -1,65 +1,62 @@ import { execAndWaitForOutputToMatch } from '../../../utils/process'; import { updateJsonFile } from '../../../utils/project'; +const ENV_NO_COLOR = { + 'NO_COLOR': '1', +}; + export default async function () { const originalCIValue = process.env['CI']; try { // Should be enabled by default for local builds. await configureTest('0' /** envCI */); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: enabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Enabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); // Should be disabled by default for CI builds. await configureTest('1' /** envCI */, { enabled: true }); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: disabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Disabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); // Should be enabled by when environment is local and env is not CI. await configureTest('0' /** envCI */, { environment: 'local' }); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: enabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Enabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); // Should be disabled by when environment is local and env is CI. await configureTest('1' /** envCI */, { environment: 'local' }); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: disabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Disabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); // Effective status should be enabled when 'environment' is set to 'all' or 'ci'. await configureTest('1' /** envCI */, { environment: 'all' }); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: enabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Enabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); // Effective status should be enabled when 'environment' is set to 'ci' and run is in ci await configureTest('1' /** envCI */, { environment: 'ci' }); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: enabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Enabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); // Effective status should be disabled when 'enabled' is set to false await configureTest('1' /** envCI */, { environment: 'all', enabled: false }); - await execAndWaitForOutputToMatch( - 'ng', - ['cache', 'info'], - /Effective status on current machine: disabled/, - ); + await execAndWaitForOutputToMatch('ng', ['cache', 'info'], /Effective Status\s*: Disabled/, { + ...process.env, + ...ENV_NO_COLOR, + }); } finally { process.env['CI'] = originalCIValue; } diff --git a/tests/legacy-cli/e2e/tests/commands/completion/completion-prompt.ts b/tests/e2e/tests/commands/completion/completion-prompt.ts similarity index 62% rename from tests/legacy-cli/e2e/tests/commands/completion/completion-prompt.ts rename to tests/e2e/tests/commands/completion/completion-prompt.ts index 3e0a182c2270..424b373e47a6 100644 --- a/tests/legacy-cli/e2e/tests/commands/completion/completion-prompt.ts +++ b/tests/e2e/tests/commands/completion/completion-prompt.ts @@ -3,6 +3,7 @@ import * as path from 'node:path'; import { env } from 'node:process'; import { getGlobalVariable } from '../../../utils/env'; import { mockHome } from '../../../utils/utils'; +import assert from 'node:assert/strict'; import { execAndCaptureError, @@ -51,20 +52,24 @@ export default async function () { 'y\n' /* stdin: accept prompt */, ); - if (!AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error('CLI execution did not prompt for autocompletion setup when it should have.'); - } + assert.match( + stdout, + AUTOCOMPLETION_PROMPT, + 'CLI execution did not prompt for autocompletion setup when it should have.', + ); const bashrcContents = await fs.readFile(bashrc, 'utf-8'); - if (!bashrcContents.includes('source <(ng completion script)')) { - throw new Error( - 'Autocompletion was *not* added to `~/.bashrc` after accepting the setup prompt.', - ); - } + assert.match( + bashrcContents, + /source <\(ng completion script\)/, + 'Autocompletion was *not* added to `~/.bashrc` after accepting the setup prompt.', + ); - if (!stdout.includes('Appended `source <(ng completion script)`')) { - throw new Error('CLI did not print that it successfully set up autocompletion.'); - } + assert.match( + stdout, + /Appended `source <\(ng completion script\)`/, + 'CLI did not print that it successfully set up autocompletion.', + ); }); // Does nothing if the user rejects the autocompletion prompt. @@ -83,26 +88,30 @@ export default async function () { 'n\n' /* stdin: reject prompt */, ); - if (!AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error('CLI execution did not prompt for autocompletion setup when it should have.'); - } + assert.match( + stdout, + AUTOCOMPLETION_PROMPT, + 'CLI execution did not prompt for autocompletion setup when it should have.', + ); const bashrcContents = await fs.readFile(bashrc, 'utf-8'); - if (bashrcContents.includes('ng completion')) { - throw new Error( - 'Autocompletion was incorrectly added to `~/.bashrc` after refusing the setup prompt.', - ); - } + assert.doesNotMatch( + bashrcContents, + /ng completion/, + 'Autocompletion was incorrectly added to `~/.bashrc` after refusing the setup prompt.', + ); - if (stdout.includes('Appended `source <(ng completion script)`')) { - throw new Error( - "CLI printed that it successfully set up autocompletion when it actually didn't.", - ); - } + assert.doesNotMatch( + stdout, + /Appended `source <\(ng completion script\)`/, + "CLI printed that it successfully set up autocompletion when it actually didn't.", + ); - if (!stdout.includes("Ok, you won't be prompted again.")) { - throw new Error('CLI did not inform the user they will not be prompted again.'); - } + assert.match( + stdout, + /Ok, you won't be prompted again\./, + 'CLI did not inform the user they will not be prompted again.', + ); }); // Does *not* prompt if the user already accepted (even if they delete the completion config). @@ -121,17 +130,19 @@ export default async function () { 'y\n' /* stdin: accept prompt */, ); - if (!AUTOCOMPLETION_PROMPT.test(stdout1)) { - throw new Error('First execution did not prompt for autocompletion setup.'); - } + assert.match( + stdout1, + AUTOCOMPLETION_PROMPT, + 'First execution did not prompt for autocompletion setup.', + ); const bashrcContents1 = await fs.readFile(bashrc, 'utf-8'); - if (!bashrcContents1.includes('source <(ng completion script)')) { - throw new Error( - '`~/.bashrc` file was not updated after the user accepted the autocompletion' + - ` prompt. Contents:\n${bashrcContents1}`, - ); - } + assert.match( + bashrcContents1, + /source <\(ng completion script\)/, + '`~/.bashrc` file was not updated after the user accepted the autocompletion' + + ` prompt. Contents:\n${bashrcContents1}`, + ); // User modifies their configuration and removes `ng completion`. await fs.writeFile(bashrc, '# Some new commands...'); @@ -142,20 +153,20 @@ export default async function () { HOME: home, }); - if (AUTOCOMPLETION_PROMPT.test(stdout2)) { - throw new Error( - 'Subsequent execution after rejecting autocompletion setup prompted again' + - ' when it should not have.', - ); - } + assert.doesNotMatch( + stdout2, + AUTOCOMPLETION_PROMPT, + 'Subsequent execution after rejecting autocompletion setup prompted again' + + ' when it should not have.', + ); const bashrcContents2 = await fs.readFile(bashrc, 'utf-8'); - if (bashrcContents2 !== '# Some new commands...') { - throw new Error( - '`~/.bashrc` file was incorrectly modified when using a modified `~/.bashrc`' + - ` after previously accepting the autocompletion prompt. Contents:\n${bashrcContents2}`, - ); - } + assert.strictEqual( + bashrcContents2, + '# Some new commands...', + '`~/.bashrc` file was incorrectly modified when using a modified `~/.bashrc`' + + ` after previously accepting the autocompletion prompt. Contents:\n${bashrcContents2}`, + ); }); // Does *not* prompt if the user already rejected. @@ -174,9 +185,11 @@ export default async function () { 'n\n' /* stdin: reject prompt */, ); - if (!AUTOCOMPLETION_PROMPT.test(stdout1)) { - throw new Error('First execution did not prompt for autocompletion setup.'); - } + assert.match( + stdout1, + AUTOCOMPLETION_PROMPT, + 'First execution did not prompt for autocompletion setup.', + ); const { stdout: stdout2 } = await execWithEnv('ng', ['config'], { ...DEFAULT_ENV, @@ -184,20 +197,20 @@ export default async function () { HOME: home, }); - if (AUTOCOMPLETION_PROMPT.test(stdout2)) { - throw new Error( - 'Subsequent execution after rejecting autocompletion setup prompted again' + - ' when it should not have.', - ); - } + assert.doesNotMatch( + stdout2, + AUTOCOMPLETION_PROMPT, + 'Subsequent execution after rejecting autocompletion setup prompted again' + + ' when it should not have.', + ); const bashrcContents = await fs.readFile(bashrc, 'utf-8'); - if (bashrcContents !== '# Other commands...') { - throw new Error( - '`~/.bashrc` file was incorrectly modified when the user never accepted the' + - ` autocompletion prompt. Contents:\n${bashrcContents}`, - ); - } + assert.strictEqual( + bashrcContents, + '# Other commands...', + '`~/.bashrc` file was incorrectly modified when the user never accepted the' + + ` autocompletion prompt. Contents:\n${bashrcContents}`, + ); }); // Prompts user again on subsequent execution after accepting prompt but failing to setup. @@ -220,11 +233,11 @@ export default async function () { 'y\n' /* stdin: accept prompt */, ); - if (!err.message.includes('Failed to append autocompletion setup')) { - throw new Error( - `Failed first execution did not print the expected error message. Actual:\n${err.message}`, - ); - } + assert.match( + err.message, + /Failed to append autocompletion setup/, + `Failed first execution did not print the expected error message. Actual:\n${err.message}`, + ); // User corrects file permissions between executions. await fs.chmod(bashrc, 0o777); @@ -240,20 +253,20 @@ export default async function () { 'y\n' /* stdin: accept prompt */, ); - if (!AUTOCOMPLETION_PROMPT.test(stdout2)) { - throw new Error( - 'Subsequent execution after failed autocompletion setup did not prompt again when it should' + - ' have.', - ); - } + assert.match( + stdout2, + AUTOCOMPLETION_PROMPT, + 'Subsequent execution after failed autocompletion setup did not prompt again when it should' + + ' have.', + ); const bashrcContents = await fs.readFile(bashrc, 'utf-8'); - if (!bashrcContents.includes('ng completion script')) { - throw new Error( - '`~/.bashrc` file does not include `ng completion` after the user never accepted the' + - ` autocompletion prompt a second time. Contents:\n${bashrcContents}`, - ); - } + assert.match( + bashrcContents, + /ng completion script/, + '`~/.bashrc` file does not include `ng completion` after the user never accepted the' + + ` autocompletion prompt a second time. Contents:\n${bashrcContents}`, + ); }); // Does *not* prompt for `ng update` commands. @@ -264,9 +277,11 @@ export default async function () { HOME: home, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error('`ng update` command incorrectly prompted for autocompletion setup.'); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + '`ng update` command incorrectly prompted for autocompletion setup.', + ); }); // Does *not* prompt for `ng completion` commands. @@ -276,9 +291,11 @@ export default async function () { HOME: home, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error('`ng completion` command incorrectly prompted for autocompletion setup.'); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + '`ng completion` command incorrectly prompted for autocompletion setup.', + ); }); // Does *not* prompt user for CI executions. @@ -289,9 +306,11 @@ export default async function () { NG_FORCE_TTY: undefined, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error('CI execution prompted for autocompletion setup but should not have.'); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'CI execution prompted for autocompletion setup but should not have.', + ); } // Does *not* prompt user for non-TTY executions. @@ -301,9 +320,11 @@ export default async function () { NG_FORCE_TTY: 'false', }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error('Non-TTY execution prompted for autocompletion setup but should not have.'); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'Non-TTY execution prompted for autocompletion setup but should not have.', + ); } // Does *not* prompt user for executions without a `$HOME`. @@ -313,12 +334,12 @@ export default async function () { HOME: undefined, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error( - 'Execution without a `$HOME` value prompted for autocompletion setup but' + - ' should not have.', - ); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'Execution without a `$HOME` value prompted for autocompletion setup but' + + ' should not have.', + ); } // Does *not* prompt user for executions without a `$SHELL`. @@ -328,12 +349,12 @@ export default async function () { SHELL: undefined, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error( - 'Execution without a `$SHELL` value prompted for autocompletion setup but' + - ' should not have.', - ); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'Execution without a `$SHELL` value prompted for autocompletion setup but' + + ' should not have.', + ); } // Does *not* prompt user for executions from unknown shells. @@ -343,12 +364,12 @@ export default async function () { SHELL: '/usr/bin/unknown', }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error( - 'Execution with an unknown `$SHELL` value prompted for autocompletion setup' + - ' but should not have.', - ); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'Execution with an unknown `$SHELL` value prompted for autocompletion setup' + + ' but should not have.', + ); } // Does *not* prompt user when an RC file already uses `ng completion`. @@ -370,12 +391,12 @@ source <(ng completion script) HOME: home, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error( - "Execution with an existing `ng completion` line in the user's RC file" + - ' prompted for autocompletion setup but should not have.', - ); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + "Execution with an existing `ng completion` line in the user's RC file" + + ' prompted for autocompletion setup but should not have.', + ); }); // Prompts when a global CLI install is present on the system. @@ -418,12 +439,12 @@ source <(ng completion script) PATH: pathEnvVar, }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error( - 'Execution without a global CLI install prompted for autocompletion setup but should' + - ' not have.', - ); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'Execution without a global CLI install prompted for autocompletion setup but should' + + ' not have.', + ); } finally { // Reinstall global CLI for remainder of the tests. await silentNpm(['install', '--global', '@angular/cli', `--registry=${testRegistry}`]); @@ -439,11 +460,11 @@ async function windowsTests(): Promise { const { stdout } = await execWithEnv('ng', ['config'], { ...env }); - if (AUTOCOMPLETION_PROMPT.test(stdout)) { - throw new Error( - 'Execution prompted to set up autocompletion on Windows despite not actually being' + - ' supported.', - ); - } + assert.doesNotMatch( + stdout, + AUTOCOMPLETION_PROMPT, + 'Execution prompted to set up autocompletion on Windows despite not actually being' + + ' supported.', + ); }); } diff --git a/tests/legacy-cli/e2e/tests/commands/completion/completion-script.ts b/tests/e2e/tests/commands/completion/completion-script.ts similarity index 89% rename from tests/legacy-cli/e2e/tests/commands/completion/completion-script.ts rename to tests/e2e/tests/commands/completion/completion-script.ts index 1b940056d30e..421763478950 100644 --- a/tests/legacy-cli/e2e/tests/commands/completion/completion-script.ts +++ b/tests/e2e/tests/commands/completion/completion-script.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { exec, execAndWaitForOutputToMatch } from '../../../utils/process'; export default async function () { @@ -62,9 +63,9 @@ export default async function () { 'run', 'test-project:build', ); - if (noServeStdout.includes(':serve')) { - throw new Error( - `':serve' should not have been listed as a completion option.\nSTDOUT:\n${noServeStdout}`, - ); - } + assert.doesNotMatch( + noServeStdout, + /:serve/, + `':serve' should not have been listed as a completion option.\nSTDOUT:\n${noServeStdout}`, + ); } diff --git a/tests/legacy-cli/e2e/tests/commands/completion/completion.ts b/tests/e2e/tests/commands/completion/completion.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/completion/completion.ts rename to tests/e2e/tests/commands/completion/completion.ts diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-get.ts b/tests/e2e/tests/commands/config/config-get.ts similarity index 62% rename from tests/legacy-cli/e2e/tests/commands/config/config-get.ts rename to tests/e2e/tests/commands/config/config-get.ts index 51d5f5c7aa1e..d64e0a630af0 100644 --- a/tests/legacy-cli/e2e/tests/commands/config/config-get.ts +++ b/tests/e2e/tests/commands/config/config-get.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { ng } from '../../../utils/process'; import { expectToFail } from '../../../utils/utils'; @@ -5,40 +6,29 @@ export default async function () { await expectToFail(() => ng('config', 'schematics.@schematics/angular.component.inlineStyle')); await ng('config', 'schematics.@schematics/angular.component.inlineStyle', 'false'); const { stdout } = await ng('config', 'schematics.@schematics/angular.component.inlineStyle'); - if (!stdout.match(/false\n?/)) { - throw new Error(`Expected "false", received "${JSON.stringify(stdout)}".`); - } + assert.match(stdout, /false\n?/); await ng('config', 'schematics.@schematics/angular.component.inlineStyle', 'true'); const { stdout: stdout1 } = await ng( 'config', 'schematics.@schematics/angular.component.inlineStyle', ); - if (!stdout1.match(/true\n?/)) { - throw new Error(`Expected "true", received "${JSON.stringify(stdout)}".`); - } + assert.match(stdout1, /true\n?/); await ng('config', 'schematics.@schematics/angular.component.inlineStyle', 'false'); const { stdout: stdout2 } = await ng( 'config', `projects.test-project.architect.build.options.assets[0]`, ); - if (!stdout2.includes('"input": "public"')) { - throw new Error(`Expected "input": "public", received "${JSON.stringify(stdout)}".`); - } + assert.ok(stdout2.includes('"input": "public"')); const { stdout: stdout3 } = await ng( 'config', `projects["test-project"].architect.build.options.assets[0]`, ); - - if (!stdout3.includes('"input": "public"')) { - throw new Error(`Expected "input": "public", received "${JSON.stringify(stdout)}".`); - } + assert.ok(stdout3.includes('"input": "public"')); // should print all config when no positional args are provided. const { stdout: stdout4 } = await ng('config'); - if (!stdout4.includes('$schema')) { - throw new Error(`Expected to contain "$schema", received "${JSON.stringify(stdout)}".`); - } + assert.ok(stdout4.includes('$schema')); } diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-global-validation.ts b/tests/e2e/tests/commands/config/config-global-validation.ts similarity index 52% rename from tests/legacy-cli/e2e/tests/commands/config/config-global-validation.ts rename to tests/e2e/tests/commands/config/config-global-validation.ts index 05ba35ab7e9a..7be29130dca0 100644 --- a/tests/legacy-cli/e2e/tests/commands/config/config-global-validation.ts +++ b/tests/e2e/tests/commands/config/config-global-validation.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { homedir } from 'node:os'; import * as path from 'node:path'; import { deleteFile, expectFileToExist } from '../../../utils/fs'; @@ -8,43 +9,28 @@ export default async function () { let ngError: Error; ngError = await expectToFail(() => silentNg('config', 'cli.completion.prompted', 'true')); - - if ( - !ngError.message.includes('Data path "/cli" must NOT have additional properties(completion).') - ) { - throw new Error('Should have failed with must NOT have additional properties(completion).'); - } + assert.match( + ngError.message, + /Data path "\/cli" must NOT have additional properties\(completion\)\./, + ); ngError = await expectToFail(() => silentNg('config', '--global', 'cli.completion.invalid', 'true'), ); - - if ( - !ngError.message.includes( - 'Data path "/cli/completion" must NOT have additional properties(invalid).', - ) - ) { - throw new Error('Should have failed with must NOT have additional properties(invalid).'); - } + assert.match( + ngError.message, + /Data path "\/cli\/completion" must NOT have additional properties\(invalid\)\./, + ); ngError = await expectToFail(() => silentNg('config', '--global', 'cli.cache.enabled', 'true')); - - if (!ngError.message.includes('Data path "/cli" must NOT have additional properties(cache).')) { - throw new Error('Should have failed with must NOT have additional properties(cache).'); - } + assert.match(ngError.message, /Data path "\/cli" must NOT have additional properties\(cache\)\./); ngError = await expectToFail(() => silentNg('config', 'cli.completion.prompted')); - - if (!ngError.message.includes('Value cannot be found.')) { - throw new Error('Should have failed with Value cannot be found.'); - } + assert.match(ngError.message, /Value cannot be found\./); await ng('config', '--global', 'cli.completion.prompted', 'true'); const { stdout } = await silentNg('config', '--global', 'cli.completion.prompted'); - - if (!stdout.includes('true')) { - throw new Error(`Expected "true", received "${JSON.stringify(stdout)}".`); - } + assert.match(stdout, /true/); await expectFileToExist(path.join(homedir(), '.angular-config.json')); await deleteFile(path.join(homedir(), '.angular-config.json')); diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-global.ts b/tests/e2e/tests/commands/config/config-global.ts similarity index 84% rename from tests/legacy-cli/e2e/tests/commands/config/config-global.ts rename to tests/e2e/tests/commands/config/config-global.ts index 77f276b04146..030d4b583d2c 100644 --- a/tests/legacy-cli/e2e/tests/commands/config/config-global.ts +++ b/tests/e2e/tests/commands/config/config-global.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { homedir } from 'node:os'; import * as path from 'node:path'; import { deleteFile, expectFileToExist } from '../../../utils/fs'; @@ -15,9 +16,7 @@ export default async function () { '--global', 'schematics.@schematics/angular.component.inlineStyle', ); - if (!output.stdout.match(/false\n?/)) { - throw new Error(`Expected "false", received "${JSON.stringify(output.stdout)}".`); - } + assert.match(output.stdout, /false\n?/); // This test requires schema querying capabilities // .then(() => expectToFail(() => { @@ -33,9 +32,7 @@ export default async function () { } output = await ng('config', '--global', 'schematics.@schematics/angular.component.inlineStyle'); - if (!output.stdout.match(/true\n?/)) { - throw new Error(`Expected "true", received "${JSON.stringify(output.stdout)}".`); - } + assert.match(output.stdout, /true\n?/); await expectToFail(() => ng('config', '--global', 'cli.warnings.notreal', 'true')); diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-set-enum-check.ts b/tests/e2e/tests/commands/config/config-set-enum-check.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/config/config-set-enum-check.ts rename to tests/e2e/tests/commands/config/config-set-enum-check.ts diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-set-prefix.ts b/tests/e2e/tests/commands/config/config-set-prefix.ts similarity index 77% rename from tests/legacy-cli/e2e/tests/commands/config/config-set-prefix.ts rename to tests/e2e/tests/commands/config/config-set-prefix.ts index 09c3afea9f7f..40f22699baed 100644 --- a/tests/legacy-cli/e2e/tests/commands/config/config-set-prefix.ts +++ b/tests/e2e/tests/commands/config/config-set-prefix.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { ng } from '../../../utils/process'; import { expectToFail } from '../../../utils/utils'; @@ -7,8 +8,6 @@ export default function () { .then(() => ng('config', 'schematics.@schematics/angular.component.prefix', 'new-prefix')) .then(() => ng('config', 'schematics.@schematics/angular.component.prefix')) .then(({ stdout }) => { - if (!stdout.match(/new-prefix/)) { - throw new Error(`Expected "new-prefix", received "${JSON.stringify(stdout)}".`); - } + assert.match(stdout, /new-prefix/); }); } diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-set-serve-port.ts b/tests/e2e/tests/commands/config/config-set-serve-port.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/config/config-set-serve-port.ts rename to tests/e2e/tests/commands/config/config-set-serve-port.ts diff --git a/tests/legacy-cli/e2e/tests/commands/config/config-set.ts b/tests/e2e/tests/commands/config/config-set.ts similarity index 56% rename from tests/legacy-cli/e2e/tests/commands/config/config-set.ts rename to tests/e2e/tests/commands/config/config-set.ts index 689be8c72194..2152e573132e 100644 --- a/tests/legacy-cli/e2e/tests/commands/config/config-set.ts +++ b/tests/e2e/tests/commands/config/config-set.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { ng, silentNg } from '../../../utils/process'; import { expectToFail } from '../../../utils/utils'; @@ -5,36 +6,25 @@ export default async function () { let ngError: Error; ngError = await expectToFail(() => silentNg('config', 'cli.warnings.zzzz', 'true')); - if ( - !ngError.message.includes( - 'Data path "/cli/warnings" must NOT have additional properties(zzzz).', - ) - ) { - throw new Error('Should have failed with must NOT have additional properties(zzzz).'); - } + assert.match( + ngError.message, + /Data path "\/cli\/warnings" must NOT have additional properties\(zzzz\)\./, + ); ngError = await expectToFail(() => silentNg('config', 'cli.warnings.zzzz')); - if (!ngError.message.includes('Value cannot be found.')) { - throw new Error('Should have failed with Value cannot be found.'); - } + assert.match(ngError.message, /Value cannot be found\./); await ng('config', 'cli.warnings.versionMismatch', 'false'); const { stdout } = await ng('config', 'cli.warnings.versionMismatch'); - if (!stdout.includes('false')) { - throw new Error(`Expected "false", received "${JSON.stringify(stdout)}".`); - } + assert.match(stdout, /false/); await ng('config', 'cli.packageManager', 'yarn'); const { stdout: stdout2 } = await ng('config', 'cli.packageManager'); - if (!stdout2.includes('yarn')) { - throw new Error(`Expected "yarn", received "${JSON.stringify(stdout2)}".`); - } + assert.match(stdout2, /yarn/); await ng('config', 'schematics', '{"@schematics/angular:component":{"style": "scss"}}'); const { stdout: stdout3 } = await ng('config', 'schematics.@schematics/angular:component.style'); - if (!stdout3.includes('scss')) { - throw new Error(`Expected "scss", received "${JSON.stringify(stdout3)}".`); - } + assert.match(stdout3, /scss/); await ng('config', 'schematics'); await ng('config', 'schematics', 'undefined'); diff --git a/tests/e2e/tests/commands/help/help-hidden.ts b/tests/e2e/tests/commands/help/help-hidden.ts new file mode 100644 index 000000000000..bd972d26a942 --- /dev/null +++ b/tests/e2e/tests/commands/help/help-hidden.ts @@ -0,0 +1,14 @@ +import assert from 'node:assert/strict'; +import { silentNg } from '../../../utils/process'; + +export default async function () { + const { stdout: stdoutNew } = await silentNg('--help'); + assert.doesNotMatch( + stdoutNew, + /(easter-egg)|(ng make-this-awesome)|(ng init)/, + 'Expected to not match "(easter-egg)|(ng make-this-awesome)|(ng init)" in help output.', + ); + + const { stdout: ngGenerate } = await silentNg('--help', 'generate', 'component'); + assert.doesNotMatch(ngGenerate, /--path/, 'Expected to not match "--path" in help output.'); +} diff --git a/tests/legacy-cli/e2e/tests/commands/help/help-json.ts b/tests/e2e/tests/commands/help/help-json.ts similarity index 78% rename from tests/legacy-cli/e2e/tests/commands/help/help-json.ts rename to tests/e2e/tests/commands/help/help-json.ts index 97ed468df942..6f1b8e89db49 100644 --- a/tests/legacy-cli/e2e/tests/commands/help/help-json.ts +++ b/tests/e2e/tests/commands/help/help-json.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { silentNg } from '../../../utils/process'; export default async function () { @@ -42,31 +43,21 @@ export default async function () { const { stdout } = await silentNg('config', '--help', '--json-help'); const output = JSON.stringify(JSON.parse(stdout.trim())); - if (output !== addHelpOutputSnapshot) { - throw new Error( - `ng config JSON help output didn\'t match snapshot.\n\nExpected "${output}" to be "${addHelpOutputSnapshot}".`, - ); - } + assert.strictEqual( + output, + addHelpOutputSnapshot, + `ng config JSON help output didn\'t match snapshot.`, + ); const { stdout: stdout2 } = await silentNg('--help', '--json-help'); - try { - JSON.parse(stdout2.trim()); - } catch (error) { - throw new Error( - `'ng --help ---json-help' failed to return JSON.\n${ - error instanceof Error ? error.message : error - }`, - ); - } + assert.doesNotThrow( + () => JSON.parse(stdout2.trim()), + `'ng --help ---json-help' failed to return JSON.`, + ); const { stdout: stdout3 } = await silentNg('generate', '--help', '--json-help'); - try { - JSON.parse(stdout3.trim()); - } catch (error) { - throw new Error( - `'ng generate --help ---json-help' failed to return JSON.\n${ - error instanceof Error ? error.message : error - }`, - ); - } + assert.doesNotThrow( + () => JSON.parse(stdout3.trim()), + `'ng generate --help ---json-help' failed to return JSON.`, + ); } diff --git a/tests/legacy-cli/e2e/tests/commands/ng-new-collection.ts b/tests/e2e/tests/commands/ng-new-collection.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/ng-new-collection.ts rename to tests/e2e/tests/commands/ng-new-collection.ts diff --git a/tests/legacy-cli/e2e/tests/commands/project-cannot-be-determined-by-cwd.ts b/tests/e2e/tests/commands/project-cannot-be-determined-by-cwd.ts similarity index 91% rename from tests/legacy-cli/e2e/tests/commands/project-cannot-be-determined-by-cwd.ts rename to tests/e2e/tests/commands/project-cannot-be-determined-by-cwd.ts index 5f63a5ff0467..b4b572bfa3ee 100644 --- a/tests/legacy-cli/e2e/tests/commands/project-cannot-be-determined-by-cwd.ts +++ b/tests/e2e/tests/commands/project-cannot-be-determined-by-cwd.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { join } from 'node:path'; import { execAndWaitForOutputToMatch, ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; @@ -20,9 +21,7 @@ export default async function () { try { const { message } = await expectToFail(() => ng('build')); - if (!message.includes(errorMessage)) { - throw new Error(`Expected build to fail with: '${errorMessage}'.`); - } + assert.match(message, new RegExp(errorMessage)); // Help should still work await execAndWaitForOutputToMatch('ng', ['build', '--help'], /--configuration/); diff --git a/tests/legacy-cli/e2e/tests/commands/run-configuration-option.ts b/tests/e2e/tests/commands/run-configuration-option.ts similarity index 65% rename from tests/legacy-cli/e2e/tests/commands/run-configuration-option.ts rename to tests/e2e/tests/commands/run-configuration-option.ts index 827d8dea6fc9..ab2761dce531 100644 --- a/tests/legacy-cli/e2e/tests/commands/run-configuration-option.ts +++ b/tests/e2e/tests/commands/run-configuration-option.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { silentNg } from '../../utils/process'; import { expectToFail } from '../../utils/utils'; @@ -9,9 +10,7 @@ export default async function () { silentNg('run', 'test-project:build:development', '--configuration=production'), ); - if (!message.includes(errorMatch)) { - throw new Error(`Expected error to include '${errorMatch}' but didn't.\n\n${message}`); - } + assert.ok(message.includes(errorMatch)); } { @@ -19,8 +18,6 @@ export default async function () { silentNg('run', 'test-project:build', '--configuration=production'), ); - if (!message.includes(errorMatch)) { - throw new Error(`Expected error to include '${errorMatch}' but didn't.\n\n${message}`); - } + assert.ok(message.includes(errorMatch)); } } diff --git a/tests/legacy-cli/e2e/tests/commands/serve/assets.ts b/tests/e2e/tests/commands/serve/assets.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/serve/assets.ts rename to tests/e2e/tests/commands/serve/assets.ts diff --git a/tests/legacy-cli/e2e/tests/commands/serve/head-request.ts b/tests/e2e/tests/commands/serve/head-request.ts similarity index 70% rename from tests/legacy-cli/e2e/tests/commands/serve/head-request.ts rename to tests/e2e/tests/commands/serve/head-request.ts index 82ba370a0743..ed2c2dcd1267 100644 --- a/tests/legacy-cli/e2e/tests/commands/serve/head-request.ts +++ b/tests/e2e/tests/commands/serve/head-request.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { ngServe } from '../../../utils/project'; export default async function () { @@ -16,10 +17,10 @@ async function checkHeadForUrl(url: string): Promise { const result = await fetch(url, { method: 'HEAD' }); const content = await result.blob(); - if (content.size !== 0) { - throw new Error(`Expected "size" to be "0" but got "${content.size}".`); - } - if (result.status !== 200) { - throw new Error(`Expected "status" to be "200" but got "${result.status}".`); - } + assert.strictEqual(content.size, 0, `Expected "size" to be "0" but got "${content.size}".`); + assert.strictEqual( + result.status, + 200, + `Expected "status" to be "200" but got "${result.status}".`, + ); } diff --git a/tests/e2e/tests/commands/serve/preflight-request.ts b/tests/e2e/tests/commands/serve/preflight-request.ts new file mode 100644 index 000000000000..02a763dce197 --- /dev/null +++ b/tests/e2e/tests/commands/serve/preflight-request.ts @@ -0,0 +1,15 @@ +import assert from 'node:assert/strict'; +import { ngServe } from '../../../utils/project'; + +export default async function () { + const port = await ngServe(); + const result = await fetch(`http://localhost:${port}/main.js`, { method: 'OPTIONS' }); + const content = await result.blob(); + + assert.strictEqual(content.size, 0, `Expected "size" to be "0" but got "${content.size}".`); + assert.strictEqual( + result.status, + 204, + `Expected "status" to be "204" but got "${result.status}".`, + ); +} diff --git a/tests/legacy-cli/e2e/tests/commands/serve/reload-shims.ts b/tests/e2e/tests/commands/serve/reload-shims.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/serve/reload-shims.ts rename to tests/e2e/tests/commands/serve/reload-shims.ts diff --git a/tests/legacy-cli/e2e/tests/commands/serve/serve-path.ts b/tests/e2e/tests/commands/serve/serve-path.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/serve/serve-path.ts rename to tests/e2e/tests/commands/serve/serve-path.ts diff --git a/tests/e2e/tests/commands/serve/ssr-http-requests-assets.ts b/tests/e2e/tests/commands/serve/ssr-http-requests-assets.ts new file mode 100644 index 000000000000..19f1208646d6 --- /dev/null +++ b/tests/e2e/tests/commands/serve/ssr-http-requests-assets.ts @@ -0,0 +1,190 @@ +import assert from 'node:assert'; +import { Agent } from 'undici'; +import { killAllProcesses, ng } from '../../../utils/process'; +import { writeMultipleFiles } from '../../../utils/fs'; +import { installWorkspacePackages, uninstallPackage } from '../../../utils/packages'; +import { ngServe, useSha } from '../../../utils/project'; + +export default async function () { + await uninstallPackage('@angular/ssr'); + await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); + await useSha(); + await installWorkspacePackages(); + + await writeMultipleFiles({ + // Add http client and route + 'src/app/app.config.ts': ` + import { ApplicationConfig } from '@angular/core'; + import { provideRouter } from '@angular/router'; + + import { Home } from './home/home'; + import { provideClientHydration } from '@angular/platform-browser'; + import { provideHttpClient, withFetch } from '@angular/common/http'; + + export const appConfig: ApplicationConfig = { + providers: [ + provideRouter([{ + path: '', + component: Home, + }]), + provideClientHydration(), + provideHttpClient(withFetch()), + ], + }; + `, + // Add asset + 'public/media.json': JSON.stringify({ dataFromAssets: true }), + // Update component to do an HTTP call to asset. + 'src/app/app.ts': ` + import { ChangeDetectorRef, Component, inject } from '@angular/core'; + import { CommonModule } from '@angular/common'; + import { RouterOutlet } from '@angular/router'; + import { HttpClient } from '@angular/common/http'; + + @Component({ + selector: 'app-root', + imports: [CommonModule, RouterOutlet], + template: \` +

{{ data | json }}

+ + \`, + }) + export class App { + data: any; + private readonly cdr: ChangeDetectorRef = inject(ChangeDetectorRef); + + constructor() { + const http = inject(HttpClient); + http.get('/media.json').toPromise().then((d) => { + this.data = d; + this.cdr.markForCheck(); + }); + } + } + `, + }); + + await ng('generate', 'component', 'home'); + const match = /

{[\S\s]*"dataFromAssets":[\s\S]*true[\S\s]*}<\/p>/; + const port = await ngServe('--no-ssl'); + assert.match(await (await fetch(`http://localhost:${port}/`)).text(), match); + + await killAllProcesses(); + + const sslPort = await ngServe('--ssl'); + assert.match( + await ( + await fetch(`https://localhost:${sslPort}/`, { + dispatcher: new Agent({ + connect: { + rejectUnauthorized: false, + }, + }), + }) + ).text(), + match, + ); + + await killAllProcesses(); + + // With OpenSSl cert+key + writeMultipleFiles({ + 'server.key': `-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDOyBmVy61zEqfs +oTPQ9gTX233/nlrVXtaUGJkbDR5actq0X+XQtZuIoO4JgRpiYz5/8XiY8AiaMdt3 +0abugO5AhyIbsGyQxvz2si7yKQ+WUdF/DRTpfTq76E8EXR8W9BI+DTpG/1nNGBd1 +lpMa8NMfHqLvhtpebHuBcb1BCRely+FILHVDGf+dfCIvR0Zvt8Ah3qLL6vvX3pzF +qM9XrXfUgWKqpbz+L1BeCPILsH+UaOOCzzbyrLoY6fnawjUkc/ieHWycro7dBUlu +JJ/kcGtpPYD/hsMFcXz6D67qbIFuc6Dz9CrWIagAFMqK91FAtUpyfP7+jLikQOST +pFDLgJ+klADGCiZ6C/dvjUsYM+4ML9dX6Q9rj6sQo/oj0Dsdj39J5mVmklkbRP5q +heMGTyc09/ambiYFfzWEMMnEcCT/CS/r1q93oRDG02Cx6F1B05mtR+/AFxAJ6UxL +2u3oMPVY179FWjx2+YvbfrdNrFnWb8eRMiRZIW8O8ptKkrh+LL1Rhep+W/1Nxdrp +g7E2rWP8AWr3mdd+cnauvF/2yMecBDLVnk3OOSjcuLc+i9ngOD0xHdcRfO89mryj +IewEIrUQ4U0ZgyHMi99qV4wyXhd9HzTUgT01QofsiuF9xyVfnansQOj3oqOgCS92 +VEeqZnLXgaVoh/++/FV7r4C5zxLzLwIDAQABAoICAAeKSqD98iE3o5qc6AAiqj79 +r8L2dJ+0F9cDF4Bh6aLFYBGUoS/Sr38Cm7m0/3qiiEKvbpM9/0QVfHLRoBNcJnBk +0mrp1yD1tfEOUPcJ12D/3XJ2zlIv+7oUn97Ia9h4NCzBv5zw7lTsrjHenDMSZ7XD +PR6qb064XfiRETKFeCJk64Godj/3QkmX2FApCMDwXJttynLQseK5RZnDHojhuDuR +vgfC+aOCTit8GOkxi1Hdppxm8tmMwfqyJmAJh5IdKkNA3MHtbyPCxSXRRIUdwMXT +bhhVCh9/W3prv/vEYSPfRGs9WdtrTBj/U8GlgGlxa87h1i/i8N4I5RP+8lic6zVL +BIIPamkRFRNUmV7ZzpWsrLl1TUUcQJ1UsjNqaLD7jl+l0IaUta8I9crJQWIuQu+G +5C0XJQPZrqGkZfLSMvi08S+8myCzf+3P3ayUHAKz4Q1pTeM2BbHQi1HbT+WUsA5G +DD4xBwc8VJXOy0dB4v4e5eK8aZaJZroR5LJT7bvKw1MNpyAt6w2Z17eSSuEE0x6u +4uzOfHRaWiKH9gXVSKyo8xM08wiKAJIpDg4fDsu/XPjfPzV3eSHwin6ADw7rcOrW +j4Ca43Ts7Fz0Y40dtUyrrQ3f7WSQ9C+M88NuI9WYPWmXqPQY9+b5Au0Q8rq1j3dW +1YB3vYd6ElaLI6k7c5OhAoIBAQDt+Dgi2jrx2Xol0Per/cIFyG/hX/h+tavj++xl +gIMLLwhFmBVIkkXHjG5v5rZFCY7giQgdy+JHAIDUg3Ae3K7zSYidkMwQzLJ9udaT +nJEybY4RlEJZVBs58pkjevqTD/pZ+Kj09/VLAJIhOInFQHQ+ZVn4uHF+NO4tcsH+ +Wtsyyf8tFMkoNQ38o2oTnJtsotssKGdXCgi36BCCCUQk98113RK9dBTi+2iB59qr +WczAb6Jl5cs1j/2IC3z9KilZ3/ww4Bshs5LThIGR66KZIfApzf8XQzHM9mhiLgRU +thUZ0a/ougqf4FovLAezsNM7kYqbPDPOh/CayN5KZ8pHNLt1AoIBAQDecvFejv3u +Lm9kf2xRv06HTsLeEUSgRVoWdKidwW3tXOkl8vuBTzeFl9yrgtMBbSgcFASbEKPP +uPc6g+zkcakUB+FLGGNwNFKhdGPUMI7u8i9WeWH+e3Aios7n0tCPP0Xv6d1Lhcyw +X1nz07hZ+sT40nLGyf/6vfg8LFGSBrr3YQLseodKGTC9jc5yJqEX16cqHppkwaJT +Elsona7PZGFm/WFGWn4wZiPpd9P5lnxP+KrI+m84z4Gw5txcJsE8WiUrrQYHG3+2 +yeztwYl+JGHcspsU4WTPCupyVRHt0uuGVN+UhLKgER8wghc6fL08jGkHgVLrStnN +ekRA0gEZRzOTAoIBAGuQMheW2uPssGidfwXP6r5gbinKDnF/vpWLjrwGjbUlajDC +4IPwEfhzwot0Flk4S8u0ROXq/XmogZMNYkWg7LdtOoI2K/c//0ITGSmZsIvBt2C8 +ygzElpXn0U6XTOHia//1BLHNzqM7O9ImUyfEzYZSm4twG2S3mh0S7RsCiGf5pA0F +gzNYX90dJFp/BEXjivv3u1Y9Y9l03NlaROIM3GL1LX5TFQnQJ9noKhAfxAwLqbUz +XFn2ntu6jaGFSDGmq8CP29Os7qYLE+IYR2O+UmcjBLXIGp+RlXcjY7PCpeEIxeGF +Dj5b04fU+BpByAj57VPjr2sgSSI9vzSUm3r6G+0CggEBALK7JgZ028BxHN1hqHWy +QXVkKhxlQX+I2Y5rY0OFtD5gRZBRQBUwwgqb7xj7P3DI9M5Co0S4RPZUxogEkeUn +EdPfVPySdusjjzTcoI1QCrggbTqMwtjG811Q9O+9Kge+rgHLJRxWQBWCN3M6rMfX +PkYySThB+2PLGVW3wj6TG8xB7Sh2dpdp0AitlK+RLCRNCKpF9oV4M2WNvSLQNzG5 +lK08btkpQnS+zKH8vpuudumGgiqDVbQOvkSV6X49QUutnmoOVmaFiMMkUTLjKwbo +Up0SAJrxUp8sRR1iDsrIiqbfMNlTGXaU6zt9ew5qRV4N7yGxnh8hgAih8Y8nbOyT +kfMCggEBAMVOGy7yzaMQvVSkcFkUAnznI7RwvhUWusomfyaVgHm+j3Y7OPius1ah +4Da3kvb4t8OFUIdnMz/rte8xRKE6lKLNmXG9+8nPkCdrB9ovDr0Pw3ONZ7kKHuhm +75IKV72f3krZK5jJ88p/ruUUotButZb+WlGW5qQOJEJnHi65ABGYchAADAOBflXK +XbklHb6sVmEx6Ds4OMAbEmgH4C7BZuvmVeYMY7ihGIuBF3rE70rc2meQl/fxn0Gd ++/FrHDqCSkXwNT69HEOoLT/hi6Pc3kyn1bFOK+W8AydilI+6yOKkiYTSoCAO/yi/ +xlFXnn9FIQthAEWUhFgqApO+oKBn0hw= +-----END PRIVATE KEY----- +`, + 'server.crt': `-----BEGIN CERTIFICATE----- +MIIFCTCCAvGgAwIBAgIUd0CiuFYYUTnnfB/Q6lijpEZJy4wwDQYJKoZIhvcNAQEL +BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI1MTEwNzEwMTE0NFoXDTI2MTEw +NzEwMTE0NFowFDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEAzsgZlcutcxKn7KEz0PYE19t9/55a1V7WlBiZGw0eWnLa +tF/l0LWbiKDuCYEaYmM+f/F4mPAImjHbd9Gm7oDuQIciG7BskMb89rIu8ikPllHR +fw0U6X06u+hPBF0fFvQSPg06Rv9ZzRgXdZaTGvDTHx6i74baXmx7gXG9QQkXpcvh +SCx1Qxn/nXwiL0dGb7fAId6iy+r7196cxajPV6131IFiqqW8/i9QXgjyC7B/lGjj +gs828qy6GOn52sI1JHP4nh1snK6O3QVJbiSf5HBraT2A/4bDBXF8+g+u6myBbnOg +8/Qq1iGoABTKivdRQLVKcnz+/oy4pEDkk6RQy4CfpJQAxgomegv3b41LGDPuDC/X +V+kPa4+rEKP6I9A7HY9/SeZlZpJZG0T+aoXjBk8nNPf2pm4mBX81hDDJxHAk/wkv +69avd6EQxtNgsehdQdOZrUfvwBcQCelMS9rt6DD1WNe/RVo8dvmL2363TaxZ1m/H +kTIkWSFvDvKbSpK4fiy9UYXqflv9TcXa6YOxNq1j/AFq95nXfnJ2rrxf9sjHnAQy +1Z5Nzjko3Li3PovZ4Dg9MR3XEXzvPZq8oyHsBCK1EOFNGYMhzIvfaleMMl4XfR80 +1IE9NUKH7IrhfcclX52p7EDo96KjoAkvdlRHqmZy14GlaIf/vvxVe6+Auc8S8y8C +AwEAAaNTMFEwHQYDVR0OBBYEFCOiC0xvMbfCFzmseoMDht+ydKBbMB8GA1UdIwQY +MBaAFCOiC0xvMbfCFzmseoMDht+ydKBbMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggIBAJSiQwcaGVhwUorkb062cyyZOAstEJ5meg6H2g3nL894oWEU +FLc/S20z2tqO1It4rZB3cRKmB0RvH78eh4aUPAh0lPa/bm/h7WrgdEAJUmlNuZV3 +Hitd/c1d2OVzx6w+CFYd/G5GW3sWblYiH0paIN6s4TqHFY/IAzzZKQB7Ud7FJagM +KMkEP8RFDm7iRcENuSf51LtZb2NjN1TM5CK5sVXu62dvPYZC6SW052/qd1U+1Tyw +EX4fCqUgEoGoU6+Ftz3hCdVy3E4uzFBK1e5wmct6HULBZL51PWpf3BgwneZy0itE +lD6Y0H6m/9KMVcXpAHZK+6YnOOcWxIgfjykjZEO99rx3pVWPw1uSBUJEu1SLknAn +JDe+WLp+xmB8s62EjixZsEGqoQYYrtZ3vz8u4PSSgYPJjdAkFdLOPitf0U8ZW9/7 +hGyHgqd7WQ3toBwwdnPo6fZqHHyN8rXeWcmx8Uj9oyY1uunkSmq3csITPQg/zKBO +6RsO3pPj8mHjeAZCDs+Ks68ccPsn+53fJ9CrjiJlHFIP0ywbEBO1snJDit5q3gQI +/UpClB9Sl+mz4wznOvrKycrxrLEptZeBA5c6M9Qr30YJAb/prxvzSY5FrUGcstkO +CQVzSwZEUXxSo6K4cJ55vC0p3P3aoMvEpHfM+JqL3lCM9qWrxfkhvn8YS+Gg +-----END CERTIFICATE----- +`, + }); + + const sslPortForCerts = await ngServe('--ssl', '--ssl-cert=server.crt', '--ssl-key="server.key"'); + assert.match( + await ( + await fetch(`https://localhost:${sslPortForCerts}/`, { + dispatcher: new Agent({ + connect: { + rejectUnauthorized: false, + }, + }), + }) + ).text(), + match, + ); +} diff --git a/tests/legacy-cli/e2e/tests/commands/unknown-configuration.ts b/tests/e2e/tests/commands/unknown-configuration.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/unknown-configuration.ts rename to tests/e2e/tests/commands/unknown-configuration.ts diff --git a/tests/legacy-cli/e2e/tests/commands/unknown-option.ts b/tests/e2e/tests/commands/unknown-option.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/commands/unknown-option.ts rename to tests/e2e/tests/commands/unknown-option.ts diff --git a/tests/e2e/tests/generate/application/application-no-zoneless-ng-module.ts b/tests/e2e/tests/generate/application/application-no-zoneless-ng-module.ts new file mode 100644 index 000000000000..b475ed03b3a7 --- /dev/null +++ b/tests/e2e/tests/generate/application/application-no-zoneless-ng-module.ts @@ -0,0 +1,16 @@ +import { installWorkspacePackages, uninstallPackage } from '../../../utils/packages'; +import { ng } from '../../../utils/process'; +import { useCIChrome, useSha } from '../../../utils/project'; + +export default async function () { + try { + await ng('generate', 'app', 'ngmodules', '--no-standalone', '--skip-install', '--no-zoneless'); + await useSha(); + await installWorkspacePackages(); + await useCIChrome('ngmodules', 'projects/ngmodules'); + await ng('test', 'ngmodules', '--watch=false'); + await ng('build', 'ngmodules'); + } finally { + await uninstallPackage('zone.js'); + } +} diff --git a/tests/e2e/tests/generate/application/application-no-zoneless-standalone.ts b/tests/e2e/tests/generate/application/application-no-zoneless-standalone.ts new file mode 100644 index 000000000000..065957f9fe11 --- /dev/null +++ b/tests/e2e/tests/generate/application/application-no-zoneless-standalone.ts @@ -0,0 +1,16 @@ +import { installWorkspacePackages, uninstallPackage } from '../../../utils/packages'; +import { ng } from '../../../utils/process'; +import { useCIChrome, useSha } from '../../../utils/project'; + +export default async function () { + try { + await ng('generate', 'app', 'standalone', '--standalone', '--skip-install', '--no-zoneless'); + await useSha(); + await installWorkspacePackages(); + await useCIChrome('standalone', 'projects/standalone'); + await ng('test', 'standalone', '--watch=false'); + await ng('build', 'standalone'); + } finally { + await uninstallPackage('zone.js'); + } +} diff --git a/tests/e2e/tests/generate/application/application-zoneless-ng-module.ts b/tests/e2e/tests/generate/application/application-zoneless-ng-module.ts new file mode 100644 index 000000000000..5ad207a2fa76 --- /dev/null +++ b/tests/e2e/tests/generate/application/application-zoneless-ng-module.ts @@ -0,0 +1,12 @@ +import { installWorkspacePackages } from '../../../utils/packages'; +import { ng } from '../../../utils/process'; +import { useCIChrome, useSha } from '../../../utils/project'; + +export default async function () { + await ng('generate', 'app', 'ngmodules', '--no-standalone', '--skip-install'); + await useSha(); + await installWorkspacePackages(); + await useCIChrome('ngmodules', 'projects/ngmodules'); + await ng('test', 'ngmodules', '--watch=false'); + await ng('build', 'ngmodules'); +} diff --git a/tests/e2e/tests/generate/application/application-zoneless-standalone.ts b/tests/e2e/tests/generate/application/application-zoneless-standalone.ts new file mode 100644 index 000000000000..b203ed4a28d0 --- /dev/null +++ b/tests/e2e/tests/generate/application/application-zoneless-standalone.ts @@ -0,0 +1,12 @@ +import { installWorkspacePackages } from '../../../utils/packages'; +import { ng } from '../../../utils/process'; +import { useCIChrome, useSha } from '../../../utils/project'; + +export default async function () { + await ng('generate', 'app', 'standalone', '--standalone', '--skip-install'); + await useSha(); + await installWorkspacePackages(); + await useCIChrome('standalone', 'projects/standalone'); + await ng('test', 'standalone', '--watch=false'); + await ng('build', 'standalone'); +} diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-basic.ts b/tests/e2e/tests/generate/component/component-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-basic.ts rename to tests/e2e/tests/generate/component/component-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-child-dir.ts b/tests/e2e/tests/generate/component/component-child-dir.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-child-dir.ts rename to tests/e2e/tests/generate/component/component-child-dir.ts diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-flat.ts b/tests/e2e/tests/generate/component/component-flat.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-flat.ts rename to tests/e2e/tests/generate/component/component-flat.ts diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-inline-template.ts b/tests/e2e/tests/generate/component/component-inline-template.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-inline-template.ts rename to tests/e2e/tests/generate/component/component-inline-template.ts diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-not-flat.ts b/tests/e2e/tests/generate/component/component-not-flat.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-not-flat.ts rename to tests/e2e/tests/generate/component/component-not-flat.ts diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-path-case.ts b/tests/e2e/tests/generate/component/component-path-case.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-path-case.ts rename to tests/e2e/tests/generate/component/component-path-case.ts diff --git a/tests/legacy-cli/e2e/tests/generate/component/component-prefix.ts b/tests/e2e/tests/generate/component/component-prefix.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/component/component-prefix.ts rename to tests/e2e/tests/generate/component/component-prefix.ts diff --git a/tests/legacy-cli/e2e/tests/generate/config/type-browserslist.ts b/tests/e2e/tests/generate/config/type-browserslist.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/config/type-browserslist.ts rename to tests/e2e/tests/generate/config/type-browserslist.ts diff --git a/tests/legacy-cli/e2e/tests/generate/config/type-karma.ts b/tests/e2e/tests/generate/config/type-karma.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/config/type-karma.ts rename to tests/e2e/tests/generate/config/type-karma.ts diff --git a/tests/legacy-cli/e2e/tests/generate/directive/directive-basic.ts b/tests/e2e/tests/generate/directive/directive-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/directive/directive-basic.ts rename to tests/e2e/tests/generate/directive/directive-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/directive/directive-prefix.ts b/tests/e2e/tests/generate/directive/directive-prefix.ts similarity index 93% rename from tests/legacy-cli/e2e/tests/generate/directive/directive-prefix.ts rename to tests/e2e/tests/generate/directive/directive-prefix.ts index b0a95ce399cb..a8b5981b34a3 100644 --- a/tests/legacy-cli/e2e/tests/generate/directive/directive-prefix.ts +++ b/tests/e2e/tests/generate/directive/directive-prefix.ts @@ -17,7 +17,9 @@ export default function () { ) .then(() => ng('generate', 'directive', 'test2-directive')) .then(() => expectFileToMatch(join(directiveDir, 'test2-directive.ts'), /selector: '\[preW/)) - .then(() => ng('generate', 'application', 'app-two', '--skip-install')) + .then(() => + ng('generate', 'application', 'app-two', '--skip-install', '--test-runner', 'karma'), + ) .then(() => useCIDefaults('app-two')) .then(() => useCIChrome('app-two', './projects/app-two')) .then(() => diff --git a/tests/legacy-cli/e2e/tests/generate/generate-error.ts b/tests/e2e/tests/generate/generate-error.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/generate-error.ts rename to tests/e2e/tests/generate/generate-error.ts diff --git a/tests/legacy-cli/e2e/tests/generate/generate-name-check.ts b/tests/e2e/tests/generate/generate-name-check.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/generate-name-check.ts rename to tests/e2e/tests/generate/generate-name-check.ts diff --git a/tests/legacy-cli/e2e/tests/generate/guard/guard-basic.ts b/tests/e2e/tests/generate/guard/guard-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/guard/guard-basic.ts rename to tests/e2e/tests/generate/guard/guard-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/guard/guard-implements.ts b/tests/e2e/tests/generate/guard/guard-implements.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/guard/guard-implements.ts rename to tests/e2e/tests/generate/guard/guard-implements.ts diff --git a/tests/legacy-cli/e2e/tests/generate/guard/guard-multiple-implements.ts b/tests/e2e/tests/generate/guard/guard-multiple-implements.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/guard/guard-multiple-implements.ts rename to tests/e2e/tests/generate/guard/guard-multiple-implements.ts diff --git a/tests/e2e/tests/generate/help-output-no-duplicates.ts b/tests/e2e/tests/generate/help-output-no-duplicates.ts new file mode 100644 index 000000000000..0be6ea93ea48 --- /dev/null +++ b/tests/e2e/tests/generate/help-output-no-duplicates.ts @@ -0,0 +1,15 @@ +import assert from 'node:assert/strict'; +import { ng } from '../../utils/process'; + +export default async function () { + // Verify that there are no duplicate options + const { stdout } = await ng('generate', 'component', '--help'); + const firstIndex = stdout.indexOf('--prefix'); + + assert.ok(firstIndex >= 0, '--prefix was not part of the help output.'); + assert.strictEqual( + firstIndex, + stdout.lastIndexOf('--prefix'), + '--prefix first and last index were different. Possible duplicate output!', + ); +} diff --git a/tests/legacy-cli/e2e/tests/generate/help-output.ts b/tests/e2e/tests/generate/help-output.ts similarity index 78% rename from tests/legacy-cli/e2e/tests/generate/help-output.ts rename to tests/e2e/tests/generate/help-output.ts index 9495bfa200a6..86fc3b988b38 100644 --- a/tests/legacy-cli/e2e/tests/generate/help-output.ts +++ b/tests/e2e/tests/generate/help-output.ts @@ -1,6 +1,7 @@ +import assert from 'node:assert/strict'; import { join } from 'node:path'; -import { ng, ProcessOutput } from '../../utils/process'; -import { writeMultipleFiles, createDir } from '../../utils/fs'; +import { createDir, writeMultipleFiles } from '../../utils/fs'; +import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; export default function () { @@ -75,12 +76,8 @@ export default function () { ) .then(() => ng('generate', 'fake-schematics:fake', '--help')) .then(({ stdout }) => { - if (!/ng generate fake-schematics:fake \[b\]/.test(stdout)) { - throw new Error('Help signature is wrong (1).'); - } - if (!/opt-a[\s\S]*opt-b[\s\S]*opt-c/.test(stdout)) { - throw new Error('Help signature options are incorrect.'); - } + assert.match(stdout, /ng generate fake-schematics:fake \[b\]/); + assert.match(stdout, /opt-a[\s\S]*opt-b[\s\S]*opt-c/); }) // set up default collection. .then(() => @@ -92,12 +89,8 @@ export default function () { .then(() => ng('generate', 'fake', '--help')) // verify same output .then(({ stdout }) => { - if (!/ng generate fake \[b\]/.test(stdout)) { - throw new Error('Help signature is wrong (2).'); - } - if (!/opt-a[\s\S]*opt-b[\s\S]*opt-c/.test(stdout)) { - throw new Error('Help signature options are incorrect.'); - } + assert.match(stdout, /ng generate fake \[b\]/); + assert.match(stdout, /opt-a[\s\S]*opt-b[\s\S]*opt-c/); }) // should print all the available schematics in a collection @@ -123,9 +116,7 @@ export default function () { ) .then(() => ng('generate', '--help')) .then(({ stdout }) => { - if (!/fake[\s\S]*fake-two/.test(stdout)) { - throw new Error(`Help result is wrong, it didn't contain all the schematics.`); - } + assert.match(stdout, /fake[\s\S]*fake-two/); }) ); } diff --git a/tests/legacy-cli/e2e/tests/generate/install-allow-scripts.ts b/tests/e2e/tests/generate/install-allow-scripts.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/install-allow-scripts.ts rename to tests/e2e/tests/generate/install-allow-scripts.ts diff --git a/tests/legacy-cli/e2e/tests/generate/interceptor/interceptor-basic.ts b/tests/e2e/tests/generate/interceptor/interceptor-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/interceptor/interceptor-basic.ts rename to tests/e2e/tests/generate/interceptor/interceptor-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/library/library-basic.ts b/tests/e2e/tests/generate/library/library-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/library/library-basic.ts rename to tests/e2e/tests/generate/library/library-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/library/library-standalone.ts b/tests/e2e/tests/generate/library/library-standalone.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/library/library-standalone.ts rename to tests/e2e/tests/generate/library/library-standalone.ts diff --git a/tests/legacy-cli/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/module/module-basic.ts rename to tests/e2e/tests/generate/module/module-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/module/module-import.ts b/tests/e2e/tests/generate/module/module-import.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/module/module-import.ts rename to tests/e2e/tests/generate/module/module-import.ts diff --git a/tests/legacy-cli/e2e/tests/generate/module/module-routing-child-folder.ts b/tests/e2e/tests/generate/module/module-routing-child-folder.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/module/module-routing-child-folder.ts rename to tests/e2e/tests/generate/module/module-routing-child-folder.ts diff --git a/tests/legacy-cli/e2e/tests/generate/pipe/pipe-basic.ts b/tests/e2e/tests/generate/pipe/pipe-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/pipe/pipe-basic.ts rename to tests/e2e/tests/generate/pipe/pipe-basic.ts diff --git a/tests/legacy-cli/e2e/tests/generate/schematic-aliases.ts b/tests/e2e/tests/generate/schematic-aliases.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/schematic-aliases.ts rename to tests/e2e/tests/generate/schematic-aliases.ts diff --git a/tests/legacy-cli/e2e/tests/generate/schematic-defaults.ts b/tests/e2e/tests/generate/schematic-defaults.ts similarity index 81% rename from tests/legacy-cli/e2e/tests/generate/schematic-defaults.ts rename to tests/e2e/tests/generate/schematic-defaults.ts index 7c9987d92321..a6fc32a8c52e 100644 --- a/tests/legacy-cli/e2e/tests/generate/schematic-defaults.ts +++ b/tests/e2e/tests/generate/schematic-defaults.ts @@ -1,3 +1,4 @@ +import assert from 'node:assert/strict'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; @@ -12,9 +13,7 @@ export default async function () { // Generate component in application to verify that it's minimal const { stdout } = await ng('generate', 'component', 'foo'); - if (!stdout.includes('foo.scss')) { - throw new Error('Expected "foo.scss" to exist.'); - } + assert.match(stdout, /foo\.scss/); // Generate another project with different settings await ng('generate', 'application', 'test-project-two', '--no-minimal'); @@ -35,7 +34,5 @@ export default async function () { '--project', 'test-project-two', ); - if (!stdout2.includes('foo.component.less')) { - throw new Error('Expected "foo.component.less" to exist.'); - } + assert.match(stdout2, /foo\.component\.less/); } diff --git a/tests/e2e/tests/generate/schematic-force-override.ts b/tests/e2e/tests/generate/schematic-force-override.ts new file mode 100644 index 000000000000..d3e9e1b7d947 --- /dev/null +++ b/tests/e2e/tests/generate/schematic-force-override.ts @@ -0,0 +1,51 @@ +import { appendFile } from 'node:fs/promises'; +import { getGlobalVariable } from '../../utils/env'; +import { getActivePackageManager, installWorkspacePackages } from '../../utils/packages'; +import { ng } from '../../utils/process'; +import { isPrereleaseCli, updateJsonFile } from '../../utils/project'; +import { expectToFail } from '../../utils/utils'; + +const snapshots = require('../../ng-snapshot/package.json'); + +export default async function () { + const isPrerelease = await isPrereleaseCli(); + let tag = isPrerelease ? '@next' : ''; + if (getActivePackageManager() === 'npm') { + await appendFile('.npmrc', '\nlegacy-peer-deps=true'); + } + + await ng('add', `@angular/material${tag}`, '--skip-confirmation'); + + const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots']; + if (isSnapshotBuild) { + await updateJsonFile('package.json', (packageJson) => { + const dependencies = packageJson['dependencies']; + // Angular material adds dependencies on other Angular packages + // Iterate over all of the packages to update them to the snapshot version. + for (const [name, version] of Object.entries(snapshots.dependencies)) { + if (name in dependencies) { + dependencies[name] = version; + } + } + }); + await installWorkspacePackages(); + } + + const args: string[] = [ + 'generate', + '@angular/material:theme-color', + '--primary-color=#0641e6', + '--tertiary-color=#994aff', + '--neutral-color=#313138', + '--error-color=#eb5757', + '--secondary-color=#009096', + '--neutral-variant-color=#b2b2b8', + ]; + + await ng(...args); + + // Should fail as file exists + await expectToFail(() => ng(...args)); + + await ng(...args, '--force'); +} diff --git a/tests/legacy-cli/e2e/tests/generate/schematics-collections-relative.ts b/tests/e2e/tests/generate/schematics-collections-relative.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/schematics-collections-relative.ts rename to tests/e2e/tests/generate/schematics-collections-relative.ts diff --git a/tests/legacy-cli/e2e/tests/generate/schematics-collections.ts b/tests/e2e/tests/generate/schematics-collections.ts similarity index 73% rename from tests/legacy-cli/e2e/tests/generate/schematics-collections.ts rename to tests/e2e/tests/generate/schematics-collections.ts index f67dde1072c4..6c009bf91e5d 100644 --- a/tests/legacy-cli/e2e/tests/generate/schematics-collections.ts +++ b/tests/e2e/tests/generate/schematics-collections.ts @@ -1,6 +1,7 @@ +import assert from 'node:assert/strict'; import { join } from 'node:path'; +import { createDir, expectFileToExist, writeMultipleFiles } from '../../utils/fs'; import { ng } from '../../utils/process'; -import { writeMultipleFiles, createDir, expectFileToExist } from '../../utils/fs'; import { updateJsonFile } from '../../utils/project'; export default async function () { @@ -55,24 +56,15 @@ export default async function () { // should display schematics for all schematics const { stdout: stdout1 } = await ng('generate', '--help'); - if (!stdout1.includes('ng generate component')) { - throw new Error(`Didn't show schematics of '@schematics/angular'.`); - } - - if (!stdout1.includes('ng generate fake')) { - throw new Error(`Didn't show schematics of 'fake-schematics'.`); - } + assert.match(stdout1, /ng generate component/); + assert.match(stdout1, /ng generate fake/); // check registration order. Both schematics contain a component schematic verify that the first one wins. - if (!stdout1.includes(fakeComponentSchematicDesc)) { - throw new Error(`Didn't show fake component description.`); - } + assert.match(stdout1, new RegExp(fakeComponentSchematicDesc)); // Verify execution based on ordering const { stdout: stdout2 } = await ng('generate', 'component'); - if (!stdout2.includes('fake component schematic run')) { - throw new Error(`stdout didn't contain 'fake component schematic run'.`); - } + assert.match(stdout2, /fake component schematic run/); await updateJsonFile('angular.json', (json) => { json.cli ??= {}; @@ -80,12 +72,8 @@ export default async function () { }); const { stdout: stdout3 } = await ng('generate', '--help'); - if (!stdout3.includes('ng generate component [name]')) { - throw new Error(`Didn't show component description from @schematics/angular.`); - } - if (stdout3.includes(fakeComponentSchematicDesc)) { - throw new Error(`Shown fake component description, when it shouldn't.`); - } + assert.match(stdout3, /ng generate component \[name\]/); + assert.doesNotMatch(stdout3, new RegExp(fakeComponentSchematicDesc)); // Verify execution based on ordering const projectDir = join('src', 'app'); diff --git a/tests/legacy-cli/e2e/tests/generate/service/service-basic.ts b/tests/e2e/tests/generate/service/service-basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/generate/service/service-basic.ts rename to tests/e2e/tests/generate/service/service-basic.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/extract-ivy-disk-cache.ts b/tests/e2e/tests/i18n/extract-ivy-disk-cache.ts similarity index 98% rename from tests/legacy-cli/e2e/tests/i18n/extract-ivy-disk-cache.ts rename to tests/e2e/tests/i18n/extract-ivy-disk-cache.ts index e5a13de3c439..562a481086d5 100644 --- a/tests/legacy-cli/e2e/tests/i18n/extract-ivy-disk-cache.ts +++ b/tests/e2e/tests/i18n/extract-ivy-disk-cache.ts @@ -24,7 +24,6 @@ export default async function () { import { I18nTest } from './i18n-test/i18n-test'; @Component({ - standalone: true, selector: 'app-root', imports: [I18nTest], template: '' diff --git a/tests/legacy-cli/e2e/tests/i18n/extract-ivy-libraries.ts b/tests/e2e/tests/i18n/extract-ivy-libraries.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/extract-ivy-libraries.ts rename to tests/e2e/tests/i18n/extract-ivy-libraries.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/extract-ivy.ts b/tests/e2e/tests/i18n/extract-ivy.ts similarity index 98% rename from tests/legacy-cli/e2e/tests/i18n/extract-ivy.ts rename to tests/e2e/tests/i18n/extract-ivy.ts index 72af7f87e712..382051e83cce 100644 --- a/tests/legacy-cli/e2e/tests/i18n/extract-ivy.ts +++ b/tests/e2e/tests/i18n/extract-ivy.ts @@ -18,7 +18,6 @@ export default async function () { import { I18nTest } from './i18n-test/i18n-test'; @Component({ - standalone: true, selector: 'app-root', imports: [I18nTest], template: '' diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-app-shell-service-worker.ts b/tests/e2e/tests/i18n/ivy-localize-app-shell-service-worker.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-app-shell-service-worker.ts rename to tests/e2e/tests/i18n/ivy-localize-app-shell-service-worker.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-app-shell.ts b/tests/e2e/tests/i18n/ivy-localize-app-shell.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-app-shell.ts rename to tests/e2e/tests/i18n/ivy-localize-app-shell.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-basehref-absolute.ts b/tests/e2e/tests/i18n/ivy-localize-basehref-absolute.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-basehref-absolute.ts rename to tests/e2e/tests/i18n/ivy-localize-basehref-absolute.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-basehref.ts b/tests/e2e/tests/i18n/ivy-localize-basehref.ts similarity index 77% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-basehref.ts rename to tests/e2e/tests/i18n/ivy-localize-basehref.ts index d14c14307ab1..4bbd7dece3ee 100644 --- a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-basehref.ts +++ b/tests/e2e/tests/i18n/ivy-localize-basehref.ts @@ -9,7 +9,14 @@ import { expectFileToMatch } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; -import { baseHrefs, externalServer, langTranslations, setupI18nConfig } from './setup'; +import { executeBrowserTest } from '../../utils/puppeteer'; +import { + baseHrefs, + browserCheck, + externalServer, + langTranslations, + setupI18nConfig, +} from './setup'; export default async function () { // Setup i18n tests and config. @@ -50,18 +57,12 @@ export default async function () { await expectFileToMatch(`${outputPath}/index.html`, `href="${baseHrefs[lang] || '/'}"`); // Execute Application E2E tests for a production build without dev server - const { server, port, url } = await externalServer( - outputPath, - (baseHrefs[lang] as string) || '/', - ); + const { server, url } = await externalServer(outputPath, (baseHrefs[lang] as string) || '/'); try { - await ng( - 'e2e', - `--port=${port}`, - `--configuration=${lang}`, - '--dev-server-target=', - `--base-url=${url}`, - ); + await executeBrowserTest({ + baseUrl: url, + checkFn: (page) => browserCheck(page, lang), + }); } finally { server.close(); } @@ -81,18 +82,12 @@ export default async function () { await expectFileToMatch(`${outputPath}/index.html`, `href="/test${baseHrefs[lang] || '/'}"`); // Execute Application E2E tests for a production build without dev server - const { server, port, url } = await externalServer( - outputPath, - '/test' + (baseHrefs[lang] || '/'), - ); + const { server, url } = await externalServer(outputPath, '/test' + (baseHrefs[lang] || '/')); try { - await ng( - 'e2e', - `--port=${port}`, - `--configuration=${lang}`, - '--dev-server-target=', - `--base-url=${url}`, - ); + await executeBrowserTest({ + baseUrl: url, + checkFn: (page) => browserCheck(page, lang), + }); } finally { server.close(); } diff --git a/tests/e2e/tests/i18n/ivy-localize-es2015-e2e.ts b/tests/e2e/tests/i18n/ivy-localize-es2015-e2e.ts new file mode 100644 index 000000000000..d1f7ac8e28b8 --- /dev/null +++ b/tests/e2e/tests/i18n/ivy-localize-es2015-e2e.ts @@ -0,0 +1,14 @@ +import { executeBrowserTest } from '../../utils/puppeteer'; +import { browserCheck, langTranslations, setupI18nConfig } from './setup'; + +export default async function () { + // Setup i18n tests and config. + await setupI18nConfig(); + + for (const { lang } of langTranslations) { + await executeBrowserTest({ + configuration: lang, + checkFn: (page) => browserCheck(page, lang), + }); + } +} diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015.ts b/tests/e2e/tests/i18n/ivy-localize-es2015.ts similarity index 80% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015.ts rename to tests/e2e/tests/i18n/ivy-localize-es2015.ts index b8425795cab4..cea87a75f2b8 100644 --- a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015.ts +++ b/tests/e2e/tests/i18n/ivy-localize-es2015.ts @@ -1,8 +1,9 @@ import { getGlobalVariable } from '../../utils/env'; import { expectFileToMatch } from '../../utils/fs'; import { ng } from '../../utils/process'; +import { executeBrowserTest } from '../../utils/puppeteer'; import { expectToFail } from '../../utils/utils'; -import { externalServer, langTranslations, setupI18nConfig } from './setup'; +import { browserCheck, externalServer, langTranslations, setupI18nConfig } from './setup'; export default async function () { // Setup i18n tests and config. @@ -32,15 +33,12 @@ export default async function () { await expectFileToMatch(`${outputPath}/index.html`, `lang="${lang}"`); // Execute Application E2E tests for a production build without dev server - const { server, port, url } = await externalServer(outputPath, `/${lang}/`); + const { server, url } = await externalServer(outputPath, `/${lang}/`); try { - await ng( - 'e2e', - `--port=${port}`, - `--configuration=${lang}`, - '--dev-server-target=', - `--base-url=${url}`, - ); + await executeBrowserTest({ + baseUrl: url, + checkFn: (page) => browserCheck(page, lang), + }); } finally { server.close(); } diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-hashes.ts b/tests/e2e/tests/i18n/ivy-localize-hashes.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-hashes.ts rename to tests/e2e/tests/i18n/ivy-localize-hashes.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-locale-data-augment.ts b/tests/e2e/tests/i18n/ivy-localize-locale-data-augment.ts similarity index 57% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-locale-data-augment.ts rename to tests/e2e/tests/i18n/ivy-localize-locale-data-augment.ts index e2c408a74c69..b4c0ae72ced4 100644 --- a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-locale-data-augment.ts +++ b/tests/e2e/tests/i18n/ivy-localize-locale-data-augment.ts @@ -1,14 +1,9 @@ import { getGlobalVariable } from '../../utils/env'; -import { - expectFileToMatch, - prependToFile, - readFile, - replaceInFile, - writeFile, -} from '../../utils/fs'; +import { expectFileToMatch, prependToFile, readFile, writeFile } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; -import { langTranslations, setupI18nConfig } from './setup'; +import { executeBrowserTest } from '../../utils/puppeteer'; +import { browserCheck, langTranslations, setupI18nConfig } from './setup'; export default async function () { // Setup i18n tests and config. @@ -20,9 +15,6 @@ export default async function () { appProject.architect['build'].options.localize = ['fr']; }); - // Update E2E test to look for augmented locale data - await replaceInFile('./e2e/src/app.fr.e2e-spec.ts', 'janvier', 'changed-janvier'); - // Augment the locale data and import into the main application file const localeData = await readFile('node_modules/@angular/common/locales/global/fr.js'); await writeFile('src/fr-changed.js', localeData.replace('janvier', 'changed-janvier')); @@ -45,6 +37,27 @@ export default async function () { } // Execute Application E2E tests with dev server - await ng('e2e', `--configuration=${lang}`, '--port=0'); + await executeBrowserTest({ + configuration: lang, + checkFn: async (page) => { + // Run standard checks but expect failure on date + try { + await browserCheck(page, lang); + throw new Error('Expected browserCheck to fail due to modified locale data'); + } catch (e) { + if (!(e instanceof Error) || !e.message.includes("Expected 'date' to be")) { + throw e; + } + } + + // Verify the modified date + const getParagraph = async (id: string) => + page.$eval(`p#${id}`, (el) => el.textContent?.trim()); + const date = await getParagraph('date'); + if (date !== 'changed-janvier') { + throw new Error(`Expected 'date' to be 'changed-janvier', but got '${date}'.`); + } + }, + }); } } diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-locale-data.ts b/tests/e2e/tests/i18n/ivy-localize-locale-data.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-locale-data.ts rename to tests/e2e/tests/i18n/ivy-localize-locale-data.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-merging.ts b/tests/e2e/tests/i18n/ivy-localize-merging.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-merging.ts rename to tests/e2e/tests/i18n/ivy-localize-merging.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-sourcelocale.ts b/tests/e2e/tests/i18n/ivy-localize-sourcelocale.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-sourcelocale.ts rename to tests/e2e/tests/i18n/ivy-localize-sourcelocale.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-sourcemaps.ts b/tests/e2e/tests/i18n/ivy-localize-sourcemaps.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-sourcemaps.ts rename to tests/e2e/tests/i18n/ivy-localize-sourcemaps.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-ssr.ts b/tests/e2e/tests/i18n/ivy-localize-ssr.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-ssr.ts rename to tests/e2e/tests/i18n/ivy-localize-ssr.ts diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-sub-path.ts b/tests/e2e/tests/i18n/ivy-localize-sub-path.ts similarity index 83% rename from tests/legacy-cli/e2e/tests/i18n/ivy-localize-sub-path.ts rename to tests/e2e/tests/i18n/ivy-localize-sub-path.ts index d6640534c45f..6116c438a49f 100644 --- a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-sub-path.ts +++ b/tests/e2e/tests/i18n/ivy-localize-sub-path.ts @@ -10,7 +10,8 @@ import { join } from 'node:path'; import { expectFileToMatch } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; -import { baseDir, baseHrefs, externalServer, langTranslations, setupI18nConfig } from './setup'; +import { executeBrowserTest } from '../../utils/puppeteer'; +import { baseDir, browserCheck, externalServer, langTranslations, setupI18nConfig } from './setup'; export default async function () { // Setup i18n tests and config. @@ -56,16 +57,13 @@ export default async function () { await expectFileToMatch(`${outputPath}/index.html`, `href="${baseHref}"`); // Execute Application E2E tests for a production build without dev server - const { server, port, url } = await externalServer(outputPath, baseHref); + const { server, url } = await externalServer(outputPath, baseHref); try { - await ng( - 'e2e', - `--port=${port}`, - `--configuration=${lang}`, - '--dev-server-target=', - `--base-url=${url}`, - ); + await executeBrowserTest({ + baseUrl: url, + checkFn: (page) => browserCheck(page, lang), + }); } finally { server.close(); } diff --git a/tests/legacy-cli/e2e/tests/i18n/setup.ts b/tests/e2e/tests/i18n/setup.ts similarity index 84% rename from tests/legacy-cli/e2e/tests/i18n/setup.ts rename to tests/e2e/tests/i18n/setup.ts index 30fdcee1d757..8eade4e2783c 100644 --- a/tests/legacy-cli/e2e/tests/i18n/setup.ts +++ b/tests/e2e/tests/i18n/setup.ts @@ -7,6 +7,7 @@ import { updateJsonFile } from '../../utils/project'; import { readNgVersion } from '../../utils/version'; import { Server } from 'node:http'; import { AddressInfo } from 'node:net'; +import type { Page } from 'puppeteer'; // Configurations for each locale. const translationFile = 'src/locale/messages.xlf'; @@ -61,6 +62,35 @@ export const langTranslations = [ ]; export const sourceLocale = langTranslations[0].lang; +export async function browserCheck(page: Page, lang: string) { + const translation = langTranslations.find((t) => t.lang === lang)?.translation; + if (!translation) { + throw new Error(`Could not find translation for language '${lang}'`); + } + + const getParagraph = async (id: string) => page.$eval(`p#${id}`, (el) => el.textContent?.trim()); + + const hello = await getParagraph('hello'); + if (hello !== translation.hello) { + throw new Error(`Expected 'hello' to be '${translation.hello}', but got '${hello}'.`); + } + + const locale = await getParagraph('locale'); + if (locale !== lang) { + throw new Error(`Expected 'locale' to be '${lang}', but got '${locale}'.`); + } + + const date = await getParagraph('date'); + if (date !== translation.date) { + throw new Error(`Expected 'date' to be '${translation.date}', but got '${date}'.`); + } + + const plural = await getParagraph('plural'); + if (plural !== translation.plural) { + throw new Error(`Expected 'plural' to be '${translation.plural}', but got '${plural}'.`); + } +} + export interface ExternalServer { readonly server: Server; readonly port: number; @@ -107,7 +137,6 @@ export async function setupI18nConfig() { @Component({ selector: 'app-root', imports: [DatePipe, RouterOutlet], - standalone: true, templateUrl: './app.html' }) export class App { @@ -174,47 +203,12 @@ export async function setupI18nConfig() { `, ); - // Add e2e specs for each lang. - for (const { lang, translation } of langTranslations) { - await writeFile( - `./e2e/src/app.${lang}.e2e-spec.ts`, - ` - import { browser, logging, element, by } from 'protractor'; - - describe('workspace-project App', () => { - const getParagraph = async (name: string) => element(by.css('app-root p#' + name)).getText(); - beforeEach(() => browser.get(browser.baseUrl)); - afterEach(async () => { - // Assert that there are no errors emitted from the browser - const logs = await browser.manage().logs().get(logging.Type.BROWSER); - expect(logs).not.toContain(jasmine.objectContaining({ - level: logging.Level.SEVERE, - } as logging.Entry)); - }); - - it('should display welcome message', async () => - expect(await getParagraph('hello')).toEqual('${translation.hello}')); - - it('should display locale', async () => - expect(await getParagraph('locale')).toEqual('${lang}')); - - it('should display localized date', async () => - expect(await getParagraph('date')).toEqual('${translation.date}')); - - it('should display pluralized message', async () => - expect(await getParagraph('plural')).toEqual('${translation.plural}')); - }); - `, - ); - } - // Update angular.json to build, serve, and test each locale. await updateJsonFile('angular.json', (workspaceJson) => { const appProject = workspaceJson.projects['test-project']; const appArchitect = workspaceJson.projects['test-project'].architect; const buildConfigs = appArchitect['build'].configurations; const serveConfigs = appArchitect['serve'].configurations; - const e2eConfigs = appArchitect['e2e'].configurations; appArchitect['build'].defaultConfiguration = undefined; @@ -246,10 +240,6 @@ export async function setupI18nConfig() { buildConfigs[lang] = { localize: [lang] }; serveConfigs[lang] = { buildTarget: `test-project:build:${lang}` }; - e2eConfigs[lang] = { - specs: [`./src/app.${lang}.e2e-spec.ts`], - devServerTarget: `test-project:serve:${lang}`, - }; } }); diff --git a/tests/legacy-cli/e2e/tests/jest/aot.ts b/tests/e2e/tests/jest/aot.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/jest/aot.ts rename to tests/e2e/tests/jest/aot.ts diff --git a/tests/legacy-cli/e2e/tests/jest/basic.ts b/tests/e2e/tests/jest/basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/jest/basic.ts rename to tests/e2e/tests/jest/basic.ts diff --git a/tests/legacy-cli/e2e/tests/jest/custom-config.ts b/tests/e2e/tests/jest/custom-config.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/jest/custom-config.ts rename to tests/e2e/tests/jest/custom-config.ts diff --git a/tests/e2e/tests/jest/no-zoneless.ts b/tests/e2e/tests/jest/no-zoneless.ts new file mode 100644 index 000000000000..9a74a0295c4e --- /dev/null +++ b/tests/e2e/tests/jest/no-zoneless.ts @@ -0,0 +1,29 @@ +import { replaceInFile } from '../../utils/fs'; +import { applyJestBuilder } from '../../utils/jest'; +import { installPackage, uninstallPackage } from '../../utils/packages'; +import { ng } from '../../utils/process'; + +export default async function (): Promise { + await applyJestBuilder({ + tsConfig: 'tsconfig.spec.json', + polyfills: ['zone.js', 'zone.js/testing'], + }); + + await replaceInFile( + 'src/app/app.spec.ts', + 'await fixture.whenStable();', + 'fixture.detectChanges();', + ); + + try { + await installPackage('zone.js'); + + const { stderr } = await ng('test'); + + if (!stderr.includes('Jest builder is currently EXPERIMENTAL')) { + throw new Error(`No experimental notice in stderr.\nSTDERR:\n\n${stderr}`); + } + } finally { + await uninstallPackage('zone.js'); + } +} diff --git a/tests/e2e/tests/mcp/ai-tutor.ts b/tests/e2e/tests/mcp/ai-tutor.ts new file mode 100644 index 000000000000..220b32fcc202 --- /dev/null +++ b/tests/e2e/tests/mcp/ai-tutor.ts @@ -0,0 +1,40 @@ +import { chdir } from 'node:process'; +import { exec, ProcessOutput, silentNpm } from '../../utils/process'; +import assert from 'node:assert/strict'; + +const MCP_INSPECTOR_PACKAGE_NAME = '@modelcontextprotocol/inspector-cli'; +const MCP_INSPECTOR_PACKAGE_VERSION = '0.16.2'; +const MCP_INSPECTOR_COMMAND_NAME = 'mcp-inspector-cli'; + +async function runInspector(...args: string[]): Promise { + const result = await exec( + MCP_INSPECTOR_COMMAND_NAME, + '--cli', + 'npx', + '--no', + '@angular/cli', + 'mcp', + ...args, + ); + + return result; +} + +export default async function () { + await silentNpm( + 'install', + '--ignore-scripts', + '-g', + `${MCP_INSPECTOR_PACKAGE_NAME}@${MCP_INSPECTOR_PACKAGE_VERSION}`, + ); + + // Ensure `get_best_practices` returns the markdown content + const { stdout: stdoutInsideWorkspace } = await runInspector( + '--method', + 'tools/call', + '--tool-name', + 'ai_tutor', + ); + + assert.match(stdoutInsideWorkspace, /# `airules.md` - Modern Angular Tutor 🧑‍🏫/); +} diff --git a/tests/e2e/tests/mcp/best-practices.ts b/tests/e2e/tests/mcp/best-practices.ts new file mode 100644 index 000000000000..55736c63795b --- /dev/null +++ b/tests/e2e/tests/mcp/best-practices.ts @@ -0,0 +1,43 @@ +import { chdir } from 'node:process'; +import { exec, ProcessOutput, silentNpm } from '../../utils/process'; +import assert from 'node:assert/strict'; + +const MCP_INSPECTOR_PACKAGE_NAME = '@modelcontextprotocol/inspector-cli'; +const MCP_INSPECTOR_PACKAGE_VERSION = '0.16.2'; +const MCP_INSPECTOR_COMMAND_NAME = 'mcp-inspector-cli'; + +async function runInspector(...args: string[]): Promise { + const result = await exec( + MCP_INSPECTOR_COMMAND_NAME, + '--cli', + 'npx', + '--no', + '@angular/cli', + 'mcp', + ...args, + ); + + return result; +} + +export default async function () { + await silentNpm( + 'install', + '--ignore-scripts', + '-g', + `${MCP_INSPECTOR_PACKAGE_NAME}@${MCP_INSPECTOR_PACKAGE_VERSION}`, + ); + + // Ensure `get_best_practices` returns the markdown content + const { stdout: stdoutInsideWorkspace } = await runInspector( + '--method', + 'tools/call', + '--tool-name', + 'get_best_practices', + ); + + assert.match( + stdoutInsideWorkspace, + /You are an expert in TypeScript, Angular, and scalable web application development./, + ); +} diff --git a/tests/e2e/tests/mcp/find-examples-basic.ts b/tests/e2e/tests/mcp/find-examples-basic.ts new file mode 100644 index 000000000000..b7f42045076c --- /dev/null +++ b/tests/e2e/tests/mcp/find-examples-basic.ts @@ -0,0 +1,48 @@ +import { exec, ProcessOutput, silentNpm } from '../../utils/process'; +import assert from 'node:assert/strict'; + +const MCP_INSPECTOR_PACKAGE_NAME = '@modelcontextprotocol/inspector-cli'; +const MCP_INSPECTOR_PACKAGE_VERSION = '0.16.2'; +const MCP_INSPECTOR_COMMAND_NAME = 'mcp-inspector-cli'; + +async function runInspector(...args: string[]): Promise { + const result = await exec( + MCP_INSPECTOR_COMMAND_NAME, + '--cli', + 'npx', + '--no', + '@angular/cli', + 'mcp', + ...args, + ); + + return result; +} + +export default async function () { + const [nodeMajor, nodeMinor] = process.versions.node.split('.', 2).map(Number); + if (nodeMajor < 22 || (nodeMajor === 22 && nodeMinor < 16)) { + console.log('Test bypassed: find_examples tool requires Node.js 22.16 or higher.'); + + return; + } + + await silentNpm( + 'install', + '--ignore-scripts', + '-g', + `${MCP_INSPECTOR_PACKAGE_NAME}@${MCP_INSPECTOR_PACKAGE_VERSION}`, + ); + + // Ensure `get_best_practices` returns the markdown content + const { stdout: stdoutInsideWorkspace } = await runInspector( + '--method', + 'tools/call', + '--tool-name', + 'find_examples', + '--tool-arg', + 'query=if', + ); + + assert.match(stdoutInsideWorkspace, /Using the @if Built-in Control Flow Block/); +} diff --git a/tests/e2e/tests/mcp/registers-tools.ts b/tests/e2e/tests/mcp/registers-tools.ts new file mode 100644 index 000000000000..abc76a99f5d7 --- /dev/null +++ b/tests/e2e/tests/mcp/registers-tools.ts @@ -0,0 +1,49 @@ +import { chdir } from 'node:process'; +import { exec, ProcessOutput, silentNpm } from '../../utils/process'; +import assert from 'node:assert/strict'; + +const MCP_INSPECTOR_PACKAGE_NAME = '@modelcontextprotocol/inspector-cli'; +const MCP_INSPECTOR_PACKAGE_VERSION = '0.16.2'; +const MCP_INSPECTOR_COMMAND_NAME = 'mcp-inspector-cli'; + +async function runInspector(...args: string[]): Promise { + const result = await exec( + MCP_INSPECTOR_COMMAND_NAME, + '--cli', + 'npx', + '--no', + '@angular/cli', + 'mcp', + ...args, + ); + + return result; +} + +export default async function () { + await silentNpm( + 'install', + '--ignore-scripts', + '-g', + `${MCP_INSPECTOR_PACKAGE_NAME}@${MCP_INSPECTOR_PACKAGE_VERSION}`, + ); + + // Ensure 'list_projects' is registered when inside an Angular workspace + try { + const { stdout: stdoutInsideWorkspace } = await runInspector('--method', 'tools/list'); + + assert.match(stdoutInsideWorkspace, /"list_projects"/); + assert.match(stdoutInsideWorkspace, /"get_best_practices"/); + assert.match(stdoutInsideWorkspace, /"search_documentation"/); + + chdir('..'); + + const { stdout: stdoutOutsideWorkspace } = await runInspector('--method', 'tools/list'); + + assert.match(stdoutOutsideWorkspace, /"list_projects"/); + assert.match(stdoutOutsideWorkspace, /"get_best_practices"/); + assert.match(stdoutInsideWorkspace, /"search_documentation"/); + } finally { + await silentNpm('uninstall', '-g', MCP_INSPECTOR_PACKAGE_NAME); + } +} diff --git a/tests/legacy-cli/e2e/tests/misc/ask-missing-builder.ts b/tests/e2e/tests/misc/ask-missing-builder.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/ask-missing-builder.ts rename to tests/e2e/tests/misc/ask-missing-builder.ts diff --git a/tests/legacy-cli/e2e/tests/misc/browsers.ts b/tests/e2e/tests/misc/browsers.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/browsers.ts rename to tests/e2e/tests/misc/browsers.ts diff --git a/tests/legacy-cli/e2e/tests/misc/check-postinstalls.ts b/tests/e2e/tests/misc/check-postinstalls.ts similarity index 98% rename from tests/legacy-cli/e2e/tests/misc/check-postinstalls.ts rename to tests/e2e/tests/misc/check-postinstalls.ts index 2b0ad00b62a1..7c1d63e6ef97 100644 --- a/tests/legacy-cli/e2e/tests/misc/check-postinstalls.ts +++ b/tests/e2e/tests/misc/check-postinstalls.ts @@ -7,6 +7,7 @@ const CURRENT_SCRIPT_PACKAGES: ReadonlySet = new Set([ 'lmdb (install)', 'msgpackr-extract (install)', 'nice-napi (install)', + 'unrs-resolver (postinstall)', ]); const POTENTIAL_SCRIPTS: ReadonlyArray = ['preinstall', 'install', 'postinstall']; diff --git a/tests/legacy-cli/e2e/tests/misc/create-angular.ts b/tests/e2e/tests/misc/create-angular.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/create-angular.ts rename to tests/e2e/tests/misc/create-angular.ts diff --git a/tests/legacy-cli/e2e/tests/misc/dedupe-duplicate-modules.ts b/tests/e2e/tests/misc/dedupe-duplicate-modules.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/dedupe-duplicate-modules.ts rename to tests/e2e/tests/misc/dedupe-duplicate-modules.ts diff --git a/tests/legacy-cli/e2e/tests/misc/duplicate-command-line-option.ts b/tests/e2e/tests/misc/duplicate-command-line-option.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/duplicate-command-line-option.ts rename to tests/e2e/tests/misc/duplicate-command-line-option.ts diff --git a/tests/legacy-cli/e2e/tests/misc/es2015-nometa.ts b/tests/e2e/tests/misc/es2015-nometa.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/es2015-nometa.ts rename to tests/e2e/tests/misc/es2015-nometa.ts diff --git a/tests/legacy-cli/e2e/tests/misc/forwardref-es2015.ts b/tests/e2e/tests/misc/forwardref-es2015.ts similarity index 90% rename from tests/legacy-cli/e2e/tests/misc/forwardref-es2015.ts rename to tests/e2e/tests/misc/forwardref-es2015.ts index 32ca39e89713..48c28086cd0d 100644 --- a/tests/legacy-cli/e2e/tests/misc/forwardref-es2015.ts +++ b/tests/e2e/tests/misc/forwardref-es2015.ts @@ -6,8 +6,8 @@ export default async function () { // Update the application to use a forward reference await replaceInFile( 'src/app/app.ts', - "import { Component } from '@angular/core';", - "import { Component, Inject, Injectable, forwardRef } from '@angular/core';", + "import { Component, signal } from '@angular/core';", + "import { Component, Inject, Injectable, forwardRef, signal } from '@angular/core';", ); await appendToFile('src/app/app.ts', '\n@Injectable() export class Lock { }\n'); await replaceInFile( diff --git a/tests/legacy-cli/e2e/tests/misc/invalid-schematic-dependencies.ts b/tests/e2e/tests/misc/invalid-schematic-dependencies.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/invalid-schematic-dependencies.ts rename to tests/e2e/tests/misc/invalid-schematic-dependencies.ts diff --git a/tests/legacy-cli/e2e/tests/misc/loaders-resolution.ts b/tests/e2e/tests/misc/loaders-resolution.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/loaders-resolution.ts rename to tests/e2e/tests/misc/loaders-resolution.ts diff --git a/tests/legacy-cli/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts b/tests/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts rename to tests/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts diff --git a/tests/legacy-cli/e2e/tests/misc/multiple-targets.ts b/tests/e2e/tests/misc/multiple-targets.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/multiple-targets.ts rename to tests/e2e/tests/misc/multiple-targets.ts diff --git a/tests/legacy-cli/e2e/tests/misc/negated-boolean-options.ts b/tests/e2e/tests/misc/negated-boolean-options.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/negated-boolean-options.ts rename to tests/e2e/tests/misc/negated-boolean-options.ts diff --git a/tests/legacy-cli/e2e/tests/misc/nested-schematic-packages.ts b/tests/e2e/tests/misc/nested-schematic-packages.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/nested-schematic-packages.ts rename to tests/e2e/tests/misc/nested-schematic-packages.ts diff --git a/tests/legacy-cli/e2e/tests/misc/supported-angular.ts b/tests/e2e/tests/misc/supported-angular.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/supported-angular.ts rename to tests/e2e/tests/misc/supported-angular.ts diff --git a/tests/legacy-cli/e2e/tests/misc/target-default-configuration.ts b/tests/e2e/tests/misc/target-default-configuration.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/target-default-configuration.ts rename to tests/e2e/tests/misc/target-default-configuration.ts diff --git a/tests/legacy-cli/e2e/tests/misc/trace-resolution.ts b/tests/e2e/tests/misc/trace-resolution.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/trace-resolution.ts rename to tests/e2e/tests/misc/trace-resolution.ts diff --git a/tests/legacy-cli/e2e/tests/misc/trusted-types.ts b/tests/e2e/tests/misc/trusted-types.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/trusted-types.ts rename to tests/e2e/tests/misc/trusted-types.ts diff --git a/tests/legacy-cli/e2e/tests/misc/update-git-clean-subdirectory.ts b/tests/e2e/tests/misc/update-git-clean-subdirectory.ts similarity index 89% rename from tests/legacy-cli/e2e/tests/misc/update-git-clean-subdirectory.ts rename to tests/e2e/tests/misc/update-git-clean-subdirectory.ts index 11040c618bbb..733a91164019 100644 --- a/tests/legacy-cli/e2e/tests/misc/update-git-clean-subdirectory.ts +++ b/tests/e2e/tests/misc/update-git-clean-subdirectory.ts @@ -11,7 +11,7 @@ export default async function () { await silentGit('init', '.'); - await ng('new', 'subdirectory-test-project', '--skip-install'); + await ng('new', 'subdirectory-test-project', '--skip-install', '--test-runner', 'karma'); process.chdir('./subdirectory-test-project'); await prepareProjectForE2e('subdirectory-test-project'); diff --git a/tests/legacy-cli/e2e/tests/misc/update-git-clean.ts b/tests/e2e/tests/misc/update-git-clean.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/update-git-clean.ts rename to tests/e2e/tests/misc/update-git-clean.ts diff --git a/tests/legacy-cli/e2e/tests/misc/version.ts b/tests/e2e/tests/misc/version.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/version.ts rename to tests/e2e/tests/misc/version.ts diff --git a/tests/legacy-cli/e2e/tests/misc/workspace-verification.ts b/tests/e2e/tests/misc/workspace-verification.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/misc/workspace-verification.ts rename to tests/e2e/tests/misc/workspace-verification.ts diff --git a/tests/legacy-cli/e2e/tests/protractor/test-fails.ts b/tests/e2e/tests/protractor/test-fails.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/protractor/test-fails.ts rename to tests/e2e/tests/protractor/test-fails.ts diff --git a/tests/legacy-cli/e2e/tests/schematics_cli/basic.ts b/tests/e2e/tests/schematics_cli/basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/schematics_cli/basic.ts rename to tests/e2e/tests/schematics_cli/basic.ts diff --git a/tests/legacy-cli/e2e/tests/schematics_cli/blank-test.ts b/tests/e2e/tests/schematics_cli/blank-test.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/schematics_cli/blank-test.ts rename to tests/e2e/tests/schematics_cli/blank-test.ts diff --git a/tests/legacy-cli/e2e/tests/schematics_cli/schematic-test.ts b/tests/e2e/tests/schematics_cli/schematic-test.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/schematics_cli/schematic-test.ts rename to tests/e2e/tests/schematics_cli/schematic-test.ts diff --git a/tests/e2e/tests/test/karma-junit-output.ts b/tests/e2e/tests/test/karma-junit-output.ts new file mode 100644 index 000000000000..056adea26ab3 --- /dev/null +++ b/tests/e2e/tests/test/karma-junit-output.ts @@ -0,0 +1,27 @@ +import { expectFileMatchToExist, replaceInFile } from '../../utils/fs'; +import { installPackage } from '../../utils/packages'; +import { silentNg } from '../../utils/process'; + +const E2E_CUSTOM_LAUNCHER = ` + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage'], + }, + }, + restartOnFileChange: true, +`; + +export default async function () { + await installPackage('karma-junit-reporter'); + await silentNg('generate', 'config', 'karma'); + + await replaceInFile('karma.conf.js', 'karma-jasmine-html-reporter', 'karma-junit-reporter'); + await replaceInFile('karma.conf.js', `'kjhtml'`, `'junit'`); + + await replaceInFile('karma.conf.js', `restartOnFileChange: true`, E2E_CUSTOM_LAUNCHER); + + await silentNg('test', '--no-watch'); + + await expectFileMatchToExist('.', /TESTS\-.+\.xml/); +} diff --git a/tests/legacy-cli/e2e/tests/test/test-code-coverage-exclude.ts b/tests/e2e/tests/test/test-code-coverage-exclude.ts similarity index 65% rename from tests/legacy-cli/e2e/tests/test/test-code-coverage-exclude.ts rename to tests/e2e/tests/test/test-code-coverage-exclude.ts index 3533e6c8e9a9..808bcb59e2d9 100644 --- a/tests/legacy-cli/e2e/tests/test/test-code-coverage-exclude.ts +++ b/tests/e2e/tests/test/test-code-coverage-exclude.ts @@ -1,10 +1,14 @@ +import { getGlobalVariable } from '../../utils/env'; import { expectFileToExist, rimraf } from '../../utils/fs'; import { silentNg } from '../../utils/process'; import { expectToFail } from '../../utils/utils'; export default async function () { + const isWebpack = !getGlobalVariable('argv')['esbuild']; + const coverageOptionName = isWebpack ? '--code-coverage' : '--coverage'; + // This test is already in build-angular, but that doesn't run on Windows. - await silentNg('test', '--no-watch', '--code-coverage'); + await silentNg('test', '--no-watch', coverageOptionName); await expectFileToExist('coverage/test-project/app.ts.html'); // Delete coverage directory await rimraf('coverage'); @@ -12,8 +16,8 @@ export default async function () { await silentNg( 'test', '--no-watch', - '--code-coverage', - `--code-coverage-exclude='src/**/app.ts'`, + coverageOptionName, + `${coverageOptionName}-exclude='src/**/app.ts'`, ); // Doesn't include excluded. diff --git a/tests/e2e/tests/test/test-environment.ts b/tests/e2e/tests/test/test-environment.ts new file mode 100644 index 000000000000..1670cb246521 --- /dev/null +++ b/tests/e2e/tests/test/test-environment.ts @@ -0,0 +1,71 @@ +import { ng } from '../../utils/process'; +import { writeFile, writeMultipleFiles } from '../../utils/fs'; +import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; + +export default async function () { + const isWebpack = !getGlobalVariable('argv')['esbuild']; + + // Tests run in 'dev' environment by default. + await writeMultipleFiles({ + 'src/environment.prod.ts': ` + export const environment = { + production: true + };`, + 'src/environment.ts': ` + export const environment = { + production: false + }; + `, + 'src/app/environment.spec.ts': ` + import { environment } from '../environment'; + + describe('Test environment', () => { + it('should have production disabled', () => { + expect(environment.production).toBe(false); + }); + }); + `, + }); + + await ng('test', '--watch=false'); + + await updateJsonFile('angular.json', (configJson) => { + const appArchitect = configJson.projects['test-project'].architect; + appArchitect[isWebpack ? 'test' : 'build'].configurations = { + production: { + fileReplacements: [ + { + replace: 'src/environment.ts', + with: 'src/environment.prod.ts', + }, + ], + }, + }; + if (!isWebpack) { + appArchitect.test.options ??= {}; + appArchitect.test.options.buildTarget = '::production'; + } + }); + + // Tests can run in different environment. + + await writeFile( + 'src/app/environment.spec.ts', + ` + import { environment } from '../environment'; + + describe('Test environment', () => { + it('should have production enabled', () => { + expect(environment.production).toBe(true); + }); + }); + `, + ); + + if (isWebpack) { + await ng('test', '--watch=false', '--configuration=production'); + } else { + await ng('test', '--watch=false'); + } +} diff --git a/tests/legacy-cli/e2e/tests/test/test-fail-single-run.ts b/tests/e2e/tests/test/test-fail-single-run.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/test/test-fail-single-run.ts rename to tests/e2e/tests/test/test-fail-single-run.ts diff --git a/tests/legacy-cli/e2e/tests/test/test-include-glob.ts b/tests/e2e/tests/test/test-include-glob.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/test/test-include-glob.ts rename to tests/e2e/tests/test/test-include-glob.ts diff --git a/tests/legacy-cli/e2e/tests/test/test-jasmine-clock.ts b/tests/e2e/tests/test/test-jasmine-clock.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/test/test-jasmine-clock.ts rename to tests/e2e/tests/test/test-jasmine-clock.ts diff --git a/tests/legacy-cli/e2e/tests/test/test-scripts.ts b/tests/e2e/tests/test/test-scripts.ts similarity index 93% rename from tests/legacy-cli/e2e/tests/test/test-scripts.ts rename to tests/e2e/tests/test/test-scripts.ts index acbcc66dc230..1537cdddf349 100644 --- a/tests/legacy-cli/e2e/tests/test/test-scripts.ts +++ b/tests/e2e/tests/test/test-scripts.ts @@ -1,3 +1,4 @@ +import { getGlobalVariable } from '../../utils/env'; import { writeMultipleFiles } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; @@ -60,9 +61,10 @@ export default async function () { // should fail because the global scripts were not added to scripts array await expectToFail(() => ng('test', '--watch=false')); + const isWebpack = !getGlobalVariable('argv')['esbuild']; await updateJsonFile('angular.json', (workspaceJson) => { const appArchitect = workspaceJson.projects['test-project'].architect; - appArchitect.test.options.scripts = [ + appArchitect[isWebpack ? 'test' : 'build'].options.scripts = [ { input: 'src/string-script.js' }, { input: 'src/input-script.js' }, ]; diff --git a/tests/legacy-cli/e2e/tests/test/test-sourcemap.ts b/tests/e2e/tests/test/test-sourcemap.ts similarity index 54% rename from tests/legacy-cli/e2e/tests/test/test-sourcemap.ts rename to tests/e2e/tests/test/test-sourcemap.ts index 9e2a8e3f36fa..6c1cf16cd7b3 100644 --- a/tests/legacy-cli/e2e/tests/test/test-sourcemap.ts +++ b/tests/e2e/tests/test/test-sourcemap.ts @@ -1,10 +1,13 @@ import assert from 'node:assert'; -import { getGlobalVariable } from '../../utils/env'; import { writeFile } from '../../utils/fs'; import { ng } from '../../utils/process'; import { assertIsError } from '../../utils/utils'; +import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default async function () { + const isWebpack = !getGlobalVariable('argv')['esbuild']; + await writeFile( 'src/app/app.spec.ts', ` @@ -15,8 +18,16 @@ export default async function () { ); // when sourcemaps are 'on' the stacktrace will point to the spec.ts file. + await updateJsonFile('angular.json', (configJson) => { + const appArchitect = configJson.projects['test-project'].architect; + if (isWebpack) { + appArchitect['test'].options.sourceMap = true; + } else { + appArchitect['build'].configurations.development.sourceMap = true; + } + }); try { - await ng('test', '--no-watch', '--source-map'); + await ng('test', '--no-watch'); throw new Error('ng test should have failed.'); } catch (error) { assertIsError(error); @@ -25,8 +36,16 @@ export default async function () { } // when sourcemaps are 'off' the stacktrace won't point to the spec.ts file. + await updateJsonFile('angular.json', (configJson) => { + const appArchitect = configJson.projects['test-project'].architect; + if (isWebpack) { + appArchitect['test'].options.sourceMap = false; + } else { + appArchitect['build'].configurations.development.sourceMap = false; + } + }); try { - await ng('test', '--no-watch', '--no-source-map'); + await ng('test', '--no-watch'); throw new Error('ng test should have failed.'); } catch (error) { assertIsError(error); diff --git a/tests/legacy-cli/e2e/tests/update/update-application-builder.ts b/tests/e2e/tests/update/update-application-builder.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/update/update-application-builder.ts rename to tests/e2e/tests/update/update-application-builder.ts diff --git a/tests/legacy-cli/e2e/tests/update/update-multiple-versions.ts b/tests/e2e/tests/update/update-multiple-versions.ts similarity index 96% rename from tests/legacy-cli/e2e/tests/update/update-multiple-versions.ts rename to tests/e2e/tests/update/update-multiple-versions.ts index 66b58d87b908..6fecb7b15b58 100644 --- a/tests/legacy-cli/e2e/tests/update/update-multiple-versions.ts +++ b/tests/e2e/tests/update/update-multiple-versions.ts @@ -7,7 +7,7 @@ import { expectToFail } from '../../utils/utils'; export default async function () { let restoreRegistry: (() => Promise) | undefined; try { - restoreRegistry = await createProjectFromAsset('17.0-project', true); + restoreRegistry = await createProjectFromAsset('19.0-project', true); await setRegistry(true); const extraArgs = ['--force']; diff --git a/tests/legacy-cli/e2e/tests/update/update-secure-registry.ts b/tests/e2e/tests/update/update-secure-registry.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/update/update-secure-registry.ts rename to tests/e2e/tests/update/update-secure-registry.ts diff --git a/tests/legacy-cli/e2e/tests/update/update.ts b/tests/e2e/tests/update/update.ts similarity index 87% rename from tests/legacy-cli/e2e/tests/update/update.ts rename to tests/e2e/tests/update/update.ts index d6b73b585eff..ae941762d6ca 100644 --- a/tests/legacy-cli/e2e/tests/update/update.ts +++ b/tests/e2e/tests/update/update.ts @@ -4,6 +4,7 @@ import { expectFileMatchToExist } from '../../utils/fs'; import { getActivePackageManager } from '../../utils/packages'; import { ng, noSilentNg } from '../../utils/process'; import { isPrereleaseCli, useCIChrome, useCIDefaults, getNgCLIVersion } from '../../utils/project'; +import { executeBrowserTest } from '../../utils/puppeteer'; export default async function () { let restoreRegistry: (() => Promise) | undefined; @@ -11,10 +12,10 @@ export default async function () { try { // We need to use the public registry because in the local NPM server we don't have // older versions @angular/cli packages which would cause `npm install` during `ng update` to fail. - restoreRegistry = await createProjectFromAsset('17.0-project', true); + restoreRegistry = await createProjectFromAsset('19.0-project', true); // CLI project version - const cliMajorProjectVersion = 17; + const cliMajorProjectVersion = 19; // If using npm, enable legacy peer deps mode to avoid defects in npm 7+'s peer dependency resolution // Example error where 11.2.14 satisfies the SemVer range ^11.0.0 but still fails: @@ -70,22 +71,24 @@ export default async function () { await ng('update', '@angular/cli', ...extraUpdateArgs); - // Generate E2E setup - await ng('generate', 'private-e2e', '--related-app-name=seventeen-project'); - // Setup testing to use CI Chrome. - await useCIChrome('seventeen-project', './'); - await useCIChrome('seventeen-project', './e2e/'); - await useCIDefaults('seventeen-project'); + await useCIChrome('nineteen-project', './'); + await useCIDefaults('nineteen-project'); // Run CLI commands. await ng('generate', 'component', 'my-comp'); await ng('test', '--watch=false'); - await ng('e2e'); - await ng('e2e', '--configuration=production'); + await executeBrowserTest({ + configuration: 'production', + expectedTitleText: 'Hello, nineteen-project', + }); + await executeBrowserTest({ + configuration: 'development', + expectedTitleText: 'Hello, nineteen-project', + }); // Verify project now creates bundles await noSilentNg('build', '--configuration=production'); - await expectFileMatchToExist('dist/seventeen-project/browser', /main-[a-zA-Z0-9]{8}\.js/); + await expectFileMatchToExist('dist/nineteen-project/browser', /main-[a-zA-Z0-9]{8}\.js/); } diff --git a/tests/legacy-cli/e2e/tests/vite/reuse-dep-optimization-cache.ts b/tests/e2e/tests/vite/reuse-dep-optimization-cache.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/reuse-dep-optimization-cache.ts rename to tests/e2e/tests/vite/reuse-dep-optimization-cache.ts diff --git a/tests/e2e/tests/vite/ssr-base-href.ts b/tests/e2e/tests/vite/ssr-base-href.ts new file mode 100644 index 000000000000..140f2582689a --- /dev/null +++ b/tests/e2e/tests/vite/ssr-base-href.ts @@ -0,0 +1,48 @@ +import assert from 'node:assert'; +import { ng } from '../../utils/process'; +import { replaceInFile } from '../../utils/fs'; +import { installWorkspacePackages, uninstallPackage } from '../../utils/packages'; +import { ngServe, updateJsonFile, useSha } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; + +export default async function () { + assert( + getGlobalVariable('argv')['esbuild'], + 'This test should not be called in the Webpack suite.', + ); + + await uninstallPackage('@angular/ssr'); + await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); + await useSha(); + await installWorkspacePackages(); + + await updateJsonFile('angular.json', (json) => { + json.projects['test-project'].architect.build.options['baseHref'] = '/base'; + }); + + await replaceInFile( + 'src/server.ts', + /express\(\);/, + `express(); + + app.use('/ping', (req, res) => { + return res.json({ pong: true }); + });`, + ); + + const port = await ngServe(); + + // Angular application and bundled should be affected by baseHref + await matchResponse(`http://localhost:${port}/base`, /ng-server-context/); + await matchResponse(`http://localhost:${port}/base/main.js`, /App/); + + // Server endpoint should not be affected by baseHref + await matchResponse(`http://localhost:${port}/ping`, /pong/); +} + +async function matchResponse(url: string, match: RegExp): Promise { + const response = await fetch(url); + const text = await response.text(); + + assert.match(text, match); +} diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-default.ts b/tests/e2e/tests/vite/ssr-default.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/ssr-default.ts rename to tests/e2e/tests/vite/ssr-default.ts diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-entry-express.ts b/tests/e2e/tests/vite/ssr-entry-express.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/ssr-entry-express.ts rename to tests/e2e/tests/vite/ssr-entry-express.ts diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-entry-fastify.ts b/tests/e2e/tests/vite/ssr-entry-fastify.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/ssr-entry-fastify.ts rename to tests/e2e/tests/vite/ssr-entry-fastify.ts diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-entry-h3.ts b/tests/e2e/tests/vite/ssr-entry-h3.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/ssr-entry-h3.ts rename to tests/e2e/tests/vite/ssr-entry-h3.ts diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-entry-hono.ts b/tests/e2e/tests/vite/ssr-entry-hono.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/ssr-entry-hono.ts rename to tests/e2e/tests/vite/ssr-entry-hono.ts diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-error-stack.ts b/tests/e2e/tests/vite/ssr-error-stack.ts similarity index 60% rename from tests/legacy-cli/e2e/tests/vite/ssr-error-stack.ts rename to tests/e2e/tests/vite/ssr-error-stack.ts index a0d7c87bed13..8fce78b9e7ad 100644 --- a/tests/legacy-cli/e2e/tests/vite/ssr-error-stack.ts +++ b/tests/e2e/tests/vite/ssr-error-stack.ts @@ -1,22 +1,13 @@ import { doesNotMatch, match } from 'node:assert'; import { ng } from '../../utils/process'; -import { appendToFile, rimraf } from '../../utils/fs'; +import { appendToFile } from '../../utils/fs'; import { ngServe, useSha } from '../../utils/project'; -import { installWorkspacePackages } from '../../utils/packages'; -import { getGlobalVariable } from '../../utils/env'; +import { installWorkspacePackages, uninstallPackage } from '../../utils/packages'; export default async function () { - const useWebpackBuilder = !getGlobalVariable('argv')['esbuild']; - // Forcibly remove in case another test doesn't clean itself up. - await rimraf('node_modules/@angular/ssr'); - if (useWebpackBuilder) { - // `--server-routing` not supported in `browser` builder. - await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); - } else { - await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); - } - + await uninstallPackage('@angular/ssr'); + await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); await useSha(); await installWorkspacePackages(); diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts b/tests/e2e/tests/vite/ssr-new-dep-optimization.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts rename to tests/e2e/tests/vite/ssr-new-dep-optimization.ts diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-with-ssl.ts b/tests/e2e/tests/vite/ssr-with-ssl.ts similarity index 65% rename from tests/legacy-cli/e2e/tests/vite/ssr-with-ssl.ts rename to tests/e2e/tests/vite/ssr-with-ssl.ts index c4c0fd34ec75..90518080f8f3 100644 --- a/tests/legacy-cli/e2e/tests/vite/ssr-with-ssl.ts +++ b/tests/e2e/tests/vite/ssr-with-ssl.ts @@ -1,3 +1,4 @@ +import { Agent } from 'undici'; import assert from 'node:assert'; import { writeMultipleFiles } from '../../utils/fs'; import { ng, silentNg } from '../../utils/process'; @@ -41,19 +42,30 @@ export default async function () { const port = await ngServe('--ssl'); - // Verify the server is running and the API response is correct. - await validateResponse('/main.js', /bootstrapApplication/); - await validateResponse('/home', /home works/); - - async function validateResponse(pathname: string, match: RegExp): Promise { - try { - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - const response = await fetch(new URL(pathname, `https://localhost:${port}`)); - const text = await response.text(); - assert.match(text, match); - assert.equal(response.status, 200); - } finally { - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '1'; - } + // http 2 + await validateResponse('/main.js', /bootstrapApplication/, true); + await validateResponse('/home', /home works/, true); + + // http 1.1 + await validateResponse('/main.js', /bootstrapApplication/, false); + await validateResponse('/home', /home works/, false); + + async function validateResponse( + pathname: string, + match: RegExp, + allowH2: boolean, + ): Promise { + const response = await fetch(new URL(pathname, `https://localhost:${port}`), { + dispatcher: new Agent({ + connect: { + allowH2, + rejectUnauthorized: false, + }, + }), + }); + + const text = await response.text(); + assert.match(text, match); + assert.equal(response.status, 200); } } diff --git a/tests/e2e/tests/vitest/browser-no-globals.ts b/tests/e2e/tests/vitest/browser-no-globals.ts new file mode 100644 index 000000000000..b25f8168c5f7 --- /dev/null +++ b/tests/e2e/tests/vitest/browser-no-globals.ts @@ -0,0 +1,31 @@ +import assert from 'node:assert/strict'; +import { writeFile } from '../../utils/fs'; +import { installPackage } from '../../utils/packages'; +import { ng } from '../../utils/process'; +import { applyVitestBuilder } from '../../utils/vitest'; + +/** + * Allow `vitest` import in browser mode. + * @see https://github.com/angular/angular-cli/issues/31745 + */ +export default async function (): Promise { + await applyVitestBuilder(); + + await installPackage('playwright@1'); + await installPackage('@vitest/browser-playwright@4'); + + await writeFile( + 'src/app/app.spec.ts', + ` + import { test, expect } from 'vitest'; + + test('should pass', () => { + expect(true).toBe(true); + }); + `, + ); + + const { stdout } = await ng('test', '--browsers', 'ChromiumHeadless'); + + assert.match(stdout, /1 passed/, 'Expected 1 tests to pass.'); +} diff --git a/tests/e2e/tests/vitest/browser-playwright.ts b/tests/e2e/tests/vitest/browser-playwright.ts new file mode 100644 index 000000000000..fa9ec43aabf3 --- /dev/null +++ b/tests/e2e/tests/vitest/browser-playwright.ts @@ -0,0 +1,32 @@ +import assert from 'node:assert/strict'; +import { applyVitestBuilder } from '../../utils/vitest'; +import { ng } from '../../utils/process'; +import { installPackage } from '../../utils/packages'; +import { writeFile } from '../../utils/fs'; + +export default async function (): Promise { + await applyVitestBuilder(); + await installPackage('playwright@1'); + await installPackage('@vitest/browser-playwright@4'); + await ng('generate', 'component', 'my-comp'); + + await writeFile( + 'src/setup1.ts', + ` + import { getTestBed } from '@angular/core/testing'; + + getTestBed().configureTestingModule({}); + `, + ); + + const { stdout } = await ng( + 'test', + '--no-watch', + '--browsers', + 'chromiumHeadless', + '--setup-files', + 'src/setup1.ts', + ); + + assert.match(stdout, /2 passed/, 'Expected 2 tests to pass.'); +} diff --git a/tests/e2e/tests/vitest/browser-webdriverio.ts b/tests/e2e/tests/vitest/browser-webdriverio.ts new file mode 100644 index 000000000000..4ea1b913c3b0 --- /dev/null +++ b/tests/e2e/tests/vitest/browser-webdriverio.ts @@ -0,0 +1,33 @@ +import assert from 'node:assert/strict'; +import { applyVitestBuilder } from '../../utils/vitest'; +import { ng } from '../../utils/process'; +import { installPackage } from '../../utils/packages'; +import { writeFile } from '../../utils/fs'; + +export default async function (): Promise { + await applyVitestBuilder(); + await installPackage('webdriverio@9'); + await installPackage('@vitest/browser-webdriverio@4'); + + await ng('generate', 'component', 'my-comp'); + + await writeFile( + 'src/setup1.ts', + ` + import { getTestBed } from '@angular/core/testing'; + + getTestBed().configureTestingModule({}); + `, + ); + + const { stdout } = await ng( + 'test', + '--no-watch', + '--browsers', + 'chromeHeadless', + '--setup-files', + 'src/setup1.ts', + ); + + assert.match(stdout, /2 passed/, 'Expected 2 tests to pass.'); +} diff --git a/tests/e2e/tests/vitest/component.ts b/tests/e2e/tests/vitest/component.ts new file mode 100644 index 000000000000..421587892196 --- /dev/null +++ b/tests/e2e/tests/vitest/component.ts @@ -0,0 +1,12 @@ +import assert from 'node:assert/strict'; +import { applyVitestBuilder } from '../../utils/vitest'; +import { ng } from '../../utils/process'; + +export default async function (): Promise { + await applyVitestBuilder(); + await ng('generate', 'component', 'my-comp'); + + const { stdout } = await ng('test'); + + assert.match(stdout, /2 passed/, 'Expected 2 tests to pass.'); +} diff --git a/tests/e2e/tests/vitest/include.ts b/tests/e2e/tests/vitest/include.ts new file mode 100644 index 000000000000..4585194ef3c2 --- /dev/null +++ b/tests/e2e/tests/vitest/include.ts @@ -0,0 +1,14 @@ +import assert from 'node:assert/strict'; +import { applyVitestBuilder } from '../../utils/vitest'; +import { ng } from '../../utils/process'; +import path from 'node:path'; + +export default async function (): Promise { + await applyVitestBuilder(); + + const { stdout: stdout1 } = await ng('test', '--include', path.resolve('src/app/app.spec.ts')); + assert.match(stdout1, /1 passed/, 'Expected 1 test to pass with absolute include.'); + + const { stdout: stdout2 } = await ng('test', '--include', path.normalize('src/app/app.spec.ts')); + assert.match(stdout2, /1 passed/, 'Expected 1 test to pass with relative include.'); +} diff --git a/tests/e2e/tests/vitest/larger-project-coverage.ts b/tests/e2e/tests/vitest/larger-project-coverage.ts new file mode 100644 index 000000000000..3594bdc7dfee --- /dev/null +++ b/tests/e2e/tests/vitest/larger-project-coverage.ts @@ -0,0 +1,111 @@ +import { ng } from '../../utils/process'; +import { applyVitestBuilder } from '../../utils/vitest'; +import assert from 'node:assert'; +import { installPackage } from '../../utils/packages'; +import { updateJsonFile } from '../../utils/project'; +import { readFile } from '../../utils/fs'; + +export default async function () { + await applyVitestBuilder(); + await installPackage('@vitest/coverage-v8@4'); + + // Add coverage and threshold configuration to ensure coverage is calculated. + // Use the 'json' reporter to get a machine-readable output for assertions. + await updateJsonFile('angular.json', (json) => { + const project = Object.values(json['projects'])[0] as any; + const test = project['architect']['test']; + test.options = { + coverageReporters: ['json', 'text'], + coverageThresholds: { + // The generated component/service/pipe files are basic + // A threshold of 75 should be safe. + statements: 75, + }, + }; + }); + + const artifactCount = 100; + const initialTestCount = 1; + const generatedFiles = await generateArtifactsInBatches(artifactCount); + + const totalTests = initialTestCount + artifactCount; + const expectedMessage = new RegExp(`${totalTests} passed`); + const coverageJsonPath = 'coverage/test-project/coverage-final.json'; + + // Run tests in default (JSDOM) mode with coverage + const { stdout: jsdomStdout } = await ng('test', '--no-watch', '--coverage'); + assert.match(jsdomStdout, expectedMessage, `Expected ${totalTests} tests to pass in JSDOM mode.`); + + // Assert that every generated file is in the coverage report by reading the JSON output. + const jsdomSummary = JSON.parse(await readFile(coverageJsonPath)); + const jsdomSummaryKeys = Object.keys(jsdomSummary); + for (const file of generatedFiles) { + const found = jsdomSummaryKeys.some((key) => key.endsWith(file)); + assert.ok(found, `Expected ${file} to be in the JSDOM coverage report.`); + } + + // Setup for browser mode + await installPackage('playwright@1'); + await installPackage('@vitest/browser-playwright@4'); + + // Run tests in browser mode with coverage + const { stdout: browserStdout } = await ng( + 'test', + '--no-watch', + '--coverage', + '--browsers', + 'ChromiumHeadless', + ); + assert.match( + browserStdout, + expectedMessage, + `Expected ${totalTests} tests to pass in browser mode.`, + ); + + // Assert that every generated file is in the coverage report for browser mode. + const browserSummary = JSON.parse(await readFile(coverageJsonPath)); + const browserSummaryKeys = Object.keys(browserSummary); + for (const file of generatedFiles) { + const found = browserSummaryKeys.some((key) => key.endsWith(file)); + assert.ok(found, `Expected ${file} to be in the browser coverage report.`); + } +} + +async function generateArtifactsInBatches(artifactCount: number): Promise { + const BATCH_SIZE = 5; + const generatedFiles: string[] = []; + let commands: Promise[] = []; + + for (let i = 0; i < artifactCount; i++) { + const type = i % 3; + const name = `test-artifact-${i}`; + + let generateType: string; + let fileSuffix: string; + + switch (type) { + case 0: + generateType = 'component'; + fileSuffix = '.ts'; + break; + case 1: + generateType = 'service'; + fileSuffix = '.ts'; + break; + default: + generateType = 'pipe'; + fileSuffix = '-pipe.ts'; + break; + } + + commands.push(ng('generate', generateType, name, '--skip-tests=false')); + generatedFiles.push(`${name}${fileSuffix}`); + + if (commands.length === BATCH_SIZE || i === artifactCount - 1) { + await Promise.all(commands); + commands = []; + } + } + + return generatedFiles; +} diff --git a/tests/e2e/tests/vitest/larger-project.ts b/tests/e2e/tests/vitest/larger-project.ts new file mode 100644 index 000000000000..61b18b102c4b --- /dev/null +++ b/tests/e2e/tests/vitest/larger-project.ts @@ -0,0 +1,70 @@ +import { ng } from '../../utils/process'; +import { applyVitestBuilder } from '../../utils/vitest'; +import assert from 'node:assert'; +import { installPackage } from '../../utils/packages'; +import { exec } from '../../utils/process'; + +export default async function () { + await applyVitestBuilder(); + + const artifactCount = 100; + // A new project starts with 1 test file (app.spec.ts) + // Each generated artifact will add one more test file. + const initialTestCount = 1; + + await generateArtifactsInBatches(artifactCount); + + const totalTests = initialTestCount + artifactCount; + const expectedMessage = new RegExp(`${totalTests} passed`); + + // Run tests in default (JSDOM) mode + const { stdout: jsdomStdout } = await ng('test', '--no-watch'); + assert.match(jsdomStdout, expectedMessage, `Expected ${totalTests} tests to pass in JSDOM mode.`); + + // Setup for browser mode + await installPackage('playwright@1'); + await installPackage('@vitest/browser-playwright@4'); + + // Run tests in browser mode + const { stdout: browserStdout } = await ng( + 'test', + '--no-watch', + '--browsers', + 'ChromiumHeadless', + ); + assert.match( + browserStdout, + expectedMessage, + `Expected ${totalTests} tests to pass in browser mode.`, + ); +} + +async function generateArtifactsInBatches(artifactCount: number): Promise { + const BATCH_SIZE = 5; + let commands: Promise[] = []; + + for (let i = 0; i < artifactCount; i++) { + const type = i % 3; + const name = `test-artifact-${i}`; + let generateType: string; + + switch (type) { + case 0: + generateType = 'component'; + break; + case 1: + generateType = 'service'; + break; + default: + generateType = 'pipe'; + break; + } + + commands.push(ng('generate', generateType, name, '--skip-tests=false')); + + if (commands.length === BATCH_SIZE || i === artifactCount - 1) { + await Promise.all(commands); + commands = []; + } + } +} diff --git a/tests/e2e/tests/vitest/runner-config-path.ts b/tests/e2e/tests/vitest/runner-config-path.ts new file mode 100644 index 000000000000..456469b2d6a4 --- /dev/null +++ b/tests/e2e/tests/vitest/runner-config-path.ts @@ -0,0 +1,33 @@ +import assert from 'node:assert/strict'; +import path from 'node:path'; +import { writeMultipleFiles } from '../../utils/fs'; +import { ng } from '../../utils/process'; +import { applyVitestBuilder } from '../../utils/vitest'; + +export default async function (): Promise { + await applyVitestBuilder(); + + // Create a custom Vitest configuration file. + const customConfigPath = 'vitest.custom.mjs'; + await writeMultipleFiles({ + [customConfigPath]: ` + import { defineConfig } from 'vitest/config'; + export default defineConfig({ + test: { + // A unique option to confirm this file is being used. + passWithNoTests: true, + }, + }); + `, + }); + + const absoluteConfigPath = path.resolve(customConfigPath); + const { stdout } = await ng('test', `--runner-config=${absoluteConfigPath}`); + + // Assert that the CLI logs the use of the specified configuration file. + assert.match( + stdout, + /vitest\.custom\.mjs/, + 'Expected a message confirming the use of the custom config file.', + ); +} diff --git a/tests/e2e/tests/vitest/snapshot.ts b/tests/e2e/tests/vitest/snapshot.ts new file mode 100644 index 000000000000..f099ba6f8d30 --- /dev/null +++ b/tests/e2e/tests/vitest/snapshot.ts @@ -0,0 +1,79 @@ +import { ng } from '../../utils/process'; +import { replaceInFile, readFile, writeFile } from '../../utils/fs'; +import { applyVitestBuilder } from '../../utils/vitest'; +import assert from 'node:assert/strict'; +import { stripVTControlCharacters } from 'node:util'; + +export default async function () { + // Set up the test project to use the vitest runner + await applyVitestBuilder(); + + // Add snapshot assertions to the test file + await replaceInFile( + 'src/app/app.spec.ts', + `describe('App', () => {`, + ` +describe('App', () => { + it('should match file snapshot', () => { + const fixture = TestBed.createComponent(App); + const app = fixture.componentInstance; + expect((app as any).title()).toMatchSnapshot(); + }); + + it('should match inline snapshot', () => { + const fixture = TestBed.createComponent(App); + const app = fixture.componentInstance; + expect((app as any).title()).toMatchInlineSnapshot(); + }); +`, + ); + + // Synchronize line endings for Vitest which currently may miscalculate line counts + // with mixed file line endings. + let content = await readFile('src/app/app.spec.ts'); + content = content.replace(/\r\n/g, '\n'); + content = content.replace(/\r/g, '\n'); + await writeFile('src/app/app.spec.ts', content); + + // First run: create snapshots + const { stdout: firstRunStdout } = await ng('test'); + assert.match( + stripVTControlCharacters(firstRunStdout), + /Snapshots\s+2 written/, + 'Snapshots were not written on the first run.', + ); + + const specContent = await readFile('src/app/app.spec.ts'); + assert.match( + specContent, + /toMatchInlineSnapshot\(`"test-project"`\)/, + 'Inline snapshot was not written to the spec file.', + ); + + const snapshotContent = await readFile('src/app/__snapshots__/app.spec.ts.snap'); + assert.match( + snapshotContent, + /exports\[`App > should match file snapshot 1`\] = `"test-project"`;/, + 'File snapshot was not written to disk.', + ); + + // Second run: tests should pass with existing snapshots + await ng('test'); + + // Modify component to break snapshots + await replaceInFile('src/app/app.ts', 'test-project', 'Snapshot is broken!'); + + // Third run: tests should fail with snapshot mismatch + await assert.rejects( + () => ng('test'), + (err: any) => { + assert.match( + stripVTControlCharacters(err.toString()), + /Snapshots\s+2 failed/, + 'Expected snapshot mismatch error, but a different error occurred.', + ); + return true; + }, + 'Snapshot mismatch did not cause the test to fail.', + ); +} diff --git a/tests/e2e/tests/vitest/tslib-resolution.ts b/tests/e2e/tests/vitest/tslib-resolution.ts new file mode 100644 index 000000000000..759d5e2b5728 --- /dev/null +++ b/tests/e2e/tests/vitest/tslib-resolution.ts @@ -0,0 +1,71 @@ +import { writeFile } from '../../utils/fs'; +import { installPackage } from '../../utils/packages'; +import { ng } from '../../utils/process'; +import { applyVitestBuilder } from '../../utils/vitest'; +import assert from 'node:assert'; + +export default async function () { + await applyVitestBuilder(); + await installPackage('playwright@1'); + await installPackage('@vitest/browser-playwright@4'); + + // Add a custom decorator to trigger tslib usage + await writeFile( + 'src/app/custom-decorator.ts', + ` + export function MyDecorator() { + return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { + // do nothing + }; + } + `, + ); + + // Add a service that uses the decorator + await writeFile( + 'src/app/test.service.ts', + ` + import { Injectable } from '@angular/core'; + import { MyDecorator } from './custom-decorator'; + + @Injectable({ + providedIn: 'root' + }) + export class TestService { + @MyDecorator() + myMethod() { + return true; + } + } + `, + ); + + // Add a test for the service + await writeFile( + 'src/app/test.service.spec.ts', + ` + import { TestBed } from '@angular/core/testing'; + import { TestService } from './test.service'; + + describe('TestService', () => { + let service: TestService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(TestService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); + + it('myMethod should return true', () => { + expect(service.myMethod()).toBe(true); + }); + }); + `, + ); + + const { stdout } = await ng('test', '--no-watch', '--browsers', 'chromiumHeadless'); + assert.match(stdout, /2 passed/, 'Expected 2 tests to pass.'); +} diff --git a/tests/legacy-cli/e2e/tests/web-test-runner/basic.ts b/tests/e2e/tests/web-test-runner/basic.ts similarity index 100% rename from tests/legacy-cli/e2e/tests/web-test-runner/basic.ts rename to tests/e2e/tests/web-test-runner/basic.ts diff --git a/tests/legacy-cli/e2e/utils/BUILD.bazel b/tests/e2e/utils/BUILD.bazel similarity index 76% rename from tests/legacy-cli/e2e/utils/BUILD.bazel rename to tests/e2e/utils/BUILD.bazel index 2cf52b55a2ab..8082ab9d97c4 100644 --- a/tests/legacy-cli/e2e/utils/BUILD.bazel +++ b/tests/e2e/utils/BUILD.bazel @@ -7,21 +7,20 @@ ts_project( testonly = True, srcs = glob(["**/*.ts"]), data = [ - "//tests/legacy-cli/e2e/ng-snapshot", + "//tests/e2e/ng-snapshot", ], deps = [ "//:node_modules/@types/jasmine", "//:node_modules/@types/node", "//:node_modules/@types/semver", - "//:node_modules/ansi-colors", "//:node_modules/fast-glob", - "//:node_modules/npm", "//:node_modules/protractor", + "//:node_modules/puppeteer", "//:node_modules/semver", - "//:node_modules/tar", "//:node_modules/verdaccio", "//:node_modules/verdaccio-auth-memory", - "//tests:node_modules/rxjs", + "//tests:node_modules/@types/tar-stream", + "//tests:node_modules/tar-stream", "//tests:node_modules/tree-kill", ], ) diff --git a/tests/legacy-cli/e2e/utils/assets.ts b/tests/e2e/utils/assets.ts similarity index 83% rename from tests/legacy-cli/e2e/utils/assets.ts rename to tests/e2e/utils/assets.ts index d421086c1b9e..153fdaccc6de 100644 --- a/tests/legacy-cli/e2e/utils/assets.ts +++ b/tests/e2e/utils/assets.ts @@ -5,7 +5,7 @@ import { getGlobalVariable } from './env'; import { resolve } from 'node:path'; import { copyFile } from './fs'; import { installWorkspacePackages, setRegistry } from './packages'; -import { useBuiltPackagesVersions } from './project'; +import { getTestProjectDir, useBuiltPackagesVersions } from './project'; export function assetDir(assetName: string) { return join(__dirname, '../e2e/assets', assetName); @@ -21,7 +21,7 @@ export function copyProjectAsset(assetName: string, to?: string) { export function copyAssets(assetName: string, to?: string) { const seed = +Date.now(); - const tempRoot = join(getGlobalVariable('projects-root'), 'assets', assetName + '-' + seed); + const tempRoot = join(getTestAssetsDir(), assetName + '-' + seed); const root = assetDir(assetName); return Promise.resolve() @@ -30,9 +30,7 @@ export function copyAssets(assetName: string, to?: string) { return allFiles.reduce((promise, filePath) => { const toPath = - to !== undefined - ? resolve(getGlobalVariable('projects-root'), 'test-project', to, filePath) - : join(tempRoot, filePath); + to !== undefined ? resolve(getTestProjectDir(), to, filePath) : join(tempRoot, filePath); return promise .then(() => copyFile(join(root, filePath), toPath)) @@ -65,3 +63,7 @@ export async function createProjectFromAsset( return () => setRegistry(true /** useTestRegistry */); } + +export function getTestAssetsDir(): string { + return join(getGlobalVariable('projects-root'), 'assets'); +} diff --git a/tests/legacy-cli/e2e/utils/env.ts b/tests/e2e/utils/env.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/env.ts rename to tests/e2e/utils/env.ts diff --git a/tests/legacy-cli/e2e/utils/fs.ts b/tests/e2e/utils/fs.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/fs.ts rename to tests/e2e/utils/fs.ts diff --git a/tests/legacy-cli/e2e/utils/git.ts b/tests/e2e/utils/git.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/git.ts rename to tests/e2e/utils/git.ts diff --git a/tests/legacy-cli/e2e/utils/jest.ts b/tests/e2e/utils/jest.ts similarity index 85% rename from tests/legacy-cli/e2e/utils/jest.ts rename to tests/e2e/utils/jest.ts index 904cc6f903d6..5dc1f0efe464 100644 --- a/tests/legacy-cli/e2e/utils/jest.ts +++ b/tests/e2e/utils/jest.ts @@ -4,11 +4,11 @@ import { updateJsonFile } from './project'; /** Updates the `test` builder in the current workspace to use Jest with the given options. */ export async function applyJestBuilder( options: {} = { + polyfills: [], tsConfig: 'tsconfig.spec.json', - polyfills: ['zone.js', 'zone.js/testing'], }, ): Promise { - await silentNpm('install', 'jest@29.5.0', 'jest-environment-jsdom@29.5.0', '--save-dev'); + await silentNpm('install', 'jest@30.2.0', 'jest-environment-jsdom@30.2.0', '--save-dev'); await updateJsonFile('angular.json', (json) => { const projects = Object.values(json['projects']); diff --git a/tests/e2e/utils/network.ts b/tests/e2e/utils/network.ts new file mode 100644 index 000000000000..48602f0000d2 --- /dev/null +++ b/tests/e2e/utils/network.ts @@ -0,0 +1,30 @@ +import { createServer } from 'node:net'; + +/** + * Finds an available network port on the loopback interface (127.0.0.1). + * This is useful for tests that need to bind to a free port to avoid conflicts. + * Explicitly binds to IPv4 localhost to avoid firewall prompts, IPv6 binding issues, and ensure consistency. + * + * @returns A promise that resolves with an available port number. + */ +export function findFreePort(): Promise { + return new Promise((resolve, reject) => { + const srv = createServer(); + srv.once('listening', () => { + const address = srv.address(); + if (!address || typeof address === 'string') { + // Should not happen with TCP, but good for type safety + srv.close(() => reject(new Error('Failed to get server address'))); + return; + } + const port = address.port; + srv.close((e) => (e ? reject(e) : resolve(port))); + }); + + // If an error happens (e.g. during bind), the server is not listening, + // so we should not call close(). + srv.once('error', (e) => reject(e)); + // Explicitly listen on IPv4 localhost to avoid firewall prompts, IPv6 binding issues, and ensure consistency. + srv.listen(0, '127.0.0.1'); + }); +} diff --git a/tests/legacy-cli/e2e/utils/packages.ts b/tests/e2e/utils/packages.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/packages.ts rename to tests/e2e/utils/packages.ts diff --git a/tests/legacy-cli/e2e/utils/process.ts b/tests/e2e/utils/process.ts similarity index 93% rename from tests/legacy-cli/e2e/utils/process.ts rename to tests/e2e/utils/process.ts index 3cd6c77bc187..91216843086a 100644 --- a/tests/legacy-cli/e2e/utils/process.ts +++ b/tests/e2e/utils/process.ts @@ -1,10 +1,9 @@ -import * as ansiColors from 'ansi-colors'; import { spawn, SpawnOptions } from 'node:child_process'; import * as child_process from 'node:child_process'; -import { concat, defer, EMPTY, from, lastValueFrom, catchError, repeat } from 'rxjs'; import { getGlobalVariable, getGlobalVariablesEnv } from './env'; import treeKill from 'tree-kill'; import { delimiter, join, resolve } from 'node:path'; +import { stripVTControlCharacters, styleText } from 'node:util'; interface ExecOptions { silent?: boolean; @@ -29,9 +28,6 @@ export type ProcessOutput = { }; function _exec(options: ExecOptions, cmd: string, args: string[]): Promise { - // Create a separate instance to prevent unintended global changes to the color configuration - const colors = ansiColors.create(); - const cwd = options.cwd ?? process.cwd(); const env = options.env ?? process.env; @@ -56,8 +52,10 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise `"${x}"`).join(' ')}\`${flags}...`)); - console.log(colors.blue(`CWD: ${cwd}`)); + console.log( + styleText(['blue'], `Running \`${cmd} ${args.map((x) => `"${x}"`).join(' ')}\`${flags}...`), + ); + console.log(styleText(['blue'], `CWD: ${cwd}`)); const spawnOptions: SpawnOptions = { cwd, @@ -122,7 +120,7 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise line !== '') - .forEach((line) => console.error(colors.yellow(' ' + line))); + .forEach((line) => console.error(styleText(['yellow'], ' ' + line))); }); childProcess.on('close', (code) => { @@ -236,14 +234,14 @@ export async function waitForAnyProcessOutputToMatch( childProcess.stdout!.on('data', (data: Buffer) => { stdout += data.toString(); - if (stdout.match(match)) { + if (stripVTControlCharacters(stdout).match(match)) { resolve({ stdout, stderr }); } }); childProcess.stderr!.on('data', (data: Buffer) => { stderr += data.toString(); - if (stderr.match(match)) { + if (stripVTControlCharacters(stderr).match(match)) { resolve({ stdout, stderr }); } }); @@ -311,7 +309,7 @@ export async function execAndCaptureError( } } -export function execAndWaitForOutputToMatch( +export async function execAndWaitForOutputToMatch( cmd: string, args: string[], match: RegExp, @@ -323,15 +321,19 @@ export function execAndWaitForOutputToMatch( // happened just before the build (e.g. `git clean`). // This seems to be due to host file system differences, see // https://nodejs.org/docs/latest/api/fs.html#fs_caveats - return lastValueFrom( - concat( - from(_exec({ waitForMatch: match, env }, cmd, args)), - defer(() => waitForAnyProcessOutputToMatch(match, 2500)).pipe( - repeat(20), - catchError(() => EMPTY), - ), - ), - ); + const maxRetries = 20; + let lastResult = await _exec({ waitForMatch: match, env }, cmd, args); + + for (let i = 0; i < maxRetries; i++) { + try { + lastResult = await waitForAnyProcessOutputToMatch(match, 2500); + } catch { + // If we timeout (no new match found), we assume the process is stable. + break; + } + } + + return lastResult; } else { return _exec({ waitForMatch: match, env }, cmd, args); } diff --git a/tests/legacy-cli/e2e/utils/project.ts b/tests/e2e/utils/project.ts similarity index 95% rename from tests/legacy-cli/e2e/utils/project.ts rename to tests/e2e/utils/project.ts index ea764bb20314..58e249d19895 100644 --- a/tests/legacy-cli/e2e/utils/project.ts +++ b/tests/e2e/utils/project.ts @@ -7,6 +7,7 @@ import { gitCommit } from './git'; import { findFreePort } from './network'; import { installWorkspacePackages, PkgInfo } from './packages'; import { execAndWaitForOutputToMatch, git, ng } from './process'; +import { join } from 'node:path'; export function updateJsonFile(filePath: string, fn: (json: any) => any | void) { return readFile(filePath).then((tsConfigJson) => { @@ -118,7 +119,7 @@ export async function useSha(): Promise { if (missingSnapshots.length > 0) { throw new Error( 'e2e test with --ng-snapshots requires all angular packages be ' + - 'listed in tests/legacy-cli/e2e/ng-snapshot/package.json.\nErrors:\n' + + 'listed in tests/e2e/ng-snapshot/package.json.\nErrors:\n' + missingSnapshots.join('\n '), ); } @@ -191,7 +192,11 @@ export async function useCIChrome(projectName: string, projectDir = ''): Promise return updateJsonFile('angular.json', (workspaceJson) => { const project = workspaceJson.projects[projectName]; const appTargets = project.targets || project.architect; - appTargets.test.options.browsers = 'ChromeHeadlessNoSandbox'; + if (appTargets.test.builder === '@angular/build:unit-test') { + appTargets.test.options.browsers = ['ChromeHeadlessNoSandbox']; + } else { + appTargets.test.options.browsers = 'ChromeHeadlessNoSandbox'; + } }); } @@ -266,3 +271,7 @@ export function updateServerFileForEsbuild(filepath: string): Promise { `, ); } + +export function getTestProjectDir(): string { + return join(getGlobalVariable('projects-root'), 'test-project'); +} diff --git a/tests/e2e/utils/puppeteer.ts b/tests/e2e/utils/puppeteer.ts new file mode 100644 index 000000000000..8cab9f2ddef6 --- /dev/null +++ b/tests/e2e/utils/puppeteer.ts @@ -0,0 +1,90 @@ +import { type Page, launch } from 'puppeteer'; +import { execAndWaitForOutputToMatch, killAllProcesses } from './process'; +import { stripVTControlCharacters } from 'node:util'; + +export interface BrowserTestOptions { + project?: string; + configuration?: string; + baseUrl?: string; + checkFn?: (page: Page) => Promise; + expectedTitleText?: string; +} + +export async function executeBrowserTest(options: BrowserTestOptions = {}) { + let url = options.baseUrl; + let hasStartedServer = false; + + try { + if (!url) { + // Start serving and find address (1 - Webpack; 2 - Vite) + const match = /(?:open your browser on|Local:)\s+(http:\/\/localhost:\d+\/)/; + const serveArgs = ['serve', '--port=0']; + if (options.project) { + serveArgs.push(options.project); + } + if (options.configuration) { + serveArgs.push(`--configuration=${options.configuration}`); + } + + const { stdout } = await execAndWaitForOutputToMatch('ng', serveArgs, match, { + ...process.env, + 'NO_COLOR': '1', + }); + url = stripVTControlCharacters(stdout).match(match)?.[1]; + if (!url) { + throw new Error('Could not find serving URL'); + } + hasStartedServer = true; + } + + const browser = await launch({ + executablePath: process.env['CHROME_BIN'], + headless: true, + args: ['--no-sandbox'], + }); + try { + const page = await browser.newPage(); + + // Capture errors + const errors: string[] = []; + page.on('console', (msg) => { + if (msg.type() === 'error') { + errors.push(msg.text()); + } + }); + page.on('pageerror', (err) => { + errors.push(err.toString()); + }); + + await page.goto(url); + + if (options.checkFn) { + await options.checkFn(page); + } else { + // Default check: verify h1 content and no browser errors + const expectedText = options.expectedTitleText || 'Hello, test-project'; + + // Wait for the h1 element to appear and contain the expected text + await page.waitForFunction( + (selector: string, text: string) => { + const doc = (globalThis as any).document; + return doc.querySelector(selector)?.textContent?.includes(text); + }, + { timeout: 10000 }, // Max 10 seconds wait time + 'h1', + expectedText, + ); + } + + if (errors.length > 0) { + throw new Error(`Browser console errors detected:\n${errors.join('\n')}`); + } + } finally { + await browser.close(); + } + } finally { + if (hasStartedServer) { + await killAllProcesses(); + } + } +} diff --git a/tests/legacy-cli/e2e/utils/registry.ts b/tests/e2e/utils/registry.ts similarity index 72% rename from tests/legacy-cli/e2e/utils/registry.ts rename to tests/e2e/utils/registry.ts index 1bd3084d4f48..fd557c116120 100644 --- a/tests/legacy-cli/e2e/utils/registry.ts +++ b/tests/e2e/utils/registry.ts @@ -1,9 +1,10 @@ import { ChildProcess, fork } from 'node:child_process'; import { on } from 'node:events'; +import { mkdir } from 'node:fs/promises'; import { join } from 'node:path'; import { getGlobalVariable } from './env'; import { writeFile, readFile } from './fs'; -import { mktempd } from './utils'; +import { existsSync } from 'node:fs'; export async function createNpmRegistry( port: number, @@ -11,14 +12,18 @@ export async function createNpmRegistry( withAuthentication = false, ): Promise { // Setup local package registry - const registryPath = await mktempd('angular-cli-e2e-registry-'); + const registryPath = join(getGlobalVariable('tmp-root'), 'registry'); + if (!existsSync(registryPath)) { + await mkdir(registryPath); + } + + const configFileName = withAuthentication ? 'verdaccio_auth.yaml' : 'verdaccio.yaml'; + let configContent = await readFile(join(__dirname, '../', configFileName)); + configContent = configContent + .replace(/\$\{HTTP_PORT\}/g, String(port)) + .replace(/\$\{HTTPS_PORT\}/g, String(httpsPort)); + const configPath = join(registryPath, configFileName); - let configContent = await readFile( - join(__dirname, '../', withAuthentication ? 'verdaccio_auth.yaml' : 'verdaccio.yaml'), - ); - configContent = configContent.replace(/\$\{HTTP_PORT\}/g, String(port)); - configContent = configContent.replace(/\$\{HTTPS_PORT\}/g, String(httpsPort)); - const configPath = join(registryPath, 'verdaccio.yaml'); await writeFile(configPath, configContent); const verdaccioServer = fork(require.resolve('verdaccio/bin/verdaccio'), ['-c', configPath]); @@ -44,7 +49,7 @@ export async function createNpmRegistry( // Token was generated using `echo -n 'testing:s3cret' | openssl base64`. const VALID_TOKEN = `dGVzdGluZzpzM2NyZXQ=`; -export function createNpmConfigForAuthentication( +export async function createNpmConfigForAuthentication( /** * When true, the authentication token will be scoped to the registry URL. * @example @@ -65,17 +70,30 @@ export function createNpmConfigForAuthentication( const token = invalidToken ? `invalid=` : VALID_TOKEN; const registry = (getGlobalVariable('package-secure-registry') as string).replace(/^\w+:/, ''); - return writeFile( + await writeFile( '.npmrc', scopedAuthentication ? ` - ${registry}:_auth="${token}" - registry=http:${registry} - ` +${registry}/:_auth="${token}" +registry=http:${registry} +` + : ` +_auth="${token}" +registry=http:${registry} +`, + ); + + await writeFile( + '.yarnrc', + scopedAuthentication + ? ` +${registry}/:_auth "${token}" +registry http:${registry} +` : ` - _auth="${token}" - registry=http:${registry} - `, +_auth "${token}" +registry http:${registry} +`, ); } diff --git a/tests/legacy-cli/e2e/utils/tar.ts b/tests/e2e/utils/tar.ts similarity index 50% rename from tests/legacy-cli/e2e/utils/tar.ts rename to tests/e2e/utils/tar.ts index 77239c74eb0f..d78f47762337 100644 --- a/tests/legacy-cli/e2e/utils/tar.ts +++ b/tests/e2e/utils/tar.ts @@ -8,7 +8,8 @@ import { createReadStream } from 'node:fs'; import { normalize } from 'node:path'; -import { Parser } from 'tar'; +import { createGunzip } from 'node:zlib'; +import { extract } from 'tar-stream'; /** * Extract and return the contents of a single file out of a tar file. @@ -21,20 +22,27 @@ export function extractFile(tarball: string, filePath: string): Promise const normalizedFilePath = normalize(filePath); return new Promise((resolve, reject) => { - createReadStream(tarball) - .pipe( - new Parser({ - strict: true, - filter: (p) => normalize(p) === normalizedFilePath, - onReadEntry: (entry) => { - const chunks: Buffer[] = []; - - entry.on('data', (chunk) => chunks.push(chunk)); - entry.on('error', reject); - entry.on('finish', () => resolve(Buffer.concat(chunks))); - }, - }), - ) - .on('close', () => reject(`${tarball} does not contain ${filePath}`)); + const extractor = extract(); + + extractor.on('entry', (header, stream, next) => { + if (normalize(header.name) !== normalizedFilePath) { + stream.resume(); + next(); + + return; + } + + const chunks: Buffer[] = []; + stream.on('data', (chunk) => chunks.push(chunk)); + stream.on('error', reject); + stream.on('end', () => { + resolve(Buffer.concat(chunks)); + next(); + }); + }); + + extractor.on('finish', () => reject(new Error(`'${filePath}' not found in '${tarball}'.`))); + + createReadStream(tarball).pipe(createGunzip()).pipe(extractor).on('error', reject); }); } diff --git a/tests/legacy-cli/e2e/utils/test_process.ts b/tests/e2e/utils/test_process.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/test_process.ts rename to tests/e2e/utils/test_process.ts diff --git a/tests/legacy-cli/e2e/utils/utils.ts b/tests/e2e/utils/utils.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/utils.ts rename to tests/e2e/utils/utils.ts diff --git a/tests/legacy-cli/e2e/utils/version.ts b/tests/e2e/utils/version.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/version.ts rename to tests/e2e/utils/version.ts diff --git a/tests/e2e/utils/vitest.ts b/tests/e2e/utils/vitest.ts new file mode 100644 index 000000000000..af40e66b18b1 --- /dev/null +++ b/tests/e2e/utils/vitest.ts @@ -0,0 +1,29 @@ +import { silentNpm } from './process'; +import { updateJsonFile } from './project'; + +/** Updates the `test` builder in the current workspace to use Vitest. */ +export async function applyVitestBuilder(): Promise { + // These deps matches the deps in `@schematics/angular` + await silentNpm('install', 'vitest@^4.0.8', 'jsdom@^27.1.0', '--save-dev'); + + await updateJsonFile('angular.json', (json) => { + const projects = Object.values(json['projects']); + if (projects.length !== 1) { + throw new Error( + `Expected exactly one project but found ${projects.length} projects named ${Object.keys( + json['projects'], + ).join(', ')}`, + ); + } + const project = projects[0]! as any; + + // Update to Vitest builder. + const test = project['architect']['test']; + test['builder'] = '@angular/build:unit-test'; + test['options'] = {}; + }); + + await updateJsonFile('tsconfig.spec.json', (tsconfig) => { + tsconfig['compilerOptions']['types'] = ['vitest/globals']; + }); +} diff --git a/tests/legacy-cli/e2e/utils/web-test-runner.ts b/tests/e2e/utils/web-test-runner.ts similarity index 100% rename from tests/legacy-cli/e2e/utils/web-test-runner.ts rename to tests/e2e/utils/web-test-runner.ts diff --git a/tests/legacy-cli/e2e_runner.ts b/tests/e2e_runner.ts similarity index 75% rename from tests/legacy-cli/e2e_runner.ts rename to tests/e2e_runner.ts index 051c1174a624..c7a672161b7a 100644 --- a/tests/legacy-cli/e2e_runner.ts +++ b/tests/e2e_runner.ts @@ -1,9 +1,9 @@ -import { parseArgs } from 'node:util'; -import { createConsoleLogger } from '../../packages/angular_devkit/core/node'; -import colors from 'ansi-colors'; +import { parseArgs, styleText } from 'node:util'; +import { createConsoleLogger } from '../packages/angular_devkit/core/node'; import glob from 'fast-glob'; import * as path from 'node:path'; import * as fs from 'node:fs'; +import { rm } from 'node:fs/promises'; import { getGlobalVariable, setGlobalVariable } from './e2e/utils/env'; import { gitClean } from './e2e/utils/git'; import { createNpmRegistry } from './e2e/utils/registry'; @@ -13,7 +13,8 @@ import { findFreePort } from './e2e/utils/network'; import { extractFile } from './e2e/utils/tar'; import { realpathSync } from 'node:fs'; import { PkgInfo } from './e2e/utils/packages'; -import { rm } from 'node:fs/promises'; +import { getTestProjectDir } from './e2e/utils/project'; +import { mktempd } from './e2e/utils/utils'; Error.stackTraceLimit = Infinity; @@ -30,13 +31,9 @@ Error.stackTraceLimit = Infinity; * --ng-snapshots Install angular snapshot builds in the test project. * --glob Run tests matching this glob pattern (relative to tests/e2e/). * --ignore Ignore tests matching this glob pattern. - * --reuse=/path Use a path instead of create a new project. That project should have been - * created, and npm installed. Ideally you want a project created by a previous - * run of e2e. * --nb-shards Total number of shards that this is part of. Default is 2 if --shard is * passed in. * --shard Index of this processes' shard. - * --tmpdir=path Override temporary directory to use for new projects. * --package-manager Package manager to use. * --package=path An npm package to be published before running tests * @@ -47,7 +44,7 @@ const parsed = parseArgs({ options: { 'debug': { type: 'boolean', default: !!process.env.BUILD_WORKSPACE_DIRECTORY }, 'esbuild': { type: 'boolean' }, - 'glob': { type: 'string', default: process.env.TESTBRIDGE_TEST_ONLY }, + 'glob': { type: 'string', default: 'tests/**/*.js' }, 'ignore': { type: 'string', multiple: true }, 'ng-snapshots': { type: 'boolean' }, 'ng-tag': { type: 'string' }, @@ -57,8 +54,6 @@ const parsed = parseArgs({ 'nosilent': { type: 'boolean' }, 'package': { type: 'string', multiple: true, default: ['./dist/_*.tgz'] }, 'package-manager': { type: 'string', default: 'npm' }, - 'reuse': { type: 'string' }, - 'tmpdir': { type: 'string' }, 'verbose': { type: 'boolean' }, 'nb-shards': { type: 'string' }, @@ -118,19 +113,19 @@ if (process.env.CHROME_BIN) { const logger = createConsoleLogger(argv.verbose, process.stdout, process.stderr, { info: (s) => s, debug: (s) => s, - warn: (s) => colors.bold.yellow(s), - error: (s) => colors.bold.red(s), - fatal: (s) => colors.bold.red(s), + warn: (s) => styleText(['bold', 'yellow'], s), + error: (s) => styleText(['bold', 'red'], s), + fatal: (s) => styleText(['bold', 'red'], s), }); const logStack = [logger]; function lastLogger() { - return logStack[logStack.length - 1]; + return logStack.at(-1)!; } // Under bazel the compiled file (.js) and types (.d.ts) are available. const SRC_FILE_EXT_RE = /\.js$/; -const testGlob = argv.glob?.replace(/\.ts$/, '.js') || `tests/**/*.js`; +const testGlob = (process.env.TESTBRIDGE_TEST_ONLY ?? argv.glob).replace(/\.ts$/, '.js'); const e2eRoot = path.join(__dirname, 'e2e'); const allSetups = glob.sync(`setup/**/*.js`, { cwd: e2eRoot }).sort(); @@ -226,57 +221,68 @@ process.env.CHROME_BIN = path.resolve(process.env.CHROME_BIN!); process.env.CHROME_PATH = path.resolve(process.env.CHROME_PATH!); process.env.CHROMEDRIVER_BIN = path.resolve(process.env.CHROMEDRIVER_BIN!); -Promise.all([findFreePort(), findFreePort(), findPackageTars()]) - .then(async ([httpPort, httpsPort, packageTars]) => { - setGlobalVariable('package-registry', 'http://localhost:' + httpPort); - setGlobalVariable('package-secure-registry', 'http://localhost:' + httpsPort); - setGlobalVariable('package-tars', packageTars); - - // NPM registries for the lifetime of the test execution - const registryProcess = await createNpmRegistry(httpPort, httpPort); - const secureRegistryProcess = await createNpmRegistry(httpPort, httpsPort, true); - - try { - await runSteps(runSetup, allSetups, 'setup'); - await runSteps(runInitializer, allInitializers, 'initializer'); - await runSteps(runTest, testsToRun, 'test'); - - if (shardId !== null) { - console.log(colors.green(`Done shard ${shardId} of ${nbShards}.`)); - } else { - console.log(colors.green('Done.')); - } +(async () => { + const tempRoot = await mktempd('angular-cli-e2e-', process.env.E2E_TEMP); + setGlobalVariable('tmp-root', tempRoot); + + process.on('SIGINT', deleteTemporaryRoot); + process.on('exit', deleteTemporaryRoot); + + const [httpPort, httpsPort, packageTars] = await Promise.all([ + findFreePort(), + findFreePort(), + findPackageTars(), + ]); + setGlobalVariable('package-registry', 'http://localhost:' + httpPort); + setGlobalVariable('package-secure-registry', 'http://localhost:' + httpsPort); + setGlobalVariable('package-tars', packageTars); + + // NPM registries for the lifetime of the test execution + const registryProcess = await createNpmRegistry(httpPort, httpPort); + const secureRegistryProcess = await createNpmRegistry(httpPort, httpsPort, true); + + try { + console.log(` Using "${tempRoot}" as temporary directory for a new project.`); + + await runSteps(runSetup, allSetups, 'setup'); + await runSteps(runInitializer, allInitializers, 'initializer'); + await runSteps(runTest, testsToRun, 'test'); + + if (shardId !== null) { + console.log(styleText(['green'], `Done shard ${shardId} of ${nbShards}.`)); + } else { + console.log(styleText(['green'], 'Done.')); + } - process.exitCode = 0; - } catch (err) { - if (err instanceof Error) { - console.log('\n'); - console.error(colors.red(err.message)); - if (err.stack) { - console.error(colors.red(err.stack)); - } - } else { - console.error(colors.red(String(err))); + process.exitCode = 0; + } catch (err) { + if (err instanceof Error) { + console.log('\n'); + console.error(styleText(['red'], err.message)); + if (err.stack) { + console.error(styleText(['red'], err.stack)); } + } else { + console.error(styleText(['red'], String(err))); + } - if (argv.debug) { - console.log(`Current Directory: ${process.cwd()}`); - console.log('Will loop forever while you debug... CTRL-C to quit.'); + if (argv.debug) { + console.log(`Current Directory: ${process.cwd()}`); + console.log('Will loop forever while you debug... CTRL-C to quit.'); - // Wait forever until user explicitly cancels. - await new Promise(() => {}); - } - - process.exitCode = 1; - } finally { - registryProcess.kill(); - secureRegistryProcess.kill(); + // Wait forever until user explicitly cancels. + await new Promise(() => {}); } - }) - .catch((err) => { - console.error(colors.red(`Unkown Error: ${err}`)); + process.exitCode = 1; - }); + } finally { + registryProcess.kill(); + secureRegistryProcess.kill(); + } +})().catch((err) => { + console.error(styleText(['red'], `Unkown Error: ${err}`)); + process.exitCode = 1; +}); async function runSteps( run: (name: string) => Promise | void, @@ -303,7 +309,7 @@ async function runSteps( await run(absoluteName); } catch (e) { console.log('\n'); - console.error(colors.red(`${capsType} "${name}" failed...`)); + console.error(styleText(['red'], `${capsType} "${name}" failed...`)); throw e; } finally { @@ -334,7 +340,7 @@ function runInitializer(absoluteName: string): Promise { * Run a file from the main 'test-project' directory in a subprocess via launchTestProcess(). */ async function runTest(absoluteName: string): Promise { - process.chdir(join(getGlobalVariable('projects-root'), 'test-project')); + process.chdir(getTestProjectDir()); await launchTestProcess(absoluteName); await cleanTestProject(); @@ -343,7 +349,7 @@ async function runTest(absoluteName: string): Promise { async function cleanTestProject() { await gitClean(); - const testProject = join(getGlobalVariable('projects-root'), 'test-project'); + const testProject = getTestProjectDir(); // Note: Dist directory is not cleared between tests, as `git clean` // doesn't delete it. @@ -356,16 +362,22 @@ function printHeader( count: number, type: 'setup' | 'initializer' | 'test', ) { - const text = `${testIndex + 1} of ${count}`; + const text = `(${testIndex + 1} of ${count})`; const fullIndex = testIndex * nbShards + (shardId ?? 0) + 1; const shard = shardId === null || type !== 'test' ? '' - : colors.yellow(` [${shardId}:${nbShards}]` + colors.bold(` (${fullIndex}/${tests.length})`)); + : styleText( + ['yellow'], + ` [${shardId}:${nbShards}]` + styleText(['bold'], ` (${fullIndex}/${tests.length})`), + ); console.log( - colors.green( - `Running ${type} "${colors.bold.blue(testName)}" (${colors.bold.white(text)}${shard})...`, - ), + styleText(['green'], `Running ${type} "`) + + styleText(['bold', 'blue'], testName) + + styleText(['green'], '" ') + + styleText(['bold', 'white'], text) + + shard + + styleText(['green'], '...'), ); } @@ -375,9 +387,11 @@ function printFooter(testName: string, type: 'setup' | 'initializer' | 'test', s // Round to hundredth of a second. const t = Math.round((Date.now() - startTime) / 10) / 100; console.log( - colors.green(`${capsType} "${colors.bold.blue(testName)}" took `) + - colors.bold.blue('' + t) + - colors.green('s...'), + styleText(['green'], `${capsType} "`) + + styleText(['bold', 'blue'], testName) + + styleText(['green'], '" took ') + + styleText(['bold', 'blue'], t.toFixed(2)) + + styleText(['green'], 's...'), ); console.log(''); } @@ -389,7 +403,7 @@ async function findPackageTars(): Promise<{ [pkg: string]: PkgInfo }> { ); const pkgJsons = await Promise.all( - pkgs.map((pkg) => realpathSync(pkg)).map((pkg) => extractFile(pkg, './package.json')), + pkgs.map((pkg) => realpathSync(pkg)).map((pkg) => extractFile(pkg, 'npm_package/package.json')), ); return pkgs.reduce( @@ -406,3 +420,13 @@ async function findPackageTars(): Promise<{ [pkg: string]: PkgInfo }> { {} as { [pkg: string]: PkgInfo }, ); } + +function deleteTemporaryRoot(): void { + try { + fs.rmSync(getGlobalVariable('tmp-root'), { + recursive: true, + force: true, + maxRetries: 3, + }); + } catch {} +} diff --git a/tests/legacy-cli/BUILD.bazel b/tests/legacy-cli/BUILD.bazel deleted file mode 100644 index c148aba86de5..000000000000 --- a/tests/legacy-cli/BUILD.bazel +++ /dev/null @@ -1,74 +0,0 @@ -load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path") -load("@npm//:rollup/package_json.bzl", rollup = "bin") -load("//tools:defaults.bzl", "ts_project") -load(":e2e.bzl", "e2e_suites") - -package(default_visibility = ["//visibility:public"]) - -ts_project( - name = "runner", - testonly = True, - srcs = [ - "e2e_runner.ts", - ], - deps = [ - "//:node_modules/@types/node", - "//:node_modules/ansi-colors", - "//:node_modules/fast-glob", - "//packages/angular_devkit/core", - "//packages/angular_devkit/core/node", - "//tests/legacy-cli/e2e/utils", - ], -) - -rollup.rollup( - name = "runner_bundled", - testonly = True, - srcs = [ - "rollup.config.mjs", - ":runner", - "//:node_modules/@rollup/plugin-alias", - "//:node_modules/@rollup/plugin-commonjs", - "//:node_modules/@rollup/plugin-json", - "//:node_modules/@rollup/plugin-node-resolve", - "//:node_modules/fast-glob", - "//tests/legacy-cli/e2e/initialize", - "//tests/legacy-cli/e2e/ng-snapshot", - "//tests/legacy-cli/e2e/setup", - "//tests/legacy-cli/e2e/tests", - ], - args = [ - "--format=cjs", - "--config=./rollup.config.mjs", - ], - chdir = package_name(), - out_dirs = ["runner_bundled_out"], - progress_message = "Bundling e2e test runner", -) - -directory_path( - name = "runner_entrypoint", - testonly = True, - directory = ":runner_bundled", - path = "./e2e_runner.js", -) - -e2e_suites( - name = "e2e", - data = [ - ":runner_bundled", - "verdaccio.yaml", - "verdaccio_auth.yaml", - - # Dynamically loaded. - "//tests/legacy-cli/e2e/assets", - "//:node_modules/verdaccio", - "//:node_modules/verdaccio-auth-memory", - - # Extra runtime deps due to bundling issues. - # TODO: Clean this up. - "//:node_modules/@verdaccio/config", - "//:node_modules/express", - ], - runner = ":runner_entrypoint", -) diff --git a/tests/legacy-cli/e2e/assets/17.0-project/README.md b/tests/legacy-cli/e2e/assets/17.0-project/README.md deleted file mode 100644 index 5418a46b83c0..000000000000 --- a/tests/legacy-cli/e2e/assets/17.0-project/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# SeventeenProject - -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.12. - -## Development server - -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. - -## Code scaffolding - -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. - -## Build - -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Running unit tests - -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Running end-to-end tests - -Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/tests/legacy-cli/e2e/assets/17.0-project/package.json b/tests/legacy-cli/e2e/assets/17.0-project/package.json deleted file mode 100644 index c0f3c7b59156..000000000000 --- a/tests/legacy-cli/e2e/assets/17.0-project/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "seventeen-project", - "version": "0.0.0", - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "watch": "ng build --watch --configuration development", - "test": "ng test" - }, - "private": true, - "dependencies": { - "@angular/animations": "^17.3.0", - "@angular/common": "^17.3.0", - "@angular/compiler": "^17.3.0", - "@angular/core": "^17.3.0", - "@angular/forms": "^17.3.0", - "@angular/platform-browser": "^17.3.0", - "@angular/platform-browser-dynamic": "^17.3.0", - "@angular/router": "^17.3.0", - "rxjs": "~7.8.0", - "tslib": "^2.3.0", - "zone.js": "~0.14.3" - }, - "devDependencies": { - "@angular-devkit/build-angular": "^17.3.12", - "@angular/cli": "^17.3.12", - "@angular/compiler-cli": "^17.3.0", - "@types/jasmine": "~5.1.0", - "jasmine-core": "~5.1.0", - "karma": "~6.4.0", - "karma-chrome-launcher": "~3.2.0", - "karma-coverage": "~2.2.0", - "karma-jasmine": "~5.1.0", - "karma-jasmine-html-reporter": "~2.1.0", - "typescript": "~5.4.2" - } -} diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.config.ts b/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.config.ts deleted file mode 100644 index 6c6ef6035f3d..000000000000 --- a/tests/legacy-cli/e2e/assets/17.0-project/src/app/app.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ApplicationConfig } from '@angular/core'; -import { provideRouter } from '@angular/router'; - -import { routes } from './app.routes'; - -export const appConfig: ApplicationConfig = { - providers: [provideRouter(routes)] -}; diff --git a/tests/legacy-cli/e2e/assets/17.0-project/src/index.html b/tests/legacy-cli/e2e/assets/17.0-project/src/index.html deleted file mode 100644 index 18ffbad003b2..000000000000 --- a/tests/legacy-cli/e2e/assets/17.0-project/src/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - SeventeenProject - - - - - - - - diff --git a/tests/legacy-cli/e2e/assets/add-collection-peer-bad/index.js b/tests/legacy-cli/e2e/assets/add-collection-peer-bad/index.js deleted file mode 100644 index 867b3a4eb6fd..000000000000 --- a/tests/legacy-cli/e2e/assets/add-collection-peer-bad/index.js +++ /dev/null @@ -1 +0,0 @@ -exports.default = (options) => tree => tree.create(options.name || 'empty-file-peer-bad', ''); diff --git a/tests/legacy-cli/e2e/assets/add-collection-peer-good/index.js b/tests/legacy-cli/e2e/assets/add-collection-peer-good/index.js deleted file mode 100644 index 4d5dbdca2f69..000000000000 --- a/tests/legacy-cli/e2e/assets/add-collection-peer-good/index.js +++ /dev/null @@ -1 +0,0 @@ -exports.default = (options) => tree => tree.create(options.name || 'empty-file-peer-good', ''); diff --git a/tests/legacy-cli/e2e/assets/add-collection/index.js b/tests/legacy-cli/e2e/assets/add-collection/index.js deleted file mode 100644 index cf404a768650..000000000000 --- a/tests/legacy-cli/e2e/assets/add-collection/index.js +++ /dev/null @@ -1 +0,0 @@ -exports.default = (options) => tree => tree.create(options.name || 'empty-file', ''); diff --git a/tests/legacy-cli/e2e/assets/nested-schematic-dependency/index.js b/tests/legacy-cli/e2e/assets/nested-schematic-dependency/index.js deleted file mode 100644 index cf404a768650..000000000000 --- a/tests/legacy-cli/e2e/assets/nested-schematic-dependency/index.js +++ /dev/null @@ -1 +0,0 @@ -exports.default = (options) => tree => tree.create(options.name || 'empty-file', ''); diff --git a/tests/legacy-cli/e2e/assets/nested-schematic-main/index.js b/tests/legacy-cli/e2e/assets/nested-schematic-main/index.js deleted file mode 100644 index 9763f96fbb58..000000000000 --- a/tests/legacy-cli/e2e/assets/nested-schematic-main/index.js +++ /dev/null @@ -1 +0,0 @@ -exports.default = (options) => require("@angular-devkit/schematics").externalSchematic('empty-app-nested', 'nested', {}); diff --git a/tests/legacy-cli/e2e/assets/schematic-allow-scripts/index.js b/tests/legacy-cli/e2e/assets/schematic-allow-scripts/index.js deleted file mode 100644 index 20fb52c65137..000000000000 --- a/tests/legacy-cli/e2e/assets/schematic-allow-scripts/index.js +++ /dev/null @@ -1,16 +0,0 @@ -const tasks = require("@angular-devkit/schematics/tasks"); - -exports.default = ({ allowScripts, ignoreScripts = false }) => { - return (tree, context) => { - tree.create('/install-test/package.json', JSON.stringify({ - name: 'install-test', - version: '0.0.0', - scripts: { - postinstall: `node run-post.js`, - } - })); - tree.create('/install-test/.npmrc', `ignore-scripts=${ignoreScripts}`); - tree.create('/install-test/run-post.js', 'require("fs").writeFileSync(__dirname + "/post-script-ran", "12345");') - context.addTask(new tasks.NodePackageInstallTask({ workingDirectory: 'install-test', allowScripts })); - }; -}; diff --git a/tests/legacy-cli/e2e/assets/schematic-allow-scripts/schema.json b/tests/legacy-cli/e2e/assets/schematic-allow-scripts/schema.json deleted file mode 100644 index 099432e4063a..000000000000 --- a/tests/legacy-cli/e2e/assets/schematic-allow-scripts/schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "type": "object", - "additionalProperties": false, - "properties": { - "allowScripts": { - "type": "boolean" - }, - "ignoreScripts": { - "type": "boolean" - } - } -} - \ No newline at end of file diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.html b/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.html deleted file mode 100644 index a1ab9650d463..000000000000 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/app/app.component.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - - - - - - - -

- -
- - -
- - - Rocket Ship - - - - - - - - - - {{ title }} app is running! - - - Rocket Ship Smoke - - - -
- - -

Resources

-

Here are some links to help you get started:

- - - - -

Next Steps

-

What do you want to do next with your app?

- - - -
- - - - - - - - - - - -
- - -
-
ng generate component xyz
-
ng add @angular/material
-
ng add @angular/pwa
-
ng add _____
-
ng test
-
ng build
-
- - - - - - - - - Gray Clouds Background - - - -
- - - - - - - - - - diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/assets/.gitkeep b/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/index.html b/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/index.html deleted file mode 100644 index ca14f8bfb86f..000000000000 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/src/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 17SsrProjectWebpack - - - - - - - - diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.app.json b/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.app.json deleted file mode 100644 index 374cc9d294aa..000000000000 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.app.json +++ /dev/null @@ -1,14 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/app", - "types": [] - }, - "files": [ - "src/main.ts" - ], - "include": [ - "src/**/*.d.ts" - ] -} diff --git a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.spec.json b/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.spec.json deleted file mode 100644 index be7e9da76f7b..000000000000 --- a/tests/legacy-cli/e2e/assets/ssr-project-webpack/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/spec", - "types": [ - "jasmine" - ] - }, - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/tests/legacy-cli/e2e/ng-snapshot/package.json b/tests/legacy-cli/e2e/ng-snapshot/package.json deleted file mode 100644 index b66330c9835d..000000000000 --- a/tests/legacy-cli/e2e/ng-snapshot/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "description": "snapshot versions of Angular for e2e testing", - "private": true, - "dependencies": { - "@angular/animations": "github:angular/animations-builds#d45d183a7862ed31228028a557cf28f2a919ad31", - "@angular/cdk": "github:angular/cdk-builds#1cb6c8ce50ec6c85ccfd865d961857a38716422d", - "@angular/common": "github:angular/common-builds#3a864e7851a8db81bc308149f7ebcb12f8a2f3de", - "@angular/compiler": "github:angular/compiler-builds#eba2a6d9cedb4e2b4324b0f7aa17b657120fbbaa", - "@angular/compiler-cli": "github:angular/compiler-cli-builds#97435f625b722fc5f05d56a5e1fa1b685a21c2f6", - "@angular/core": "github:angular/core-builds#5564ed93bb02afb234a47101a461401e1c86ba0e", - "@angular/forms": "github:angular/forms-builds#c4b3b1e47acfaf5866fbbd8429876f6347b37bd4", - "@angular/language-service": "github:angular/language-service-builds#8353535cbda057f52774653f380cd7122c94cc15", - "@angular/localize": "github:angular/localize-builds#9d7f4a23d1fb0c277085632d46d88b96c52f4396", - "@angular/material": "github:angular/material-builds#ef46fceae4f1b9cae2d3a8b45f652ffaccbf749e", - "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#1db1d24bdbca33e4017e9b16b0a914f3eb2e2171", - "@angular/platform-browser": "github:angular/platform-browser-builds#0eebb01962f236bac9e55a521da424a1f2ce68de", - "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#43610d0e7a39fcbb05f250b8f8f11df639b1ebdb", - "@angular/platform-server": "github:angular/platform-server-builds#ccdb4fb12c9a77a63f7dc235897608dd77474dec", - "@angular/router": "github:angular/router-builds#f7eb4edff552fe724c24740789dc0d88e7db020a", - "@angular/service-worker": "github:angular/service-worker-builds#d9b9d72a93b4f7c51ec1e8bf181bf6ceb2d37a4a" - } -} diff --git a/tests/legacy-cli/e2e/setup/001-create-tmp-dir.ts b/tests/legacy-cli/e2e/setup/001-create-tmp-dir.ts deleted file mode 100644 index 4914921eca18..000000000000 --- a/tests/legacy-cli/e2e/setup/001-create-tmp-dir.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { dirname } from 'node:path'; -import { getGlobalVariable, setGlobalVariable } from '../utils/env'; -import { mktempd } from '../utils/utils'; - -export default async function () { - const argv = getGlobalVariable('argv'); - - // Get to a temporary directory. - let tempRoot: string; - if (argv.reuse) { - tempRoot = dirname(argv.reuse); - } else if (argv.tmpdir) { - tempRoot = argv.tmpdir; - } else { - tempRoot = await mktempd('angular-cli-e2e-', process.env.E2E_TEMP); - } - console.log(` Using "${tempRoot}" as temporary directory for a new project.`); - setGlobalVariable('tmp-root', tempRoot); -} diff --git a/tests/legacy-cli/e2e/tests/basic/e2e.ts b/tests/legacy-cli/e2e/tests/basic/e2e.ts deleted file mode 100644 index 655b679192d1..000000000000 --- a/tests/legacy-cli/e2e/tests/basic/e2e.ts +++ /dev/null @@ -1,12 +0,0 @@ -import assert from 'node:assert/strict'; -import { setTimeout } from 'node:timers/promises'; -import { silentNg } from '../../utils/process'; - -export default async function () { - await assert.rejects(silentNg('e2e', 'test-project', '--dev-server-target=')); - - // These should work. - await silentNg('e2e', 'test-project'); - await setTimeout(500); - await silentNg('e2e', 'test-project', '--dev-server-target=test-project:serve'); -} diff --git a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-aot.ts b/tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-aot.ts deleted file mode 100644 index 88c80ac61629..000000000000 --- a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-full-aot.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { setTimeout } from 'node:timers/promises'; -import { ng } from '../../../utils/process'; -import { libraryConsumptionSetup } from './setup'; - -export default async function () { - await libraryConsumptionSetup(); - - // Build library in full mode (development) - await ng('build', 'my-lib', '--configuration=development'); - - // Check that the e2e succeeds prod and non prod mode - await ng('e2e', '--configuration=production'); - await setTimeout(500); - await ng('e2e', '--configuration=development'); -} diff --git a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-aot.ts b/tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-aot.ts deleted file mode 100644 index 5b45a8372f68..000000000000 --- a/tests/legacy-cli/e2e/tests/build/library/lib-consumption-partial-aot.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { setTimeout } from 'node:timers/promises'; -import { ng } from '../../../utils/process'; -import { libraryConsumptionSetup } from './setup'; - -export default async function () { - await libraryConsumptionSetup(); - - // Build library in partial mode (production) - await ng('build', 'my-lib', '--configuration=production'); - - // Check that the e2e succeeds prod and non prod mode - await ng('e2e', '--configuration=production'); - await setTimeout(500); - await ng('e2e', '--configuration=development'); -} diff --git a/tests/legacy-cli/e2e/tests/commands/add/dir.ts b/tests/legacy-cli/e2e/tests/commands/add/dir.ts deleted file mode 100644 index f5fadc486b3d..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/add/dir.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { assetDir } from '../../../utils/assets'; -import { expectFileToExist } from '../../../utils/fs'; -import { ng } from '../../../utils/process'; - -export default async function () { - await ng('add', assetDir('add-collection'), '--name=blah', '--skip-confirmation'); - await expectFileToExist('blah'); -} diff --git a/tests/legacy-cli/e2e/tests/commands/add/file.ts b/tests/legacy-cli/e2e/tests/commands/add/file.ts deleted file mode 100644 index 6096dac6f666..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/add/file.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { assetDir } from '../../../utils/assets'; -import { expectFileToExist } from '../../../utils/fs'; -import { ng } from '../../../utils/process'; - -export default async function () { - await ng('add', assetDir('add-collection.tgz'), '--name=blah', '--skip-confirmation'); - await expectFileToExist('blah'); -} diff --git a/tests/legacy-cli/e2e/tests/commands/add/peer.ts b/tests/legacy-cli/e2e/tests/commands/add/peer.ts deleted file mode 100644 index 85074646de11..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/add/peer.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { assetDir } from '../../../utils/assets'; -import { ng } from '../../../utils/process'; - -const warning = 'Adding the package may not succeed.'; - -export default async function () { - const { stdout: bad } = await ng( - 'add', - assetDir('add-collection-peer-bad'), - '--skip-confirmation', - ); - if (!bad.includes(warning)) { - throw new Error('peer warning not shown on bad package'); - } - - const { stdout: base } = await ng('add', assetDir('add-collection'), '--skip-confirmation'); - if (base.includes(warning)) { - throw new Error('peer warning shown on base package'); - } - - const { stdout: good } = await ng( - 'add', - assetDir('add-collection-peer-good'), - '--skip-confirmation', - ); - if (good.includes(warning)) { - throw new Error('peer warning shown on good package'); - } -} diff --git a/tests/legacy-cli/e2e/tests/commands/add/secure-registry.ts b/tests/legacy-cli/e2e/tests/commands/add/secure-registry.ts deleted file mode 100644 index a27ba708637d..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/add/secure-registry.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { expectFileNotToExist, expectFileToExist } from '../../../utils/fs'; -import { getActivePackageManager, installWorkspacePackages } from '../../../utils/packages'; -import { git, ng } from '../../../utils/process'; -import { createNpmConfigForAuthentication } from '../../../utils/registry'; -import { expectToFail } from '../../../utils/utils'; - -export default async function () { - // The environment variable has priority over the .npmrc - delete process.env['NPM_CONFIG_REGISTRY']; - const isNpm = getActivePackageManager() === 'npm'; - - const command = ['add', '@angular/pwa', '--skip-confirmation']; - await expectFileNotToExist('public/manifest.webmanifest'); - - // Works with unscoped registry authentication details - if (!isNpm) { - // NPM no longer support unscoped. - await createNpmConfigForAuthentication(false); - await ng(...command); - await expectFileToExist('public/manifest.webmanifest'); - await git('clean', '-dxf'); - } - // Works with scoped registry authentication details - await expectFileNotToExist('public/manifest.webmanifest'); - - await createNpmConfigForAuthentication(true); - await ng(...command); - await expectFileToExist('public/manifest.webmanifest'); - - // Invalid authentication token - if (isNpm) { - // NPM no longer support unscoped. - await createNpmConfigForAuthentication(false, true); - await expectToFail(() => ng(...command)); - } - - await createNpmConfigForAuthentication(true, true); - await expectToFail(() => ng(...command)); - - await git('clean', '-dxf'); - await installWorkspacePackages(); -} diff --git a/tests/legacy-cli/e2e/tests/commands/cache/cache-enable-disable.ts b/tests/legacy-cli/e2e/tests/commands/cache/cache-enable-disable.ts deleted file mode 100644 index bb81dd2d80b9..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/cache/cache-enable-disable.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { readFile } from '../../../utils/fs'; -import { ng } from '../../../utils/process'; - -export default async function () { - await ng('cache', 'enable'); - if (JSON.parse(await readFile('angular.json')).cli.cache.enabled !== true) { - throw new Error(`Expected 'cli.cache.enable' to be true.`); - } - - await ng('cache', 'disable'); - if (JSON.parse(await readFile('angular.json')).cli.cache.enabled !== false) { - throw new Error(`Expected 'cli.cache.enable' to be false.`); - } -} diff --git a/tests/legacy-cli/e2e/tests/commands/e2e/e2e-and-serve.ts b/tests/legacy-cli/e2e/tests/commands/e2e/e2e-and-serve.ts deleted file mode 100644 index 7e70e885a929..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/e2e/e2e-and-serve.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { silentNg } from '../../../utils/process'; -import { ngServe } from '../../../utils/project'; - -export default async function () { - // Should run side-by-side with `ng serve` - await ngServe(); - await silentNg('e2e'); -} diff --git a/tests/legacy-cli/e2e/tests/commands/e2e/multiple-specs.ts b/tests/legacy-cli/e2e/tests/commands/e2e/multiple-specs.ts deleted file mode 100644 index c7da20adf900..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/e2e/multiple-specs.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { silentNg } from '../../../utils/process'; -import { moveFile, copyFile } from '../../../utils/fs'; - -export default async function () { - // Should accept different multiple spec files - await moveFile('./e2e/src/app.e2e-spec.ts', './e2e/src/renamed-app.e2e-spec.ts'); - await copyFile('./e2e/src/renamed-app.e2e-spec.ts', './e2e/src/another-app.e2e-spec.ts'); - - await silentNg( - 'e2e', - 'test-project', - '--specs', - './e2e/renamed-app.e2e-spec.ts', - '--specs', - './e2e/another-app.e2e-spec.ts', - ); -} diff --git a/tests/legacy-cli/e2e/tests/commands/e2e/protractor-config.ts b/tests/legacy-cli/e2e/tests/commands/e2e/protractor-config.ts deleted file mode 100644 index 52e9494e4062..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/e2e/protractor-config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { moveFile } from '../../../utils/fs'; -import { silentNg } from '../../../utils/process'; - -export default async function () { - // Should accept different config file - await moveFile('./e2e/protractor.conf.js', './e2e/renamed-protractor.conf.js'); - await silentNg('e2e', 'test-project', '--protractor-config=e2e/renamed-protractor.conf.js'); -} diff --git a/tests/legacy-cli/e2e/tests/commands/e2e/suite.ts b/tests/legacy-cli/e2e/tests/commands/e2e/suite.ts deleted file mode 100644 index 519ed63a71bb..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/e2e/suite.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { silentNg } from '../../../utils/process'; -import { replaceInFile } from '../../../utils/fs'; - -export default async function () { - // Suites block need to be added in the protractor.conf.js file to test suites - await replaceInFile( - 'e2e/protractor.conf.js', - `allScriptsTimeout: 11000,`, - `allScriptsTimeout: 11000, - suites: { - app: './e2e/src/app.e2e-spec.ts' - }, - `, - ); - await silentNg('e2e', 'test-project', '--suite=app'); -} diff --git a/tests/legacy-cli/e2e/tests/commands/help/help-hidden.ts b/tests/legacy-cli/e2e/tests/commands/help/help-hidden.ts deleted file mode 100644 index bf616039600b..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/help/help-hidden.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { silentNg } from '../../../utils/process'; - -export default async function () { - const { stdout: stdoutNew } = await silentNg('--help'); - if (/(easter-egg)|(ng make-this-awesome)|(ng init)/.test(stdoutNew)) { - throw new Error( - 'Expected to not match "(easter-egg)|(ng make-this-awesome)|(ng init)" in help output.', - ); - } - - const { stdout: ngGenerate } = await silentNg('--help', 'generate', 'component'); - if (ngGenerate.includes('--path')) { - throw new Error('Expected to not match "--path" in help output.'); - } -} diff --git a/tests/legacy-cli/e2e/tests/commands/serve/preflight-request.ts b/tests/legacy-cli/e2e/tests/commands/serve/preflight-request.ts deleted file mode 100644 index d73bf1eb4003..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/serve/preflight-request.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ngServe } from '../../../utils/project'; - -export default async function () { - const port = await ngServe(); - const result = await fetch(`http://localhost:${port}/main.js`, { method: 'OPTIONS' }); - const content = await result.blob(); - - if (content.size !== 0) { - throw new Error(`Expected "size" to be "0" but got "${content.size}".`); - } - - if (result.status !== 204) { - throw new Error(`Expected "status" to be "204" but got "${result.status}".`); - } -} diff --git a/tests/legacy-cli/e2e/tests/commands/serve/ssr-http-requests-assets.ts b/tests/legacy-cli/e2e/tests/commands/serve/ssr-http-requests-assets.ts deleted file mode 100644 index 78c5b4b94995..000000000000 --- a/tests/legacy-cli/e2e/tests/commands/serve/ssr-http-requests-assets.ts +++ /dev/null @@ -1,89 +0,0 @@ -import assert from 'node:assert'; - -import { killAllProcesses, ng } from '../../../utils/process'; -import { rimraf, writeMultipleFiles } from '../../../utils/fs'; -import { installWorkspacePackages } from '../../../utils/packages'; -import { ngServe, useSha } from '../../../utils/project'; -import { getGlobalVariable } from '../../../utils/env'; - -export default async function () { - const useWebpackBuilder = !getGlobalVariable('argv')['esbuild']; - - // Forcibly remove in case another test doesn't clean itself up. - await rimraf('node_modules/@angular/ssr'); - if (useWebpackBuilder) { - // `--server-routing` not supported in `browser` builder. - await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); - } else { - await ng('add', '@angular/ssr', '--skip-confirmation', '--skip-install'); - } - - await useSha(); - await installWorkspacePackages(); - - await writeMultipleFiles({ - // Add http client and route - 'src/app/app.config.ts': ` - import { ApplicationConfig } from '@angular/core'; - import { provideRouter } from '@angular/router'; - - import { Home } from './home/home'; - import { provideClientHydration } from '@angular/platform-browser'; - import { provideHttpClient, withFetch } from '@angular/common/http'; - - export const appConfig: ApplicationConfig = { - providers: [ - provideRouter([{ - path: '', - component: Home, - }]), - provideClientHydration(), - provideHttpClient(withFetch()), - ], - }; - `, - // Add asset - 'public/media.json': JSON.stringify({ dataFromAssets: true }), - // Update component to do an HTTP call to asset. - 'src/app/app.ts': ` - import { Component, inject } from '@angular/core'; - import { CommonModule } from '@angular/common'; - import { RouterOutlet } from '@angular/router'; - import { HttpClient } from '@angular/common/http'; - - @Component({ - selector: 'app-root', - standalone: true, - imports: [CommonModule, RouterOutlet], - template: \` -

{{ data | json }}

- - \`, - }) - export class App { - data: any; - constructor() { - const http = inject(HttpClient); - http.get('/media.json').toPromise().then((d) => { - this.data = d; - }); - } - } - `, - }); - - await ng('generate', 'component', 'home'); - const match = /

{[\S\s]*"dataFromAssets":[\s\S]*true[\S\s]*}<\/p>/; - const port = await ngServe('--no-ssl'); - assert.match(await (await fetch(`http://localhost:${port}/`)).text(), match); - - await killAllProcesses(); - - try { - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - const sslPort = await ngServe('--ssl'); - assert.match(await (await fetch(`https://localhost:${sslPort}/`)).text(), match); - } finally { - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '1'; - } -} diff --git a/tests/legacy-cli/e2e/tests/generate/application/application-basic.ts b/tests/legacy-cli/e2e/tests/generate/application/application-basic.ts deleted file mode 100644 index 615e08426c2b..000000000000 --- a/tests/legacy-cli/e2e/tests/generate/application/application-basic.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { expectFileToMatch } from '../../../utils/fs'; -import { ng } from '../../../utils/process'; -import { useCIChrome } from '../../../utils/project'; - -export default function () { - return ng('generate', 'application', 'app2') - .then(() => expectFileToMatch('angular.json', /\"app2\":/)) - .then(() => useCIChrome('app2', 'projects/app2')) - .then(() => ng('test', 'app2', '--watch=false')); -} diff --git a/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts b/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts deleted file mode 100644 index b7ceaddf3cb1..000000000000 --- a/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ng } from '../../../utils/process'; -import { useCIChrome } from '../../../utils/project'; - -export default async function () { - await ng('generate', 'app', 'standalone', '--zoneless', '--standalone'); - await useCIChrome('standalone', 'projects/standalone'); - await ng('test', 'standalone', '--watch=false'); - await ng('build', 'standalone'); - - await ng('generate', 'app', 'ngmodules', '--zoneless', '--no-standalone', '--skip-install'); - await useCIChrome('ngmodules', 'projects/ngmodules'); - await ng('test', 'ngmodules', '--watch=false'); - await ng('build', 'ngmodules'); -} diff --git a/tests/legacy-cli/e2e/tests/generate/class.ts b/tests/legacy-cli/e2e/tests/generate/class.ts deleted file mode 100644 index e1b21f28982a..000000000000 --- a/tests/legacy-cli/e2e/tests/generate/class.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { join } from 'node:path'; -import { ng } from '../../utils/process'; -import { expectFileToExist } from '../../utils/fs'; - -export default function () { - const projectDir = join('src', 'app'); - - return ( - ng('generate', 'class', 'test-class') - .then(() => expectFileToExist(projectDir)) - .then(() => expectFileToExist(join(projectDir, 'test-class.ts'))) - .then(() => expectFileToExist(join(projectDir, 'test-class.spec.ts'))) - - // Try to run the unit tests. - .then(() => ng('test', '--watch=false')) - ); -} diff --git a/tests/legacy-cli/e2e/tests/generate/help-output-no-duplicates.ts b/tests/legacy-cli/e2e/tests/generate/help-output-no-duplicates.ts deleted file mode 100644 index 9a8cf8ca7fcc..000000000000 --- a/tests/legacy-cli/e2e/tests/generate/help-output-no-duplicates.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ng } from '../../utils/process'; - -export default async function () { - // Verify that there are no duplicate options - const { stdout } = await ng('generate', 'component', '--help'); - const firstIndex = stdout.indexOf('--prefix'); - - if (firstIndex < 0) { - console.log(stdout); - throw new Error('--prefix was not part of the help output.'); - } - - if (firstIndex !== stdout.lastIndexOf('--prefix')) { - console.log(stdout); - throw new Error('--prefix first and last index were different. Possible duplicate output!'); - } -} diff --git a/tests/legacy-cli/e2e/tests/generate/interface.ts b/tests/legacy-cli/e2e/tests/generate/interface.ts deleted file mode 100644 index d58248d27ac4..000000000000 --- a/tests/legacy-cli/e2e/tests/generate/interface.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { join } from 'node:path'; -import { ng } from '../../utils/process'; -import { expectFileToExist } from '../../utils/fs'; - -export default function () { - const interfaceDir = join('src', 'app'); - - return ( - ng('generate', 'interface', 'test-interface', 'model') - .then(() => expectFileToExist(interfaceDir)) - .then(() => expectFileToExist(join(interfaceDir, 'test-interface.model.ts'))) - - // Try to run the unit tests. - .then(() => ng('test', '--watch=false')) - ); -} diff --git a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015-e2e.ts b/tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015-e2e.ts deleted file mode 100644 index 3fe337c4c90f..000000000000 --- a/tests/legacy-cli/e2e/tests/i18n/ivy-localize-es2015-e2e.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { getGlobalVariable } from '../../utils/env'; -import { ng } from '../../utils/process'; -import { langTranslations, setupI18nConfig } from './setup'; - -export default async function () { - // Setup i18n tests and config. - await setupI18nConfig(); - - for (const { lang } of langTranslations) { - // Execute Application E2E tests with dev server - await ng('e2e', `--configuration=${lang}`, '--port=0'); - } -} diff --git a/tests/legacy-cli/e2e/tests/test/test-environment.ts b/tests/legacy-cli/e2e/tests/test/test-environment.ts deleted file mode 100644 index 1a4dadaa4317..000000000000 --- a/tests/legacy-cli/e2e/tests/test/test-environment.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ng } from '../../utils/process'; -import { writeFile, writeMultipleFiles } from '../../utils/fs'; -import { updateJsonFile } from '../../utils/project'; - -export default function () { - // Tests run in 'dev' environment by default. - return ( - writeMultipleFiles({ - 'src/environment.prod.ts': ` - export const environment = { - production: true - };`, - 'src/environment.ts': ` - export const environment = { - production: false - }; - `, - 'src/app/environment.spec.ts': ` - import { environment } from '../environment'; - - describe('Test environment', () => { - it('should have production disabled', () => { - expect(environment.production).toBe(false); - }); - }); - `, - }) - .then(() => ng('test', '--watch=false')) - .then(() => - updateJsonFile('angular.json', (configJson) => { - const appArchitect = configJson.projects['test-project'].architect; - appArchitect.test.configurations = { - production: { - fileReplacements: [ - { - replace: 'src/environment.ts', - with: 'src/environment.prod.ts', - }, - ], - }, - }; - }), - ) - - // Tests can run in different environment. - .then(() => - writeFile( - 'src/app/environment.spec.ts', - ` - import { environment } from '../environment'; - - describe('Test environment', () => { - it('should have production enabled', () => { - expect(environment.production).toBe(true); - }); - }); - `, - ), - ) - .then(() => ng('test', '--configuration=production', '--watch=false')) - ); -} diff --git a/tests/legacy-cli/e2e/utils/network.ts b/tests/legacy-cli/e2e/utils/network.ts deleted file mode 100644 index a869d9289ad2..000000000000 --- a/tests/legacy-cli/e2e/utils/network.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AddressInfo, createServer } from 'node:net'; - -export function findFreePort(): Promise { - return new Promise((resolve, reject) => { - const srv = createServer(); - srv.once('listening', () => { - const port = (srv.address() as AddressInfo).port; - srv.close((e) => (e ? reject(e) : resolve(port))); - }); - srv.once('error', (e) => srv.close(() => reject(e))); - srv.listen(); - }); -} diff --git a/tests/package.json b/tests/package.json index 4aec9553824b..17660ff2192e 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,7 +1,8 @@ { "devDependencies": { + "@types/tar-stream": "3.1.4", "@angular-devkit/schematics": "workspace:*", - "rxjs": "7.8.2", + "tar-stream": "3.1.7", "tree-kill": "1.2.2" } } diff --git a/tests/legacy-cli/rollup.config.mjs b/tests/rollup.config.mjs similarity index 87% rename from tests/legacy-cli/rollup.config.mjs rename to tests/rollup.config.mjs index 0fc2768c5057..c48299094fef 100644 --- a/tests/legacy-cli/rollup.config.mjs +++ b/tests/rollup.config.mjs @@ -25,7 +25,7 @@ for (const file of testFiles) { export default { input: chunks, - external: [], + external: ['undici', 'puppeteer'], // This cannot be bundled as `node:sqlite` is experimental in node.js 22. Remove once this feature is no longer behind a flag plugins: [ nodeResolve({ preferBuiltins: true, diff --git a/tests/legacy-cli/tsconfig.json b/tests/tsconfig.json similarity index 64% rename from tests/legacy-cli/tsconfig.json rename to tests/tsconfig.json index 235d85b0bb7c..5070cc5b6927 100644 --- a/tests/legacy-cli/tsconfig.json +++ b/tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig-test.json", + "extends": "../tsconfig-test.json", "compilerOptions": { "paths": {} }, "exclude": ["e2e/assets/**"] } diff --git a/tests/legacy-cli/verdaccio.yaml b/tests/verdaccio.yaml similarity index 100% rename from tests/legacy-cli/verdaccio.yaml rename to tests/verdaccio.yaml diff --git a/tests/legacy-cli/verdaccio_auth.yaml b/tests/verdaccio_auth.yaml similarity index 100% rename from tests/legacy-cli/verdaccio_auth.yaml rename to tests/verdaccio_auth.yaml diff --git a/tools/baseline_browserslist/BUILD.bazel b/tools/baseline_browserslist/BUILD.bazel deleted file mode 100644 index 34141cd15759..000000000000 --- a/tools/baseline_browserslist/BUILD.bazel +++ /dev/null @@ -1,52 +0,0 @@ -load("@aspect_rules_js//js:defs.bzl", "js_binary") -load("@aspect_rules_ts//ts:defs.bzl", "ts_config") -load("@npm//:defs.bzl", "npm_link_all_packages") -load("//tools:defaults.bzl", "jasmine_test", "ts_project") - -npm_link_all_packages() - -js_binary( - name = "baseline_browserslist", - data = [":baseline_browserslist_lib"], - entry_point = "index.mjs", - visibility = ["//:__subpackages__"], -) - -ts_project( - name = "baseline_browserslist_lib", - srcs = [ - "generate_browserslist.mts", - "index.mts", - ], - source_map = True, - tsconfig = ":build_tsconfig", - deps = [":node_modules/baseline-browser-mapping"], -) - -ts_project( - name = "baseline_browserslist_test_lib", - testonly = True, - srcs = ["generate_browserslist_spec.mts"], - tsconfig = ":test_tsconfig", - deps = [":baseline_browserslist_lib"], -) - -jasmine_test( - name = "baseline_browserslist_test", - data = [":baseline_browserslist_test_lib"], -) - -ts_config( - name = "build_tsconfig", - src = "tsconfig-build.json", - deps = [ - "//:build-tsconfig-esm", - "//:node_modules/@types/node", - ], -) - -ts_config( - name = "test_tsconfig", - src = "tsconfig-test.json", - deps = ["//:test-tsconfig-esm"], -) diff --git a/tools/baseline_browserslist/baseline_browserslist.bzl b/tools/baseline_browserslist/baseline_browserslist.bzl deleted file mode 100644 index 144b33153828..000000000000 --- a/tools/baseline_browserslist/baseline_browserslist.bzl +++ /dev/null @@ -1,26 +0,0 @@ -"""Generates a `browserslist` configuration from a Baseline date.""" - -load("@aspect_rules_js//js:defs.bzl", "js_run_binary") - -def baseline_browserslist(name, baseline, out, **kwargs): - """Generates a `browserslist` configuration from a Baseline date. - - Args: - name: Name of this target. - baseline: A string date in "YYYY-MM-DD" format of the Baseline widely - available browser set to use in the generated `browserslist`. - out: Name of the output browserslist file. Prefer using `.browserslistrc` - for the output as the `browserslist` package seems to not like files - with a different name, even when explicitly provided. - - See: https://web.dev/baseline - """ - - js_run_binary( - name = name, - srcs = [], - tool = Label(":baseline_browserslist"), - stdout = out, - args = [baseline], - **kwargs - ) diff --git a/tools/baseline_browserslist/generate_browserslist.mts b/tools/baseline_browserslist/generate_browserslist.mts deleted file mode 100644 index 68dc8d7e2c5b..000000000000 --- a/tools/baseline_browserslist/generate_browserslist.mts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { getCompatibleVersions } from 'baseline-browser-mapping'; - -// Map `baseline-browser-mapping` browsers to `browserslist` browsers. -const browsers: Record = { - chrome: 'Chrome', - chrome_android: 'ChromeAndroid', - edge: 'Edge', - firefox: 'Firefox', - firefox_android: 'FirefoxAndroid', - safari: 'Safari', - safari_ios: 'iOS', -}; - -/** - * Generates the `browserslist` configuration for the given Baseline date. - * - * @param date The Baseline "widely available" date to generate a `browserslist` - * configuration for. Uses `YYYY-MM-DD` format. - * @returns The `browserslist` configuration file content. - */ -export function generateBrowserslist(date: string): string { - // Generate a `browserslist` configuration. - return getCompatibleVersions({ - widelyAvailableOnDate: date, - includeDownstreamBrowsers: false, - }) - .filter(({ browser }) => browsers[browser]) - .map(({ browser, version }) => `${browsers[browser]} >= ${version}`) - .join('\n'); -} diff --git a/tools/baseline_browserslist/generate_browserslist_spec.mts b/tools/baseline_browserslist/generate_browserslist_spec.mts deleted file mode 100644 index bbf5b529149b..000000000000 --- a/tools/baseline_browserslist/generate_browserslist_spec.mts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { generateBrowserslist } from './generate_browserslist.mjs'; - -describe('generate_browserslist', () => { - describe('generateBrowserslist', () => { - it('generates a `browserslist` file', () => { - expect(generateBrowserslist('2025-03-31').trim()).toBe( - ` -Chrome >= 105 -ChromeAndroid >= 105 -Edge >= 105 -Firefox >= 104 -FirefoxAndroid >= 104 -Safari >= 16 -iOS >= 16 - `.trim(), - ); - }); - }); -}); diff --git a/tools/baseline_browserslist/index.mts b/tools/baseline_browserslist/index.mts deleted file mode 100644 index 78d5aec5e3d5..000000000000 --- a/tools/baseline_browserslist/index.mts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import { generateBrowserslist } from './generate_browserslist.mjs'; - -const [baselineDate] = process.argv.slice(2); -const browserslist = generateBrowserslist(baselineDate); - -// eslint-disable-next-line no-console -console.log(browserslist); diff --git a/tools/baseline_browserslist/package.json b/tools/baseline_browserslist/package.json deleted file mode 100644 index 055c59705a2e..000000000000 --- a/tools/baseline_browserslist/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "module", - "devDependencies": { - "baseline-browser-mapping": "2.3.0" - } -} diff --git a/tools/baseline_browserslist/tsconfig-build.json b/tools/baseline_browserslist/tsconfig-build.json deleted file mode 100644 index acbbe1ae9949..000000000000 --- a/tools/baseline_browserslist/tsconfig-build.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig-build-esm.json", - "include": ["**.mts"], - "exclude": ["**_spec.mts"], - "compilerOptions": { - "types": ["node"] - } -} diff --git a/tools/baseline_browserslist/tsconfig-test.json b/tools/baseline_browserslist/tsconfig-test.json deleted file mode 100644 index 48ba7db3fd84..000000000000 --- a/tools/baseline_browserslist/tsconfig-test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig-test-esm.json", - "include": ["**_spec.mts"] -} diff --git a/tools/baseline_browserslist/tsconfig.json b/tools/baseline_browserslist/tsconfig.json deleted file mode 100644 index 53c965a91293..000000000000 --- a/tools/baseline_browserslist/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "files": [], - "references": ["./tsconfig-build.json", "./tsconfig-test.json"] -} diff --git a/tools/bazel/npm_package.bzl b/tools/bazel/npm_package.bzl index 0a76bfe1bb73..c6ce650d3971 100644 --- a/tools/bazel/npm_package.bzl +++ b/tools/bazel/npm_package.bzl @@ -45,7 +45,7 @@ def npm_package( pkg_label = to_label(pkg_dep) if pkg_label.name != "package.json": fail("ERROR: only package.json files allowed in pkg_deps of pkg_npm macro") - pkg_deps_copies.append("@%s//%s:package_json_copy" % (pkg_label.workspace_name, pkg_label.package)) + pkg_deps_copies.append("@@%s//%s:package_json_copy" % (pkg_label.repo_name, pkg_label.package)) # Substitute dependencies on other packages in this repo with tarballs. link_package_json_to_tarballs( @@ -119,6 +119,7 @@ def npm_package( name = "npm_package_archive", srcs = [":pkg"], extension = "tgz", - strip_prefix = "./npm_package", + # should not be built unless it is a dependency of another rule + tags = ["manual"], visibility = visibility, ) diff --git a/tools/defaults.bzl b/tools/defaults.bzl index 18f7f0d5fdc0..d301591a32ba 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -2,6 +2,7 @@ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin") load("@aspect_rules_jasmine//jasmine:defs.bzl", _jasmine_test = "jasmine_test") load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary") load("@devinfra//bazel/ts_project:index.bzl", "strict_deps_test") +load("@rules_angular//src/ng_examples_db:index.bzl", _ng_examples_db = "ng_examples_db") load("@rules_angular//src/ng_package:index.bzl", _ng_package = "ng_package") load("@rules_angular//src/ts_project:index.bzl", _ts_project = "ts_project") load("//tools:substitutions.bzl", "substitutions") @@ -12,8 +13,8 @@ def ts_project( deps = [], tsconfig = None, testonly = False, + source_map = True, visibility = None, - ignore_strict_deps = False, **kwargs): if tsconfig == None: tsconfig = "//:test-tsconfig" if testonly else "//:build-tsconfig" @@ -22,18 +23,19 @@ def ts_project( name = name, testonly = testonly, declaration = True, + source_map = source_map, tsconfig = tsconfig, visibility = visibility, deps = deps, **kwargs ) - if not ignore_strict_deps: - strict_deps_test( - name = "%s_strict_deps_test" % name, - srcs = kwargs.get("srcs", []), - deps = deps, - ) + strict_deps_test( + name = "%s_strict_deps_test" % name, + srcs = kwargs.get("srcs", []), + tsconfig = tsconfig, + deps = deps, + ) def npm_package(**kwargs): _npm_package(**kwargs) @@ -44,13 +46,16 @@ def copy_to_bin(**kwargs): def js_binary(**kwargs): _js_binary(**kwargs) -def ng_package(deps = [], **kwargs): +def ng_package(deps = [], extra_substitutions = {}, **kwargs): + nostamp_subs = dict(substitutions["nostamp"], **extra_substitutions) + stamp_subs = dict(substitutions["stamp"], **extra_substitutions) + _ng_package( deps = deps, license = "//:LICENSE", substitutions = select({ - "//:stamp": substitutions["stamp"], - "//conditions:default": substitutions["nostamp"], + "//:stamp": stamp_subs, + "//conditions:default": nostamp_subs, }), **kwargs ) @@ -65,10 +70,14 @@ def jasmine_test(data = [], args = [], **kwargs): chdir = native.package_name(), args = [ "--require=%s/node_modules/source-map-support/register.js" % relative_to_root, - "**/*spec.js", - "**/*spec.mjs", - "**/*spec.cjs", + # Escape so that the `js_binary` launcher triggers Bash expansion. + "'**/*+(.|_)spec.js'", + "'**/*+(.|_)spec.mjs'", + "'**/*+(.|_)spec.cjs'", ] + args, data = data + ["//:node_modules/source-map-support"], **kwargs ) + +def ng_examples_db(**kwargs): + _ng_examples_db(**kwargs) diff --git a/tools/link_package_json_to_tarballs.bzl b/tools/link_package_json_to_tarballs.bzl index 38172e53acc9..1a8ea5a17486 100644 --- a/tools/link_package_json_to_tarballs.bzl +++ b/tools/link_package_json_to_tarballs.bzl @@ -41,7 +41,7 @@ def link_package_json_to_tarballs(name, src, pkg_deps, out): # for the tar for this package as that would create a circular dependency. pkg_label = to_label(pkg_dep) if pkg_label.package != src_pkg: - pkg_tar = "@%s//%s:npm_package_archive.tgz" % (pkg_label.workspace_name, pkg_label.package) + pkg_tar = "@@%s//%s:npm_package_archive.tgz" % (pkg_label.repo_name, pkg_label.package) srcs.append(pkg_tar) # Deriving the absolute path to the tar in the execroot requries different diff --git a/tools/ng_cli_schema_generator.bzl b/tools/ng_cli_schema_generator.bzl index 9bcc4d287a6a..86d9552dd70c 100644 --- a/tools/ng_cli_schema_generator.bzl +++ b/tools/ng_cli_schema_generator.bzl @@ -4,6 +4,7 @@ def cli_json_schema(name, src, out, data = []): js_run_binary( name = name, outs = [out], + tags = ["schema"], srcs = [src] + data, tool = "//tools:ng_cli_schema", progress_message = "Generating CLI interface from %s" % src, diff --git a/tools/snapshot_repo_filter.bzl b/tools/snapshot_repo_filter.bzl index 00e26b44dd9d..a648e8e300a7 100644 --- a/tools/snapshot_repo_filter.bzl +++ b/tools/snapshot_repo_filter.bzl @@ -6,14 +6,23 @@ load("//:constants.bzl", "SNAPSHOT_REPOS") def _generate_snapshot_repo_filter(): - filter = "" - for (i, pkg_name) in enumerate(SNAPSHOT_REPOS.keys()): - filter += "{sep}(..|objects|select(has(\"{pkg_name}\")))[\"{pkg_name}\"] |= \"github:{snapshot_repo}#BUILD_SCM_HASH-PLACEHOLDER\"\n".format( - sep = "| " if i > 0 else "", - pkg_name = pkg_name, - snapshot_repo = SNAPSHOT_REPOS[pkg_name], + individual_pkg_filters = [] + for pkg_name, snapshot_repo in SNAPSHOT_REPOS.items(): + individual_pkg_filters.append( + """ + . as $root + | [paths(..)] + | [(.[] | select( + contains(["{pkg_name}"]) and + contains(["peerDependenciesMeta"]) != true))] as $paths + | $paths | reduce $paths[] as $path ($root; setpath($path; "github:{snapshot_repo}#BUILD_SCM_HASH-PLACEHOLDER")) | . + """.format( + pkg_name = pkg_name, + snapshot_repo = snapshot_repo, + ), ) - return filter + + return " | ".join(individual_pkg_filters) # jq filter that replaces package.json dependencies with snapshot repos SNAPSHOT_REPO_JQ_FILTER = _generate_snapshot_repo_filter() diff --git a/tools/substitutions.bzl b/tools/substitutions.bzl index 098b511b1d6e..dc40701971ff 100644 --- a/tools/substitutions.bzl +++ b/tools/substitutions.bzl @@ -1,11 +1,22 @@ -load("//:constants.bzl", "ANGULAR_FW_PEER_DEP", "ANGULAR_FW_VERSION", "NG_PACKAGR_PEER_DEP", "NG_PACKAGR_VERSION", "RELEASE_ENGINES_NODE", "RELEASE_ENGINES_NPM", "RELEASE_ENGINES_YARN") +load( + "//:constants.bzl", + "ANGULAR_FW_PEER_DEP", + "ANGULAR_FW_VERSION", + "BASELINE_DATE", + "NG_PACKAGR_PEER_DEP", + "NG_PACKAGR_VERSION", + "RELEASE_ENGINES_NODE", + "RELEASE_ENGINES_NPM", + "RELEASE_ENGINES_YARN", +) _stamp_substitutions = { # Version of the local package being built, generated via the `--workspace_status_command` flag. "0.0.0-PLACEHOLDER": "{{STABLE_PROJECT_VERSION}}", "0.0.0-EXPERIMENTAL-PLACEHOLDER": "{{STABLE_PROJECT_EXPERIMENTAL_VERSION}}", # --- - "BUILD_SCM_HASH-PLACEHOLDER": "{BUILD_SCM_ABBREV_HASH}", + "BUILD_SCM_HASH-PLACEHOLDER": "{{BUILD_SCM_ABBREV_HASH}}", + "BASELINE-DATE-PLACEHOLDER": BASELINE_DATE, "0.0.0-ENGINES-NODE": RELEASE_ENGINES_NODE, "0.0.0-ENGINES-NPM": RELEASE_ENGINES_NPM, "0.0.0-ENGINES-YARN": RELEASE_ENGINES_YARN, @@ -13,8 +24,6 @@ _stamp_substitutions = { "0.0.0-NG-PACKAGR-PEER-DEP": NG_PACKAGR_PEER_DEP, "0.0.0-ANGULAR-FW-VERSION": ANGULAR_FW_VERSION, "0.0.0-ANGULAR-FW-PEER-DEP": ANGULAR_FW_PEER_DEP, - # The below is needed for @angular/ssr FESM file. - "\\./(.+)/packages/angular/ssr/third_party/beasties": "../third_party/beasties/index.js", } _no_stamp_substitutions = dict(_stamp_substitutions, **{ diff --git a/tools/test/BUILD.bazel b/tools/test/BUILD.bazel index 2e651ae3e654..5d210ff7ac50 100644 --- a/tools/test/BUILD.bazel +++ b/tools/test/BUILD.bazel @@ -1,5 +1,5 @@ -load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("@aspect_bazel_lib//lib:jq.bzl", "jq") +load("@bazel_skylib//rules:diff_test.bzl", "diff_test") jq( name = "final_package_json", diff --git a/tools/test/expected_package.json b/tools/test/expected_package.json index a456312e8903..6630c9062f8a 100644 --- a/tools/test/expected_package.json +++ b/tools/test/expected_package.json @@ -35,8 +35,8 @@ } }, "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" + "node": "0.0.0-ENGINES-NODE", + "npm": "0.0.0-ENGINES-NPM", + "yarn": "0.0.0-ENGINES-YARN" } } diff --git a/tools/toolchains/BUILD.bazel b/tools/toolchains/BUILD.bazel new file mode 100644 index 000000000000..1abb54e5faa7 --- /dev/null +++ b/tools/toolchains/BUILD.bazel @@ -0,0 +1,44 @@ +load("@rules_cc//cc:defs.bzl", "cc_toolchain") +load(":dummy_cc_toolchain.bzl", "dummy_cc_toolchain_config") + +# This is needed following https://github.com/bazel-contrib/rules_nodejs/pull/3859 +toolchain( + name = "node22_windows_no_exec_toolchain", + exec_compatible_with = [], + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + toolchain = "@node22_windows_amd64//:toolchain", + toolchain_type = "@rules_nodejs//nodejs:toolchain_type", +) + +# This defines a dummy C++ toolchain for Windows. +# Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution". +dummy_cc_toolchain_config(name = "dummy_cc_toolchain_config") + +filegroup(name = "empty") + +cc_toolchain( + name = "dummy_cc_toolchain", + all_files = ":empty", + compiler_files = ":empty", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 0, + toolchain_config = ":dummy_cc_toolchain_config", + toolchain_identifier = "dummy_cc_toolchain", +) + +toolchain( + name = "dummy_cc_windows_no_exec_toolchain", + exec_compatible_with = [], + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + toolchain = ":dummy_cc_toolchain", + toolchain_type = "@rules_cc//cc:toolchain_type", +) diff --git a/tools/toolchains/dummy_cc_toolchain.bzl b/tools/toolchains/dummy_cc_toolchain.bzl new file mode 100644 index 000000000000..a18a9c780915 --- /dev/null +++ b/tools/toolchains/dummy_cc_toolchain.bzl @@ -0,0 +1,28 @@ +""" +This file defines a dummy C++ toolchain for Windows. +It is needed to satisfy Bazel's toolchain resolution when cross-compiling for Windows on Linux. +Some rules (e.g. rules_nodejs, js_test) or their dependencies may trigger C++ toolchain resolution +even if no actual C++ compilation is performed for the target platform. +Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution". +""" + +load("@rules_cc//cc:defs.bzl", "cc_common") + +def _impl(ctx): + return cc_common.create_cc_toolchain_config_info( + ctx = ctx, + toolchain_identifier = "dummy-toolchain", + host_system_name = "local", + target_system_name = "local", + target_cpu = "x64_windows", + target_libc = "unknown", + compiler = "dummy", + abi_version = "unknown", + abi_libc_version = "unknown", + ) + +dummy_cc_toolchain_config = rule( + implementation = _impl, + attrs = {}, + provides = [CcToolchainConfigInfo], +) diff --git a/tools/ts_json_schema.bzl b/tools/ts_json_schema.bzl index deb34c0af597..dab651d0d7e0 100644 --- a/tools/ts_json_schema.bzl +++ b/tools/ts_json_schema.bzl @@ -12,6 +12,7 @@ def ts_json_schema(name, src, data = []): name = name + ".interface", outs = [out], srcs = [src] + data, + tags = ["schema"], tool = "//tools:quicktype_runner", progress_message = "Generating TS interface for %s" % src, mnemonic = "TsJsonSchema", diff --git a/tsconfig-build-esm.json b/tsconfig-build-esm.json index 5a548be0a88f..8682ad1fbdc5 100644 --- a/tsconfig-build-esm.json +++ b/tsconfig-build-esm.json @@ -8,7 +8,7 @@ "compilerOptions": { "module": "esnext", "target": "es2022", - "lib": ["es2020"], + "lib": ["es2022"], // don't auto-discover @types/node, it results in a ///